Virtual resource migration method, medium, product and electronic equipment

By establishing a communication link between storage devices during virtual machine migration, the method addresses the issue of prolonged downtime caused by large storage data transfers, enabling efficient and uninterrupted virtual machine migration across resource pools.

CN120315801APending Publication Date: 2025-07-15HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410050629.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

During the migration process of virtual machines across resource pools, storage resources are not shared between different resource pools, storage data migration time is long, resulting in a long business interruption time.

Method used

Create a blank target cloud hard disk and virtual machine in the target resource pool, and establish a communication connection between the original storage device and the target storage device. The target virtual machine reads and writes data from the original storage device through the communication connection, reducing the waiting time for stored data during the migration process.

Benefits of technology

It shortens the time required for virtual machine migration and reduces business interruption time. The target virtual machine can be used normally after migration, reducing business impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120315801A_ABST
    Figure CN120315801A_ABST
Patent Text Reader

Abstract

The invention is applied to the technical field of computers, and provides a virtual resource migration method, a medium, a product and electronic equipment. The method comprises the steps of creating a blank target LUN in target storage equipment of a target resource pool, and establishing communication connection between original storage equipment of an original resource pool and the target storage equipment, so that the target storage equipment can access data of an original LUN in the original storage equipment. And then, creating a target virtual machine consistent with the configuration of the virtual machine to be migrated in the target resource pool, and starting the target virtual machine. When the target virtual machine reads and writes the data, if the data block needing to be read is not written into the target LUN before, the target virtual machine can read the data from the original LUN through the communication connection and store the data into the target LUN, and the read-write condition of the data block is recorded. In this way, only the virtual machine needs to be migrated firstly without waiting for migration of data of the cloud hard disk, and the time required for migration is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and in particular, to a virtual resource migration method, medium, product, and electronic device. Background Art

[0002] The resource pool of a virtualized environment consists of a control node, computing nodes, network devices, storage devices, etc. One or more virtual machines can run on the computing nodes. However, due to actual networking and device service capacity limitations, the virtualized environment is divided into multiple resource pools. Different resource pools do not share storage resources, and the networks between the resource pools are independent of each other.

[0003] However, when migrating a virtual machine across resource pools, for example, migrating a virtual machine to be migrated from an original resource pool to a target resource pool, during the migration process, in addition to creating a virtual machine with the same configuration as the virtual machine to be migrated in the target resource pool, since storage resources are not shared between different resource pools, it is also necessary to migrate the storage resources corresponding to the virtual machine to be migrated, such as the data corresponding to a cloud hard disk, to the target resource pool. However, usually, the amount of data of the storage resources corresponding to the virtual machine to be migrated is large, and migrating the storage resources takes a long time, which will cause the service interruption time corresponding to the virtual machine to be migrated to be relatively long. Summary of the Invention

[0004] In view of this, this application provides a virtual resource migration method, medium, product, and electronic device.

[0005] In a first aspect, a virtual resource migration method is provided, including: creating a first cloud hard disk and a first virtual machine in a first resource pool, where the first virtual machine has the same configuration as a second virtual machine to be migrated in a second resource pool, the first cloud hard disk corresponds to a first logical storage unit, and a first storage space corresponding to the first logical storage unit is located in a first storage device of the first resource pool; controlling the first storage device to establish a communication connection with a second storage device in the second resource pool, where the second storage device includes a second storage space corresponding to a second logical storage unit, and the second storage space stores data of the second virtual machine; starting the first virtual machine, where the first virtual machine is used to migrate, during operation, data of the second logical storage unit stored in the second storage space of the second storage device to the first storage space of the first storage device corresponding to the first logical storage unit based on the communication connection.

[0006] In the above solution, the first resource pool can also be referred to as the target resource pool, the first cloud hard disk can also be referred to as the target cloud hard disk, the first virtual machine can also be referred to as the target virtual machine, the first logical storage unit can also be referred to as the target logical storage unit, and the first storage device can also be referred to as the target storage device. The second resource pool can also be referred to as the original resource pool, the second cloud hard disk can also be referred to as the original cloud hard disk, the second virtual machine can also be referred to as the virtual machine to be migrated, the second logical storage unit can also be referred to as the original logical storage unit, and the second storage device can also be referred to as the original storage device.

[0007] When it is necessary to migrate the virtual machine to be migrated to the target resource pool, a blank target cloud hard disk can be created in the target resource pool, that is, the target logical storage unit is a blank volume, and a communication connection is established between the original storage device and the target storage device, so that the target storage device can access the data in the original logical storage unit of the original storage device, where the data of the virtual machine to be migrated is stored in the original logical storage unit. And, a target virtual machine corresponding to the configuration of the virtual machine to be migrated is created in the target resource pool, and the target virtual machine is started. When the target virtual machine needs to read and write data, if it is determined that the data block to be read has not been written to the target logical storage unit before, the target virtual machine can read the data from the original logical storage unit through the communication connection and store it in the target logical storage unit for the target virtual machine to read and write.

[0008] In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud hard disk data, which shortens the time required for virtual machine migration. And, the target virtual machine can be used normally after migration, and can read from the original logical storage unit through the communication connection, reducing the interruption time of the service corresponding to the virtual machine.

[0009] Combined with the first aspect, in some implementation manners, the method further includes: sending an instruction to the first storage device to establish a communication connection with the second storage device; or, sending an instruction to the second storage device to establish a communication connection with the first storage device.

[0010] In the above solution, an instruction to establish a communication connection can be sent to the target storage device and / or the original storage device, and the target storage device and / or the original storage device sends a request to establish a communication connection to the peer storage device. After the target storage device and the original storage device establish a connection, the target storage device and the original storage device will also establish a mutual access relationship, so that the target storage device can read the data in the original storage device. In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud hard disk data, which shortens the time required for virtual machine migration.

[0011] In combination with the first aspect, in some implementation manners, the method further includes: performing a read and write record on the data already written in the first logical storage unit; receiving a request from the first virtual machine during operation to read a first data block from the first storage device; corresponding to the read and write record indicating that the first data block has been written in the first logical storage unit, reading the first data block from the first logical storage unit and sending it to the first virtual machine; corresponding to the read and write record not indicating that the first data block has been written in the first logical storage unit, based on the communication connection between the first storage device and the second storage device, reading the first data block from the second logical storage unit and sending it to the first virtual machine.

[0012] In the above solution, since there is no data in the target cloud disk when the target virtual machine is just created, if the target virtual machine needs to read data, the target storage device corresponding to the target cloud disk can obtain the data required for the current operation of the target virtual machine from the original storage device through the communication connection with the original storage device and send it to the target virtual machine. Moreover, it is also possible to record the data blocks read and written by the target virtual machine. In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud disk data, thus shortening the time required for virtual machine migration.

[0013] In combination with the first aspect, in some implementation manners, the method further includes: based on the read and write record determining that the first data block has not been written in the first logical storage unit, writing the first data block read from the second logical storage unit into the first logical storage unit.

[0014] In the above solution, the data read from the original storage device will also be written into the target logical storage unit. If the target virtual machine needs to read and write the data blocks that have been read and written later, the target storage device can directly read the corresponding data from the target logical storage unit. Furthermore, the target virtual machine can read data from the local device, shortening the data reading time.

[0015] In combination with the first aspect, in some implementation manners, the method further includes: based on detecting a first condition, reading all the data of the second logical storage unit through the communication connection; determining the data that has not been written in the first logical storage unit from all the data read from the second logical storage unit; writing the data that has not been written in the first logical storage unit into the first logical storage unit.

[0016] In combination with the first aspect, in some implementation manners, the first condition includes: the running time of the first virtual machine reaches a preset duration and / or the first virtual machine pauses running.

[0017] In the above solution, after determining that the target virtual machine pauses running or the running time reaches the preset time, it will notify the target cloud hard disk to obtain full data, that is, the target storage device will obtain all the data that the target virtual machine has not read or written from the original logical storage unit to complete the migration of all cloud hard disk data. In this way, it does not affect the operation of the services on the virtual machine and has a relatively low impact on the services.

[0018] In combination with the first aspect, in some implementation manners, the method further includes: based on detecting that all the data of the second logical storage unit has been obtained, controlling the first storage device to disconnect the communication connection with the second storage device.

[0019] In the above solution, in the case that the target logical storage unit has obtained all the data of the original logical storage unit, the connection between the first storage device and the second storage device can be disconnected. Furthermore, the target virtual machine can read data from the local device, shortening the data reading time.

[0020] In a second aspect, a virtual resource migration method is provided, including: a first virtual machine in a cloud platform detecting a request to read a first data block; the first virtual machine determining that the first logical storage unit does not store the first data block, the first storage space corresponding to the first logical storage unit being located in a first storage device, the first storage device and the first virtual machine belonging to a first resource pool; the first virtual machine reading the first data block from a second logical storage unit, where the second storage space corresponding to the second logical storage unit is located in a second storage device of a second resource pool, the second storage space storing data of a second virtual machine, the second virtual machine having the same configuration as the first virtual machine, and a communication connection being established between the first storage device and the second storage device.

[0021] In a third aspect, the present application provides an electronic device, including a processor and a memory, the memory being used to store instructions, the processor being used to execute the instructions, and when the processor executes the instructions, the method described in the first aspect is executed.

[0022] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored, and when the instructions run on an electronic device, the method described in the first aspect is executed.

[0023] In a fifth aspect, the present application provides a computer program product, the computer program product including computer instructions, and when the computer instructions are executed by an electronic device, the electronic device executes the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings required for describing the embodiments will be briefly introduced below.

[0025] Figure 1AIt is a schematic diagram of a cloud platform architecture provided by an embodiment of the present application;

[0026] Figure 1B It is a schematic diagram of the corresponding relationship between a logical storage unit and a storage space provided by an embodiment of the present application;

[0027] Figure 2A It is a schematic flowchart of a virtual resource migration method provided by an embodiment of the present application;

[0028] Figure 2B It is a schematic flowchart of another virtual resource migration method provided by an embodiment of the present application;

[0029] Figure 3 It is a schematic diagram of a migration system implementing a virtual resource migration method provided by an embodiment of the present application;

[0030] Figure 4 It is a schematic flowchart of yet another virtual resource migration method provided by an embodiment of the present application;

[0031] Figure 5 It is a schematic diagram of a migration system completing preparatory work provided by an embodiment of the present application;

[0032] Figure 6 It is a schematic diagram of a migration system migrating a virtual machine provided by an embodiment of the present application;

[0033] Figure 7 It is a schematic diagram of a migration system copying cloud hard disk data provided by an embodiment of the present application;

[0034] Figure 8 It is a schematic diagram of a disk reading program achieving full - volume reading provided by an embodiment of the present application;

[0035] Figure 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0036] The illustrative embodiments of the present application include, but are not limited to, virtual resource migration methods, media, products, and electronic devices.

[0037] It can be understood that the virtual resource migration mentioned in the embodiments of the present application can be applied to the migration of instances such as virtual machines, containers, and bare - metal servers. For the sake of convenience of description, the migration of virtual machines is taken as an example for illustration below.

[0038] The architecture of the cloud platform involved in the embodiments of the present application will be introduced first. As Figure 1A shown, the architecture includes a cloud management platform 10 and multiple resource pools (such as resource pool 20 and resource pool 30). It should be understood that the cloud platform may also include other platforms or devices, and the present application places no restrictions thereon.

[0039] The cloud management platform 10 includes a migration system 11 and a monitoring system 12. The migration system 11 can migrate virtual resources in the resource pool and their corresponding hard disk data. The monitoring system 12 can be used to monitor the usage of each device or virtual resource in each resource pool. It should be understood that the cloud management platform 10 may also include business systems such as instance management, backup management, and metering management, which are not limited in this application.

[0040] The resource pool 20 and the resource pool 30 include multiple hosts. One or more instances are running on each host. Herein, an instance essentially refers to a container or virtual machine after virtualization of various resources, including virtualized hardware resource instances such as servers and memories of different specifications, and also includes software resource instances such as cloud database instances and cloud application instances of different specifications.

[0041] As mentioned above, the resource pool specifically includes devices such as control nodes, computing nodes, network devices, and storage devices. In some embodiments, the computing node and the storage device may be independent devices, that is, a separated storage and computing structure. For example, the computing node may include virtual machines and cloud hard disks, where the cloud hard disk is a virtual block storage service, and the data of the cloud hard disk is actually stored in the storage device. In other embodiments, the computing node and the storage device may also be the same device connected by a bus, that is, an integrated storage and computing structure. For example, the data in the virtual machine is directly stored in the hard disk of the same device.

[0042] Hereinafter, the resource pool 20 with a separated storage and computing structure and the resource pool 30 with an integrated storage and computing structure will be taken as examples for introduction.

[0043] As Figure 1AAs shown in the figure, the resource pool 20 includes a control node 21, a computing node 22, a network device 23, and a storage device 24. The control node 21 is used to process requests from the outside (such as the cloud management platform 10 or other devices), and can also be used to process requests generated inside the resource pool 20. The computing node 22 includes virtual resources corresponding to one or more instances. Taking the virtual resources including a virtual machine 231 and a cloud hard disk 232 as an example, the data corresponding to the virtual machine 231 is stored in the cloud hard disk 232 mounted on the virtual machine 231. The data of the cloud hard disk 232 is actually stored in a logical unit (LUN) 241 in the storage device 24. The storage device 24 has a control unit for processing received read and write data requests. For example, when receiving a data write request sent by the virtual machine 231 to the cloud hard disk 232, the data will be written to the corresponding LUN 241. When receiving a data read request sent by the virtual machine 231 to the cloud hard disk 232, the corresponding data will be read from the LUN 241 and returned to the cloud hard disk 232. The network device 23 can be used to be responsible for the communication between the computing node 22 and the storage device 24, and can also be used to process the communication between the resource pool 20 and the cloud management platform 10 or other resource pools.

[0044] Figure 1B The relationship between the cloud hard disk 232 and the storage device 24 is introduced. Among them, the cloud hard disk 232 is mounted on the virtual machine 231, and then the data of the virtual machine 231 can be stored in the cloud hard disk 232. The cloud hard disk 232 corresponds to multiple logical storage units in the storage device 24, such as LUN241-a to LUN241-n. The logical storage unit corresponds to one or more physical storage spaces in the storage device, such as storage space 1 to storage space M.

[0045] The resource pool 30 includes a control node 31, a storage and computing node 32, and a network device 33. Figure 1A Taking the storage and computing node 32 including a virtual machine 321 and a hard disk 322 as an example, the data corresponding to the virtual machine 321 can be directly stored in the LUN 323 in the hard disk 322.

[0046] However, when the resource pool is not sufficient to provide enough storage resources or computing power for the supported services, or when the resource pool needs to be integrated, or when load balancing needs to be performed on each resource pool, etc., it is necessary to migrate virtual machines across resource pools. That is, the virtual machine to be migrated is migrated from the original resource pool to the target resource pool. It should be understood that the original resource pool and the target resource pool can be resource pools belonging to the same cloud management platform as shown in Figure 1A the figure, or can also be resource pools belonging to different cloud management platforms. The original resource pool and the target resource pool can be storage and computing integrated resource pools, or can also be storage and computing separated resource pools.

[0047] Taking the separated storage and computing architecture as an example, the process of migrating a virtual machine to be migrated from the original resource pool to the target resource pool includes: first shutting down the virtual machine to be migrated in the original resource pool, then creating an image file from the cloud hard disk of the virtual machine to be migrated, and then sending the image file to the target resource pool. The target resource pool can create a target virtual machine based on the image file, thereby realizing the cross-resource pool migration or cross-cloud platform migration of the virtual machine to be migrated.

[0048] However, the total time required to migrate the virtual machine in this way includes the time for creating the image of the virtual machine to be migrated, the time for transmitting the image, the time for uploading the image in the target resource pool, and the time for virtual machine reconstruction and orchestration. Moreover, the data volume of the image file of the virtual machine, that is, the data of the cloud hard disk, is large, and the time required for creating and transmitting the image file is long, which will result in a long interruption time of the service corresponding to the virtual machine to be migrated.

[0049] To solve the problem of the long interruption time of the virtual machine during the virtual machine migration process, the present application provides a virtual resource migration method, which creates a blank target LUN in the target storage device of the target resource pool, and establishes a communication connection between the original storage device of the original resource pool and the target storage device, so that the target storage device can access the data of the original LUN in the original storage device, where the original LUN stores the data of the virtual machine to be migrated. Then, a target virtual machine corresponding to the configuration of the virtual machine to be migrated is created in the target resource pool, and the target virtual machine is started. When the target virtual machine needs to read and write data, if it is determined that the data block to be read has not been written to the target LUN before, the target virtual machine can read the data from the original LUN through the communication connection and store it in the target LUN for the target virtual machine to read and write, and record the read and write situation of the data block. When the data block needs to be read and written again later, it can be determined through the read and write record that the data block has been stored in the target LUN, and then the target virtual machine can directly read and write the data from the target LUN.

[0050] In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud hard disk data, which shortens the time required for virtual machine migration. Moreover, the target virtual machine can be used normally after migration, and specifically, it can be determined to read data from the original LUN or the target LUN according to the read and write record, reducing the interruption time of the service corresponding to the virtual machine.

[0051] It should be understood that the original resource pool and the target resource pool can be a structure that integrates storage and computing, or a structure that separates storage and computing. That is to say, it can be to migrate the virtual machine to be migrated in the original resource pool with a storage-computing integrated structure to the target resource pool with a storage-computing separated structure. In this case, a connection needs to be established between the hard disk of the storage-computing node in the original resource pool and the storage device in the target resource pool. It can also be to migrate the virtual machine to be migrated in the original resource pool with a storage-computing integrated structure to the target resource pool with a storage-computing integrated structure. In this case, a connection needs to be established between the hard disk of the storage-computing node in the original resource pool and the hard disk of the storage-computing node in the target resource pool. It can also be to migrate the virtual machine to be migrated in the original resource pool with a storage-computing separated structure to the target resource pool with a storage-computing separated structure. In this case, a connection needs to be established between the storage device in the original resource pool and the storage device in the target resource pool. It can also be to migrate the virtual machine to be migrated in the original resource pool with a storage-computing separated structure to the target resource pool with a storage-computing integrated structure. In this case, a connection needs to be established between the storage device in the original resource pool and the hard disk of the storage-computing node in the target resource pool.

[0052] In some embodiments, the reading and writing of data blocks can be recorded by a storage arbitration program. For example, a storage arbitration program can be installed in the target storage device. When the target virtual machine needs to read and write data, if the storage arbitration program determines that the data block to be read already exists in the target LUN, the storage arbitration program reads the data from the original LUN and sends it to the target virtual machine, and stores the read data into the target LUN. Moreover, the storage arbitration program will also record the data block. When it is necessary to read and write the data block again later, the storage arbitration program can determine that the data block is stored in the target LUN, and thus can directly read the data from the target LUN and send it to the target virtual machine.

[0053] In other embodiments, a disk reading program can also be installed in the computing node of the target resource pool. After determining that the target virtual machine pauses running or the running time reaches the preset time, the disk reading program will obtain the data that the target virtual machine has not read and written from the original LUN to complete the migration of all cloud hard disk data. And after the disk reading program completes the migration of all cloud hard disk data, the communication connection between the original LUN and the target LUN can also be disconnected, and the storage arbitration program can be ended. Furthermore, the target virtual machine can directly read and write data from the target LUN.

[0054] It should be understood that the virtual resource migration method provided in this application can be executed by an electronic device for executing the migration system function in a cloud management platform, or an electronic device such as a computing node, a storage and computing node, or a control node in a resource pool. The above-mentioned electronic devices can be terminal devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), and netbooks. The electronic device can also be a physical server or a cloud device, etc., such as an X86 server, an ARM server, etc., and can also be a virtual machine (VM) implemented based on a general physical server combined with network functions virtualization (NFV) technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. This application does not impose any restrictions on the specific type of the electronic device.

[0055] The virtual resource migration method provided in the embodiments of this application will be introduced below. This method can be applied to the above-mentioned migration system 11. This migration system can be deployed in an electronic device in a cloud management platform 10, and can also be deployed in an electronic device such as a computing node, a storage and computing node, or a control node in a resource pool. And this electronic device can communicate with the computing nodes and / or storage nodes of the original resource pool and the target resource pool.

[0056] As Figure 2A shown, this method specifically includes:

[0057] S210: Detect a migration request to migrate the virtual machine to be migrated in the original resource pool to the target resource pool.

[0058] When the original resource pool (as an instance of the second resource pool) is insufficient to provide sufficient storage resources or computing power for the virtual machine to be migrated (as an instance of the second virtual machine), or when it is necessary to integrate the original resource pool and the target resource pool (as an instance of the first resource pool), or when it is necessary to balance the services carried by the original resource pool and the target resource pool, etc., in cases where virtual machine migration is required, for example, migrating the virtual machine to be migrated in the original resource pool to the target resource pool, a virtual machine migration can be initiated.

[0059] Among them, the migration request for migrating the virtual machine to be migrated to the target resource pool can be initiated by a user or a cloud management platform. For example, the user can send a migration request to the electronic device based on the above situation where the virtual machine needs to be migrated, or when the cloud management platform detects the above situation where the virtual machine needs to be migrated, it can also automatically send a migration request to the electronic device.

[0060] It should be understood that the migration request can also be initiated by other devices. For example, it can be a device in the original resource pool or the target resource pool. The present application does not make specific restrictions on the object initiating the migration request.

[0061] S220: Create a target cloud disk and a target virtual machine in the target resource pool.

[0062] The electronic device will obtain the configuration information of the virtual machine to be migrated in the original resource pool and the data required for the operation of the virtual machine to be migrated, and then create a target virtual machine (as an instance of the first virtual machine) in the storage and computing nodes or computing nodes of the target resource pool that is consistent with the configuration of the virtual machine to be migrated. Among them, the configuration information of the virtual machine to be migrated includes, but is not limited to: the number of cores of the central processing unit (CPU), the memory capacity, the disk space size, the bandwidth, and other information. The data required for the operation of the virtual machine to be migrated includes necessary data such as the executable program of the virtual machine to be migrated to ensure that the target virtual machine can run and start in the target resource pool. It should be understood that the original storage device (as an instance of the second storage device) in the original resource pool also stores other business data of the virtual machine to be migrated, and this business data is different from the necessary data required for the operation of the virtual machine to be migrated.

[0063] The electronic device will also create a corresponding target cloud disk (as an instance of the first cloud disk) in the target resource pool. The target cloud disk corresponds to the target LUN (as an instance of the first logical storage unit) in the target storage device, and the storage space (as an instance of the first storage space) corresponding to the target LUN is located in the target storage device (as an instance of the first storage device) in the target resource pool. Among them, the target LUN is a blank volume that does not include data.

[0064] S230: Control the target storage device and the original storage device to establish a communication connection.

[0065] The electronic device will control the target storage device and the original storage device to establish a communication connection. Among them, the original storage device includes the storage space (as an instance of the second storage space) corresponding to the original LUN (as an instance of the second logical storage unit) that stores the data of the virtual machine to be migrated.

[0066] Among them, the electronic device may send an instruction to establish a communication connection to the target storage device and / or the original storage device, and the target storage device and / or the original storage device initiate a request to establish a communication connection to the peer storage device. After the target storage device and the original storage device establish a connection, the target storage device and the original storage device will also establish a mutual access relationship, enabling the target storage device to read the data in the original storage device.

[0067] In some embodiments, the communication connection between the target storage device and the original storage device may be a connection based on the Internet Small Computer System Interface (iSCSI), such as a direct attached storage (DAS), a storage area network (SAN), etc. It may also be a communication connection based on a fibre channel (FC) or a fibre channel over ethernet (FCoE), etc. It should be understood that this application does not specifically limit the type of communication connection between the target storage device and the original storage device.

[0068] S240: Start the target virtual machine.

[0069] The electronic device may start the target virtual machine through the connection with the target resource pool. At this time, since the target cloud disk corresponding to the target virtual machine does not include data, if the target virtual machine needs to read data, the target storage device corresponding to the target cloud disk of the target virtual machine may obtain the data required for the current operation of the target virtual machine from the original storage device through the communication connection with the original storage device, write the data into the target LUN, and send it to the target virtual machine. If the target virtual machine needs to write data, the target virtual machine may directly write the data into the target LUN through the target cloud disk.

[0070] Moreover, the target storage device or the target computing node corresponding to the target virtual machine may also record the data blocks read and written by the target virtual machine. If the target virtual machine needs to read and write the data blocks that have been read and written later, the target storage device may directly read the corresponding data from the target LUN or directly write the data into the target LUN.

[0071] In some embodiments, the migration system of the electronic device includes a storage arbitration program, and the electronic device may install the storage arbitration program in the target storage device. The storage arbitration program records the reading and writing of data blocks, and determines whether to read data from the target LUN or the original LUN.

[0072] In some other embodiments, the migration system of the electronic device includes a disk reading program, and the electronic device can install the disk reading program in the computing nodes of the target resource pool. After determining that the target virtual machine pauses running or the running time reaches the preset time, the disk reading program will notify the target cloud hard disk to obtain the full amount of data, that is, the target storage device will obtain all the data that the target virtual machine has not read or written from the original LUN to complete the migration of all the cloud hard disk data.

[0073] In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud hard disk data, which shortens the time required for virtual machine migration and reduces the interruption time of the service corresponding to the virtual machine. After the virtual machine pauses use or reaches the preset time, then reading all the data into the target resource pool will not affect the running of the service on the virtual machine and has a relatively low impact on the service.

[0074] The following Figure 2B further describes the above virtual resource migration method. This method is applied to the aforementioned electronic device, original resource pool, and target resource pool, and is specifically described by taking the original resource pool and the target resource pool as a storage-computation separation structure as an example. In some embodiments, the original resource pool and the target resource pool can also be a storage-computation integrated structure, that is, combining the computing nodes and storage devices. As Figure 2B shown, this method specifically includes:

[0075] S301: The electronic device detects a migration request.

[0076] When the user or the cloud management platform finds that the original resource pool is not sufficient to provide enough storage resources or computing power for the virtual machine to be migrated, or when it is necessary to integrate the original resource pool and the target resource pool, etc., in cases where the virtual machine needs to be migrated, a migration request can be sent to the electronic device. This migration request is used to request migrating the virtual machine to be migrated in the original resource pool to the target resource pool. For details, please refer to the aforementioned step S210, which will not be elaborated here.

[0077] S302: The electronic device obtains the configuration information of the virtual machine to be migrated from the computing nodes of the original resource pool.

[0078] The electronic device can obtain the configuration information of the virtual machine to be migrated by connecting to the computing nodes in the original resource pool. For details, please refer to the aforementioned step S220, which will not be elaborated here.

[0079] S303: The electronic device creates a target virtual machine in the computing nodes of the target resource pool based on the configuration information of the virtual machine to be migrated, and synchronizes the necessary data required for the running of the virtual machine to be migrated to the target virtual machine.

[0080] The electronic device may create a target virtual machine with the same configuration as the virtual machine to be migrated in a computing node of a target resource pool according to the configuration information of the virtual machine to be migrated and necessary data required for operation.

[0081] For example, the electronic device may establish a communication connection between computing nodes in the original resource pool and the target resource pool, so that the target resource pool may transmit necessary data of the original virtual machine to the target resource pool based on the connection.

[0082] S304-1: The electronic device creates a target cloud hard disk in a computing node of a target resource pool.

[0083] S304-2: The electronic device creates a target LUN in the storage device of the target resource pool.

[0084] The electronic device will also create a corresponding target cloud hard disk in the target resource pool. The target cloud hard disk corresponds to the target LUN in the target storage device. The storage space corresponding to the target LUN is located in the target storage device in the target resource pool. The target LUN is a blank volume that does not include data. In addition, the electronic device can also create multiple target cloud hard disks and / or multiple target LUNs for the target virtual machine based on the memory capacity, disk space size and other information in the configuration information of the virtual machine to be migrated.

[0085] In some embodiments, step S303, step S304-1 and step S304-2 may be executed simultaneously, or step S304-1 and step S304-2 may be executed before step S303. This application does not impose any specific restrictions on the execution order of step S303, step S304-1 and step S304-2.

[0086] S305-1: The electronic device notifies the storage device of the original resource pool to establish a connection with the target resource pool.

[0087] The electronic device can send an instruction to establish a communication connection to the original storage device in the original resource pool, and the original storage device initiates a request to establish a communication connection to the peer storage device. After the target storage device and the original storage device establish a connection, the target storage device and the original storage device will also establish a mutual access relationship, so that the target storage device can read the data in the original storage device.

[0088] S305-2: The electronic device notifies the storage device of the target resource pool to establish a connection with the original resource pool.

[0089] The electronic device may also send an instruction to establish a communication connection to the storage device in the target resource pool, and the target storage device may initiate a request to establish a communication connection to the opposite storage device.

[0090] In some embodiments, the electronic device may only execute any one of steps S305-1 or S305-2.

[0091] S306: The storage devices of the original resource pool and the target resource pool establish a communication connection for the storage devices.

[0092] After receiving the request for establishing a communication connection sent by the electronic device, the original resource pool and the target resource pool may establish a connection with the storage devices in the peer resource pool and establish an access relationship between the storage devices of both sides.

[0093] S307-1: The electronic device installs a disk reading program in the computing nodes of the target resource pool.

[0094] The electronic device will install a disk reading program in the computing nodes of the target resource pool. After determining that the target virtual machine pauses running or the running time reaches the preset time, the disk reading program will notify the target cloud hard disk to obtain full-volume data to complete the migration of all cloud hard disk data.

[0095] S307-2: The electronic device installs a storage arbitration program in the storage devices of the target resource pool.

[0096] The electronic device may install a storage arbitration program in the target storage device. The storage arbitration program records the reading and writing of data blocks, which is specifically implemented by intercepting and proxying the input / output (IO) of cloud hard disk B. The storage arbitration program is used to determine whether to read data from the target LUN or the original LUN for the target virtual machine.

[0097] In some embodiments, step S307-2 may be executed before step S307-1, or step S307-2 and step S307-1 may also be executed synchronously.

[0098] S308: The electronic device starts the target virtual machine.

[0099] The electronic device may start the target virtual machine in the target resource pool through the connection with the computing nodes in the target resource pool.

[0100] S309: The computing nodes of the target resource pool send a request for reading data to the storage devices of the target resource pool.

[0101] After the target virtual machine in the target resource pool is started, the services carried by the target virtual machine can run. After the target virtual machine is started, if the target virtual machine needs to read data, the storage arbitration program will receive the request for the data that the target virtual machine needs to read.

[0102] S310: The storage device of the target resource pool determines whether the data to be read is stored in the target LUN. If not, step S311 is executed; if so, step S314 is executed.

[0103] The storage arbitration program in the storage device of the target resource pool determines whether the data block has been written in the target LUN based on information such as the address of the data block that the target virtual machine needs to read, and further determines whether to read the data from the original LUN or the target LUN.

[0104] S311: The storage device of the target resource pool reads data from the original LUN.

[0105] When the storage arbitration program determines that the data block has not been written in the target LUN, the storage arbitration program will read the data of the data block from the original LUN.

[0106] S312: The storage device of the target resource pool sends the read data to the compute node of the target resource pool.

[0107] After the storage arbitration program reads the data, it will send the data to the target virtual machine for use.

[0108] S313: The storage device of the target resource pool stores the read data in the target LUN and records that the data block has been stored in the target LUN.

[0109] The storage arbitration program will also write the data into the target LUN for subsequent reading and writing by the target virtual machine. Moreover, it will record that the data block has been written into the target LUN so as to directly read the data block from the target LUN subsequently.

[0110] S314: The storage device of the target resource pool reads data from the target LUN.

[0111] When the storage arbitration program in the storage device of the target resource pool determines that the data block has been written in the target LUN, the storage arbitration program will directly read the data of the data block from the target LUN.

[0112] S315: The storage device of the target resource pool sends the read data to the compute node of the target resource pool.

[0113] S316: The storage device of the target resource pool receives a request to write data, writes the data into the target LUN, and records that the data block has been stored in the target LUN.

[0114] After the target virtual machine starts, if data needs to be written, the storage arbitration program can directly write the data into the target LUN after receiving the data write request. Moreover, the storage arbitration program will also record that the data block has been written into the target LUN.

[0115] It should be understood that the target virtual machine can write data only, read data only, or write data multiple times or read data multiple times. That is to say, this application does not limit the execution order of steps S309 to S315 and step S316. This application can also repeatedly execute steps S309 to S315 and step S316 multiple times.

[0116] S317: The computing node of the target resource pool detects an instruction to read the entire target cloud hard disk and starts the disk reading program.

[0117] After the target virtual machine pauses running or the running time reaches the preset time, for example, after the target virtual machine runs for 24 hours, a request to read the entire target cloud hard disk can be sent to the disk reading program. This request can be initiated by an electronic device through real-time monitoring of the running status of the target virtual machine. The electronic device can call the interface connected to the target resource pool to trigger the operation of the disk reading program. Alternatively, this request can also be generated by the computing node of the target resource pool itself. This application does not specifically limit the object that generates the request to read the entire target cloud hard disk.

[0118] S318: The storage device of the target resource pool reads all the data that has not been written to the target LUN from the storage device of the original resource pool.

[0119] After the disk reading program receives the request to read the entire target cloud hard disk, it will send a request to read the entire target cloud hard disk to the target cloud hard disk. Furthermore, the storage arbitration program will receive a request to read all the data and read all the data that has not been written to the target LUN from the original LUN.

[0120] S319: The storage device of the target resource pool writes the data to the target LUN.

[0121] The storage arbitration program can write all the read data to the target LUN and mount it to the corresponding target cloud hard disk.

[0122] S320: The computing node of the target resource pool ends the operation of the disk reading program.

[0123] Since all the data of the original LUN has been fully read into the target LUN, the target cloud hard disk can directly read data from the target LUN, and thus the disk reading program can be ended.

[0124] S321: The storage device of the target resource pool ends the operation of the storage arbitration program.

[0125] Since all the data of the original LUN has been fully read into the target LUN, the target cloud hard disk can directly read data from the target LUN, and thus the storage arbitration program can also be ended.

[0126] S322: The storage devices of the original resource pool and the target resource pool are disconnected from the communication connection.

[0127] Since the target cloud disk does not need to obtain data from the original resource pool, the communication connection between the original resource pool and the target resource pool can also be disconnected, ending the mutual access relationship between the original resource pool and the target resource pool.

[0128] In some embodiments, the storage device of the target resource pool can also perform a full-scale read synchronously while processing the data read and write requests of the target virtual machine, that is, execute steps S309 to S316, and synchronously execute steps S317 to S322. Among them, during the full-scale read process, if a data read and write request of the target virtual machine appears, the data read and write request of the target virtual machine can be preferentially processed, and the full-scale read process can be temporarily interrupted.

[0129] In this way, during the process of migrating the virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud disk data, which shortens the time required for virtual machine migration and reduces the interruption time of the service corresponding to the virtual machine. After the virtual machine is suspended or after a preset time, the data is then fully read into the target resource pool, which does not affect the operation of the service on the virtual machine and has a relatively low impact on the service.

[0130] The above virtual resource migration method will be illustrated by examples below. Specifically, taking the original resource pool and the target resource pool as a storage and computing separation structure as an example. As Figure 3 shown, resource pool A is the original resource pool, which has a control node, a computing node, a network device (abbreviated as network), and a storage device, etc. Among them, the computing node of resource pool A includes virtual machine A and cloud disk A. Virtual machine A is the virtual machine to be migrated, and the data of virtual machine A is stored in cloud disk A. Cloud disk A actually corresponds to LUN A in the storage device. Similarly, resource pool B is the target resource pool, which has a control node, a computing node, a network device (abbreviated as network), and a storage device, etc. The migration system 11 is a system in the cloud management platform 10, specifically including a virtual machine migration module 111 and a cloud disk data replication module 112.

[0131] It should be understood that virtual machine A can also be correspondingly mounted with multiple cloud disks, Figure 3 and only cloud disk A is taken as an example for illustration. There are multiple corresponding LUNs in the storage device, and cloud disk A can also correspond to multiple LUNs.

[0132] The migration system 11 connects resource pool A and resource pool B (corresponding to S1-1 and S1-2), that is, a northbound interface is established between resource pool A and resource pool B. This interface can be used to establish network communication between the storage devices of resource pool A and the storage devices of resource pool B (corresponding to S2-1 and S2-2), and configure the mutual access relationship between the storage devices (corresponding to S3). Optionally, the migration system 11 can also limit the communication network delay between the storage devices of resource pool A and resource pool B within a certain range, for example, within 1 millisecond, to ensure that resource pool B can quickly read the data in resource pool A subsequently.

[0133] The migration system 11 can create a data-free cloud disk B corresponding to LUN B in resource pool B according to the cloud disk information of virtual machine A. At the same time, the migration system 11 can also install a storage arbitration program on the storage device of resource pool B and install a disk reading program on the computing nodes of resource pool B. Among them, the storage arbitration program is used to record the read and write data conditions in LUN B, specifically implemented by intercepting and proxying the IOs of cloud disk B. The disk reading program is used to read the entire cloud disk B in binary mode, and the disk reading program provides a northbound interface, that is, the disk reading program can be called by the migration system 11.

[0134] In some embodiments, the storage arbitration program can also be installed in the computing nodes of resource pool B, such as in cloud disk B. That is, the storage arbitration program can be installed at any position between cloud disk B and LUN B, as long as it can manage the read and write requests of cloud disk B to LUN B. The present application does not make specific limitations on this.

[0135] Furthermore, the migration system 11 completes the docking with resource pool A, resource pool B, the storage devices of resource pool A and resource pool B, and the disk reading program, so that the migration system 11 can complete the migration orchestration of the entire system.

[0136] The process of the migration system 11 migrating virtual machine A can include: the migration virtual machine module 111 can shut down virtual machine A by calling the interface connected to resource pool A. Then, according to the configuration information of virtual machine A and the necessary data required for operation, create virtual machine B in resource pool B (corresponding to S4), and start virtual machine B. At this time, virtual machine B can run normally, and the data generated during the operation will be written to LUN B corresponding to cloud disk B. When virtual machine B needs to read data, the storage arbitration program will first determine whether the data is written in the target LUN, and then determine whether to read the data from the target LUN or the original LUN.

[0137] Specifically, when virtual machine B needs to write data, virtual machine B can write the data to LUN B through the storage arbitration program. When virtual machine B needs to read data, if the storage arbitration program determines that the data block to be read has not been read or written by virtual machine B before, the storage arbitration program reads the data from LUN A and then sends it to virtual machine B, stores the read data in LUN B, and the storage arbitration program also records the data block. If the storage arbitration program determines that the data block to be read has been read or written by virtual machine B before, the storage arbitration program can determine that the data block is stored in LUN B, and thus can directly read the data from LUN B.

[0138] In some other embodiments, after virtual machine B runs for a preset time or when it is detected that virtual machine B pauses running, the migration system 11 can perform a full-scale read of the data in LUN A. Specifically, the cloud hard disk data copying module 112 calls the northbound interface of the disk reading program on the computing node where virtual machine B is located, triggers the disk reading program on the computing node where virtual machine B is located, and performs a full-scale read of cloud hard disk B, that is, reads all the data in LUN A to LUN B. Then, after the full-scale read of the data in cloud hard disk B is completed, all the data in cloud hard disk A is copied to cloud hard disk B. Moreover, after the full-scale read of the data in cloud hard disk B is completed, the connection between the storage devices of resource pool A and resource pool B can also be disconnected.

[0139] In some other embodiments, virtual machine A and virtual machine B can also be respectively mounted with multiple target cloud hard disks, and there can also be corresponding multiple LUNs of data in the storage device. Furthermore, the disk reading program can also adjust the number of LUNs read in parallel according to information such as the network quality between the storage devices of the current resource pool A and resource pool B, the data volume of the data to be read, the number of target cloud hard disks, the number of original LUNs, and / or the current load of the target computing node. For example, in the case of relatively good network quality, a relatively large data volume of the data to be read, a relatively large number of target cloud hard disks, a relatively large number of original LUNs, and / or a relatively small current load of the target computing node, the data to be read can be read in parallel. For example, multiple LUNs can be read in parallel. Thus, the efficiency of full-disk reading can be improved, the full-disk reading time can be shortened, and the time for pausing virtual machine B can also be reduced.

[0140] In this way, during the process of migrating a virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of the cloud hard disk data, which shortens the time required for virtual machine migration and reduces the interruption time of the services corresponding to the virtual machine. After the virtual machine is paused or after a preset time, the data is then fully read into the target resource pool, which does not affect the operation of the services on the virtual machine and has a relatively low impact on the services.

[0141] In some other embodiments, if the target resource pool is a memory - computing integrated structure, the migration system 11 can establish a connection between the hard disks in the memory - computing nodes of the target resource pool and the hard disks or storage devices of the other resource pool. The migration system 11 will install a storage arbitration program in the memory - computing nodes of the target resource pool. The process of other virtual machine migrations can refer to the above description about Figure 3 and will not be elaborated here.

[0142] Next, in combination with Figure 4 the above - mentioned Figure 3 the process of migrating virtual machine A will be introduced in detail.

[0143] S410: Complete the preparatory work.

[0144] When the virtual machine migration module 111 in the migration system 11 migrates a virtual machine, the preparations to be completed include: the virtual machine migration module 111 connects resource pool A and resource pool B, notifies the storage devices of resource pool A and resource pool B to establish a communication network connection, creates a cloud hard disk B and a LUN B without data, installs a storage arbitration program on the storage device of resource pool B, installs a disk - reading program on the computing nodes of resource pool B, etc.

[0145] Among them, as Figure 5 shown, the storage devices of resource pool A and resource pool B have established a communication connection, and the storage device of resource pool B has the right to access the storage device of resource pool A, that is, LUN A, LUN B, and then the cloud hard disk B has established a partnership. Since the cloud hard disk B is a blank volume when it is created, that is, there is no data in LUN B. Then, after virtual machine B is started, it will read and write data to the cloud hard disk B, and the cloud hard disk B will indirectly read and write data through the communication connection between resource pool A and resource pool B and the storage arbitration program.

[0146] The storage arbitration program is specifically used to maintain a record table of read - write data, that is, read - write records. The read - write records are used to record whether each data block of LUN B has been read or written. For example, the size of each data block can be 4KB. When virtual machine B writes data to the cloud hard disk B, the data can be directly written into LUN B, and at the same time, the relevant data blocks are recorded as having been written into LUN B in the read - write records.

[0147] Furthermore, through the storage arbitration program and the communication connection between resource pool A and resource pool B, it is possible to quickly migrate a virtual machine without copying the cloud hard disk, and the migrated virtual machine can run normally.

[0148] S420: Migrate the virtual machine.

[0149] The migration virtual machine module 111 in the migration system 11 can complete the migration of virtual machines across resource pools by invoking the northbound interfaces of resource pool A, resource pool B, and the storage devices of resource pool A and resource pool B. After migrating the virtual machine, the migration virtual machine module 111 will also start virtual machine B.

[0150] The process of reading and writing data after virtual machine B is started can include: when virtual machine B reads data from LUN B, if the storage arbitration program determines that the data block was not previously stored in LUN B, the storage arbitration program first reads the data from LUN A, then writes it to LUN B, and at the same time marks the data block as having been written to LUN B in the read / write record, and returns the data of the data block to virtual machine B. When virtual machine B reads data from LUN B, if the storage arbitration program determines that LUN B has previously written the data block, the storage arbitration program directly reads the data block from LUN B and returns it to virtual machine B.

[0151] Among them, the process of the migration virtual machine module 111 migrating virtual machines can also refer to Figure 6 , specifically including: first invoking the northbound interface of resource pool A to query the configuration information of virtual machine A and the necessary data required for operation, and shutting down virtual machine A in resource pool A. Then, invoking the northbound interface of resource pool B to create virtual machine B on resource pool B according to the information of virtual machine A, and virtual machine B uses cloud disk B as the hard disk, and then starts virtual machine B. The configuration information of virtual machine A includes but is not limited to: the number of CPU cores, memory capacity, disk space size, bandwidth, and other information.

[0152] It should be understood that after the migration virtual machine module 111 establishes the northbound interfaces of resource pool A and resource pool B, it can synchronously create virtual machine B and establish network communication between the storage devices of resource pool A and resource pool B, create cloud disk B and LUN B without data, install the storage arbitration program on the storage device of resource pool B, install the disk reading program on the computing node of resource pool B, etc. That is, step S410 and step S420 can be executed synchronously, and the present application does not make specific restrictions on this.

[0153] S430: Copy cloud disk data.

[0154] After virtual machine B has been running for a period of time, for the data that has not been read or written by virtual machine B, a full disk read of cloud disk B can be actively initiated to copy the data that has not been read or written from cloud disk A to cloud disk B, that is, read the data in LUN A to LUN B. As Figure 7 shown, the full disk read of cloud disk B can be executed by the copy cloud disk data module 112 in the migration system 11.

[0155] In some embodiments, the cloud hard disk data replication module 112 may run for a period of time after virtual machine B migrates before execution. For example, after virtual machine B runs for 24 hours, the cloud hard disk data replication module 112 runs. Alternatively, the cloud hard disk data replication module 112 may trigger the operation of full disk reading when virtual machine B pauses running.

[0156] In other embodiments, the cloud hard disk data replication module 112 may also limit the number of concurrent reads when performing a full disk read of cloud hard disk B, and / or limit the read speed. For example, at most 3 volumes can be read concurrently or the read speed of each volume is at most 10 megabits per second (MB / s).

[0157] In other embodiments, the cloud hard disk data replication module 112 may specifically trigger the running of the disk reading program through the northbound interface of resource pool B, and then the disk reading program controls cloud hard disk B to perform a full disk read. Among them, the disk reading program may be a program deployed on the computing node, such as Figure 8 As shown, since cloud hard disk B is mounted on virtual machine B, there must be a mount point for cloud hard disk B on the computing node of virtual machine B. The cloud hard disk data replication module 112 can query the mount point of cloud hard disk B by calling the interface of resource pool B. For example, cloud hard disk B " / dev / vda" corresponds to the mounted remote disk " / dev / sdx", and the remote disk corresponds to LUN B. Then, the disk reading program can be triggered through this mount point to perform byte-by-byte reading.

[0158] In other embodiments, virtual machine B may also be mounted with multiple cloud hard disks. The cloud hard disk data replication module 112 may also sort each cloud hard disk according to factors such as the migration time of virtual machine B, the business attribution of virtual machine B, and the number of cloud hard disks carried by virtual machine B, and then select the corresponding cloud hard disks in order for full disk reading according to the limit on the number of concurrent reads.

[0159] In other embodiments, after the disk reading program runs to completion, the cloud hard disk data replication module 112 may also disconnect the access relationship between LUN B and LUN A and the proxy relationship between LUN B and the storage arbitration program. Then, cloud hard disk B directly reads and writes data from LUN B.

[0160] In this way, during the process of migrating a virtual machine, only the virtual machine needs to be migrated first, without waiting for the migration of cloud hard disk data, which shortens the time required for virtual machine migration and reduces the interruption time of the business corresponding to the virtual machine. After the virtual machine pauses use or after a preset time, then the data is fully read into the target resource pool, which does not affect the operation of the business on the virtual machine and has a relatively low impact on the business.

[0161] The method of the embodiment of the present application is described in detail above. To facilitate better implementation of the above solution of the embodiment of the present application, correspondingly, related devices for cooperating to implement the above solution are also provided below.

[0162] Figure 9 It is a schematic structural diagram of an electronic device 100 provided by the present application. As Figure 9 shown, the electronic device 100 includes: a processor 110, a communication interface 120, and a memory 130. Among them, the processor 110, the communication interface 120, and the memory 130 can be interconnected through an internal bus 140, or can communicate through other means such as wireless transmission. In the embodiment of the present application, taking the connection through the bus 140 as an example, the bus 140 can be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The bus 140 can be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 140 can also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clear illustration, all kinds of buses are labeled as bus 140 in the figure.

[0163] The processor 110 can be composed of at least one general-purpose processor, such as a Central Processing Unit (CPU), or a combination of a CPU and a hardware chip. The above hardware chip can be an Application Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The above PLD can be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), a Generic Array Logic (GAL), or any combination thereof. The processor 110 executes various types of digital storage instructions, such as digital storage instructions in software or firmware programs stored in the memory 130, and it can enable the electronic device 100 to provide various services.

[0164] The memory 130 is used to store program codes, and is controlled and executed by the processor 110 to perform the processing steps of the virtual resource migration method in the above embodiments. The program codes may include one or more software modules, and these one or more software modules may be the aforementioned migration virtual machine module 111 and copy cloud hard disk data 112.

[0165] The memory 130 may include volatile memory, such as random access memory (RAM); the memory 130 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 130 may also include a combination of the above types. The memory 130 may store program codes, specifically execute Figure 2A steps S210 - step S230 and their optional steps in the embodiments, or Figure 2B steps S301 to S322 in the embodiments, or Figure 4 steps S410 - step S430 and their optional steps in the embodiments will not be elaborated here.

[0166] The communication interface 120 may be an internal interface (such as a high-speed serial computer expansion bus), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface), and is used to communicate with other devices or modules.

[0167] It should be noted that Figure 9 This is only a possible implementation manner of the embodiments of the present application. In actual applications, the electronic device 100 may also include more or fewer components, which are not limited here. For the content not shown or described in the embodiments of the present application, reference may be made to the relevant descriptions in the foregoing Figure 2A 、 Figure 2B or Figure 4 embodiments, which will not be elaborated here.

[0168] It should be understood that this embodiment may be implemented by a general physical server, for example, an ARM server or an X86 server, or may also be implemented by a virtual machine based on a general physical server combined with NFV technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The present application does not make specific limitations.

[0169] Figure 9 The electronic device 100 shown may also be a computer cluster composed of at least one server, which is not specifically limited in this application.

[0170] This application embodiment also provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When it runs on a processor, Figure 2A 、 Figure 2B or Figure 4 the method process shown can be realized.

[0171] This application embodiment also provides a computer program product. When the computer program product runs on a processor, Figure 2A 、 Figure 2B or Figure 4 the method process shown can be realized.

[0172] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other arbitrary combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that contains a set of one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a high-density digital video disc (DVD)), or a semiconductor medium. The semiconductor medium can be an SSD.

[0173] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A virtual resource migration method, characterized in that, The method includes: Create a first cloud hard disk and a first virtual machine in a first resource pool, where the configuration of the first virtual machine is the same as that of a second virtual machine to be migrated in a second resource pool, the first cloud hard disk corresponds to a first logical storage unit, and a first storage space corresponding to the first logical storage unit is located in a first storage device of the first resource pool; Control the first storage device to establish a communication connection with a second storage device in the second resource pool, where the second storage device includes a second storage space corresponding to a second logical storage unit, and the second storage space stores data of the second virtual machine; Start the first virtual machine, where the first virtual machine is used to migrate, during operation, data of the second logical storage unit stored in the second storage space of the second storage device to the first storage space of the first storage device corresponding to the first logical storage unit based on the communication connection.

2. The method according to claim 1, wherein The controlling the first storage device to establish a communication connection with the second storage device in the second resource pool includes: Send an instruction to the first storage device to establish a communication connection with the second storage device; or, Send an instruction to the second storage device to establish a communication connection with the first storage device.

3. The method according to claim 1, characterized in that The method further includes: Perform read and write records on data already written to the first logical storage unit; Receive a request from the first virtual machine during operation to read a first data block from the first storage device; If the read and write record records that the first data block has been written to the first logical storage unit, read the first data block from the first logical storage unit and send it to the first virtual machine; If the read and write record does not record that the first data block has been written to the first logical storage unit, read the first data block from the second logical storage unit based on the communication connection between the first storage device and the second storage device and send it to the first virtual machine.

4. The method according to claim 3, wherein The method further includes: Based on the read and write record, determine that the first data block has not been written to the first logical storage unit, and write the first data block read from the second logical storage unit to the first logical storage unit.

5. The method according to claim 1, wherein The method further includes: Based on detecting a first condition, read all data of the second logical storage unit through the communication connection; Determine data that has not been written to the first logical storage unit among all the data read from the second logical storage unit; Write the data that has not been written to the first logical storage unit to the first logical storage unit.

6. The method according to claim 5, wherein the first condition includes: the running time of the first virtual machine reaches a preset duration and / or the first virtual machine pauses running.

7. The method according to claim 5, wherein The method further includes: Based on detecting that all data of the second logical storage unit has been acquired, control the first storage device to disconnect the communication connection with the second storage device.

8. A virtual resource migration method, characterized in that, The method includes: A first virtual machine in a cloud platform detects a request to read a first data block; The first virtual machine determines that the first logical storage unit does not store the first data block. The first storage space corresponding to the first logical storage unit is located in a first storage device, and the first storage device and the first virtual machine belong to a first resource pool. The first virtual machine reads the first data block from a second logical storage unit. Among them, the second storage space corresponding to the second logical storage unit is located in a second storage device of a second resource pool. The second storage space stores data of a second virtual machine, and the configuration of the second virtual machine is the same as that of the first virtual machine. A communication connection is established between the first storage device and the second storage device.

9. An electronic device, characterized in that, It includes a processor and a memory. The memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, it executes the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, It includes instructions. When the instructions run on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.

11. A computer program product, characterized in that, The computer program product includes computer instructions. When executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 8.