WO2018133578A1 - 一种虚拟机迁移方法及装置、计算机存储介质、电子设备 - Google Patents

一种虚拟机迁移方法及装置、计算机存储介质、电子设备 Download PDF

Info

Publication number
WO2018133578A1
WO2018133578A1 PCT/CN2017/115562 CN2017115562W WO2018133578A1 WO 2018133578 A1 WO2018133578 A1 WO 2018133578A1 CN 2017115562 W CN2017115562 W CN 2017115562W WO 2018133578 A1 WO2018133578 A1 WO 2018133578A1
Authority
WO
WIPO (PCT)
Prior art keywords
disk node
file
node chain
original
chain
Prior art date
Application number
PCT/CN2017/115562
Other languages
English (en)
French (fr)
Inventor
胡岩岩
王良家
缪星星
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018133578A1 publication Critical patent/WO2018133578A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present application relates to a virtual machine migration technology, and in particular, to a virtual machine migration method and device, a computer storage medium, and an electronic device.
  • the resource pool cloud data center may only choose a more mature virtualization solution based on a series of factors such as cost maintainability and solution limitations.
  • all or part of the virtual machines in the original virtualization platform need to be migrated to the new virtualization platform.
  • the existing migration solution is to use the existing migration tools to export the images, perform mandatory image format conversion, and finally import the converted disk images to complete virtualization between different platforms. Machine migration.
  • the existing migration tool can only perform merge format conversion on each image file of the virtual machine disk, that is, each disk corresponds to one image file after the image format conversion, and each disk is finally mirrored. Migrating to the new virtualization platform, the original virtual machine disk image file cannot be maintained in the chain structure of the original virtualization platform.
  • the embodiment of the present application provides a virtual machine migration method and device, a computer storage medium, and an electronic device.
  • the embodiment of the present application provides a virtual machine migration method, where the method includes:
  • the embodiment of the present application further provides a virtual machine migration apparatus, where the apparatus includes:
  • Selecting a unit configured to select a virtual machine to be migrated in the original virtualization platform
  • An acquiring unit configured to acquire original disk node chain information of the virtual machine in the original virtualization platform
  • a configuration unit configured to configure target disk node chain information according to the original disk node chain information
  • a converting unit configured to convert, according to the target disk node chain information, each file in a virtual disk node chain of the virtual machine to migrate the virtual machine from the original virtualization platform to a target virtualization platform .
  • the embodiment of the present application further provides a computer storage medium, where the computer storage medium stores a computer program configured to execute any of the above virtual machine migration methods.
  • the embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory, where the computer stores computer program instructions, when the processor executes the computer program instructions, the processing The device is configured to perform any of the virtual machine migration methods described above.
  • the virtual machine to be migrated is selected in the original virtualization platform; the original disk node chain information of the virtual machine in the original virtualization platform is obtained; and the original disk node chain information is obtained according to the original disk Configuring target disk node chain information; converting each file in the original disk node chain of the virtual machine based on the target disk node chain information to migrate the virtual machine from the original virtualization platform to the target Virtualization platform.
  • the chained structure formed by the incremental differential snapshot technology can still be retained after the migration, and is not affected by the migration.
  • FIG. 1 is a schematic diagram showing a comparison of existing and modified differential image format conversion modes
  • FIG. 2 is a schematic diagram of an existing virtual machine migration solution
  • FIG. 3 is a schematic diagram of a virtual machine migration scheme maintaining a chain relationship
  • Figure 4 is a comparison diagram of the distribution of virtual machine images on the storage before and after XEN platform to KVM platform migration
  • FIG. 5 is a schematic flowchart of a virtual machine migration method according to an embodiment of the present application.
  • Figure 6 is the same storage and retention chain migration diagram for different platforms
  • Figure 7 is a different storage and maintenance chain migration diagram for different platforms
  • FIG. 8 is a migration diagram of a merged node with different storage flexible configurations on different platforms
  • FIG. 9 is a schematic structural diagram of a virtual machine migration apparatus according to an embodiment of the present application.
  • the storage of the mirrored image also needs to be migrated, and it is impossible to determine which nodes do merge migration according to the distribution of the mirror node on the original storage, and which nodes retain the chain structure migration, and thus cannot The mirror node can flexibly configure the corresponding target storage database.
  • the migration plan needs to reconstruct the new virtual machine disk image file management data on the new platform, and reconstruct the virtual machine on the management system to import the original virtual file uploaded to the new platform. After the merged image, the migration process is cumbersome and time consuming.
  • the technical solution of the embodiment of the present application provides a virtual machine migration method, and uses the modified differential image format conversion tool to implement virtual machine migration that maintains a mirror chain relationship between different virtualization platforms.
  • Figure 1 is a comparison of the original and modified differential image format conversion methods.
  • the mirror disk node chain is from parent to child. :grandpa.vhd, parent.vhd, son.vhd; wherein the file attributes of grandpa.vhd and parent.vhd are read-only, and the file attributes of son.vhd are readable and writable.
  • the parent node and the child nodes are merged into one mirror node, namely grandpa_parent_son.qcow2, thus changing the original chain relationship.
  • the chain relationship of the virtual machine's disk node chain on the target KVM platform remains from the parent node to the child node: grandpa.qcow2, parent The chain structure of .qcow2 and son.qcow2, in this way, all functions of the virtual machine based on incremental differential technology in the original XEN platform can be used intact on the target KVM platform.
  • Figure 2 is a diagram of a virtual machine migration architecture that does not maintain a chain relationship. As shown in Figure 2, the chain is not maintained. After the virtual machine is migrated, the disk node chains of all virtual machines are merged into one node.
  • Figure 3 is a virtual machine migration architecture diagram for maintaining a chain relationship. As shown in Figure 3, after the virtual machine is migrated after the chain relationship is maintained, the disk node chain of all virtual machines except the node format changes to qcow2, and its disk node There is no change in the chain, so the virtual machine has different distributions on the storage before and after the migration of the original solution and the new solution.
  • the virtual machine has the same hierarchical layout on the storage before and after the migration of the new solution.
  • the root node in the public read position can still be on the expensive high-speed disk, and the virtual machine itself has its own leaves. Nodes are placed on low-speed SAS disks to ensure performance while reducing costs.
  • the virtual machine's layered layout on the storage is completely changed before and after the original solution is migrated.
  • the virtual machine's disk node chain has been merged into one node, that is, the virtual machine is placed on a high-speed but expensive SSD disk, or On a cheap but relatively slow SAS disk, performance and cost cannot be compromised.
  • the virtual machine migration method of the embodiment of the present application can flexibly maintain the chain relationship of the disk node, and has a visual configuration system.
  • the following is a detailed description of the technical solution of the embodiment of the present application:
  • Select a virtual machine First, select the virtual machine that needs to be switched by the virtualization platform according to the user's needs. You can browse the basic information of the virtual machine as needed, such as the virtual machine's XML (eXtensible Markup Language) configuration. Detailed information about the disk node chain.
  • XML eXtensible Markup Language
  • Conversion configuration Then the system automatically lists the disk image format (that is, file format) of the original virtual machine, the chain relationship between the nodes, and the size and specific path of each node, and the mirror image after migration.
  • the format, the number of nodes, the chain relationship between nodes, the node merging, and the storage path are configured to determine the chain structure of the disk mirror nodes after migration and their distribution on the storage.
  • Conversion evaluation The system calculates the time required for each disk image conversion of the virtual machine according to the conversion configuration of step 2, and determines whether the storage space of the target virtualization platform satisfies the condition. Finalize the conversion assessment results.
  • FIG. 5 is a schematic flowchart of a method for migrating a virtual machine according to an embodiment of the present disclosure. As shown in FIG. 5, the method includes:
  • Step 501 Select a virtual machine to be migrated in the original virtualization platform.
  • Step 502 Acquire original disk node chain information of the virtual machine in the original virtualization platform.
  • the acquiring the original disk node chain information of the virtual machine in the original virtualization platform includes:
  • Step 503 Configure target disk node chain information according to the original disk node chain information.
  • the configuring the target disk node chain information according to the original disk node chain information includes:
  • the following information is configured: the number of files in the target disk node chain, the format of each file in the target disk node chain, the storage path of each file in the target disk node chain, and the target disk node chain. The chain relationship of each file.
  • the objects to be merged are determined, and the objects to be merged are merged into one file in the target disk node chain;
  • the file in the original disk node chain is regarded as a file in the target disk node chain
  • Step 504 Convert, according to the target disk node chain information, each file in the original disk node chain of the virtual machine to migrate the virtual machine from the original virtualization platform to the target virtualization platform.
  • the storage path of each file in the original disk node chain corresponds to a storage area in the first storage system; the storage path of each file in the target disk node chain corresponds to the storage in the second storage system.
  • the converting, according to the target disk node chain information, each file in the original disk node chain of the virtual machine to migrate the virtual machine from the original virtualization platform to the target Virtualization platform including:
  • the objects to be merged are determined, and the objects to be merged are format converted and merged into one file in the target disk node chain;
  • the file in the original disk node chain is formatted and converted into a file in the target disk node chain
  • Each file in the target disk node chain is stored according to a storage path of each file in the target disk node chain to migrate the virtual machine from the original virtualization platform to the target virtualization platform.
  • the conversion of each file in the original disk node chain of the virtual machine based on the target disk node chain information is performed by using the img-convert tool in the embodiment of the present application.
  • the img-convert tool uses a layer-by-layer conversion method for disk image files.
  • the VHD file is converted to a QCOW2 file step by step.
  • the parent-child relationship can be changed before and after the file format conversion, and the purpose of maintaining the differential mirror chain relationship is achieved.
  • the technical principle of the img-convert tool is as follows: (1) The original image file is verified and the basic information is obtained: the tool opens and parses the metadata of the last leaf node file of the virtual machine disk image file before the conversion carried in the parameter. Information, obtain the parent node information of the node, including the parent node's device number, UUID, storage location, etc.; then use the same method to traverse and access all nodes of the virtual machine disk's entire image file chain step by step, to ensure the image file chain All the node files on the file are complete and the metadata check is normal. At the same time, the virtual size of the disk and the actual size of each node are obtained. (2) The target image file of the empty data area is created: according to the converted target specified in the parameter.
  • the number of nodes in the image file chain create an image file of the empty data area of the same virtual machine size in the qcow2 format on the corresponding target storage database, and modify the backing-file field in the qcow2 metadata of each node, and maintain each Parent-child relationship between nodes; (3) Node format conversion: starting from the last leaf node of the original image, parsing the node text The metadata information of the piece, obtaining the sector file distribution information of the node file, the block size, the BATMAP information, the BAT position, the BAT number, the data check information; and starting to read the valid data in the VHD image file according to the BATMAP, and writing
  • the qcow2 format to the target corresponds to the data area of the node file; for the data that does not exist in the node file, the data is no longer traversed to its parent node for reading, but the direct return read succeeds and continues; for the deletion of the record in the node Data content, need to be synchronized in the target node Generating
  • Embodiment 1 Migration of virtual machines between identical storage systems of different platforms of the same manufacturer
  • This embodiment is a migration of the virtual machine between the same storage system on different platforms, including:
  • Conversion configuration The system automatically lists the disk node chain information of the virtual machine under the original virtualization platform.
  • the virtual machine shown in this example belongs to a chained virtual machine.
  • the original disk node chain contains 4 files in the format of In VHD, the actual size of the file is 40G, 10G, 5G, and 2G from the root node to the leaf node.
  • the list shows the location of each file node on the storage.
  • the public root node 1 is located on the s1 storage of the original storage system of the original platform.
  • s1 is a high-speed storage disk
  • the specific path of the node is /storage/s1/1.vhd
  • the intermediate nodes 2, 3 and the leaf node 4 are all located on the s2 storage of the original storage system
  • s2 is a low-speed disk
  • the path is /storage /s2/2.vhd, /storage/s2/3.vhd, /storage/s2/4.vhd; according to the listed information, the user configures the migrated disk mirror node chain
  • the structure and its distribution on the storage requires configuration of whether the nodes are merged and the migrated repository.
  • Figure 6 shows the configuration parameter example. After the migration, the number of target nodes is still 4, and the original chain structure is completely maintained.
  • the root node 1 is converted from the vhd format to the qcow2 format and becomes the A node/storage/s1/A.qcow2.
  • the root node of the virtual machine is placed on the s1 of the original storage system, and the conversion format of the intermediate node 2, 3 is qcow2 becomes /storage/s2/B.qcow2, /storage/s2/C.qcow2 is still located on the s2 of the source storage, that is, The storage remains unchanged, only the format conversion is performed.
  • the leaf node 4 After the leaf node 4 is converted, it becomes D on the s2 of the source storage, ie /storage/s2/D.qcow2, pointing to its parent node C.
  • Embodiment 2 Migration of virtual machines between different storage systems of different platforms of the same manufacturer
  • This embodiment is a migration of the virtual machine in a different chain between different storage platforms, including:
  • Select the virtual machine First, select a virtual machine that needs to be migrated by the platform under the original virtualization platform.
  • the virtual machine name is testVM. Click the browse button provided by the interface, and click to view the virtual machine XML file, disk and other basics. information.
  • the system automatically lists the disk node chain information of the virtual machine under the original platform.
  • the virtual machine shown in this example belongs to a chained virtual machine, and the original disk node chain contains four files in the format of VHD.
  • the actual size of the file is 40G, 10G, 5G, and 2G from the root node to the leaf node.
  • the list also shows the location of each file node on the storage.
  • the public root node 1 is located on the s1 storage of the original storage type of the original platform.
  • S1 is a high-speed storage disk
  • the specific path of the node is /storage/s1/1.vhd
  • the intermediate nodes 2, 3 and the leaf node 4 are all located on the s2 storage of the original storage system, usually s2 is a low-speed disk, and the path is /storage/s2 /2.vhd, /storage/s2/3.vhd, /storage/s2/4.vhd; according to the information listed, the user needs to configure the chain structure of the migrated disk mirror node and its distribution on the storage. Configure whether nodes are merged, and the migrated storage Library.
  • Figure 7 shows the configuration parameter example. After the migration, the number of target nodes is still 4, and the original chain structure is completely maintained.
  • the root node 1 is converted from the vhd format to the qcow2 format and becomes the A node/storage_dest/s1/A.qcow2.
  • the root node is placed on s1 of the target storage system, and the intermediate node 2, 3 conversion format is qcow2 becomes B and C, which are respectively stored in the target storage s2, namely /storage_dest/s2/B.qcow2, /storage_dest/s2 /C.qcow2, after the leaf node 4 is converted, it becomes D on the s2 of the target storage, ie /storage_dest/s2/D.qcow2, pointing to its parent node C.
  • Embodiment 3 Switching between virtual machines in different storage systems of different platforms and different vendors
  • Nodes make specified target repositories, specify which nodes participate in the consolidation and which nodes remain chained and flexible, including:
  • Select the virtual machine First, select a virtual machine that needs to be migrated by the platform under the original virtualization platform.
  • the virtual machine name is testVM. Click the browse button provided by the interface, and click to view the virtual machine XML file, disk and other basics. information.
  • the system automatically lists the disk node chain information of the virtual machine under the original platform.
  • the virtual machine shown in this example belongs to a chained virtual machine, and the original disk node chain contains four files in the format of VHD.
  • the actual size of the file is 40G, 10G, 5G, and 2G from the root node to the leaf node.
  • the list also shows the location of each file node on the storage.
  • the public root node 1 is located on the s1 storage of the original storage type of the original platform.
  • S1 is a high-speed storage disk
  • the specific path of the node is /storage/s1/1.vhd
  • the intermediate nodes 2, 3 and the leaf node 4 are all located on the s2 storage of the original storage system, usually s2 is a low-speed disk, and the path is /storage/s2 /2.vhd, /storage/s2/3.vhd, /storage/s2/4.vhd; according to the information listed, the user configures the migrated disk mirror node chain
  • the structure and its distribution on the storage requires configuration of whether the nodes are merged and the migrated repository.
  • Figure 8 shows the number of target nodes after migration.
  • the root node 1 is converted from the vhd format to the qcow2 format and becomes the A node/storage_dest/s1/A.qcow2. It is still placed as the virtual machine root node in the target storage system.
  • the intermediate node 2,3 conversion format is qcow2 merged into a B node placed on the target storage s2 /storage_dest/s2/B.qcow2, and points to the root node A, the leaf node 4 is converted to C after the conversion On the s2 of the target storage, /storage_dest/s2/C.qcow2 points to the intermediate merge node B.
  • FIG. 9 is a schematic structural diagram of a virtual machine migration apparatus according to an embodiment of the present disclosure. As shown in FIG. 9, the apparatus includes:
  • the selecting unit 901 is configured to select a virtual machine to be migrated in the original virtualization platform
  • the obtaining unit 902 is configured to acquire original disk node chain information of the virtual machine in the original virtualization platform.
  • the configuration unit 903 is configured to configure target disk node chain information according to the original disk node chain information
  • the converting unit 904 is configured to convert, according to the target disk node chain information, each file in the original disk node chain of the virtual machine to migrate the virtual machine from the original virtualization platform to target virtualization platform.
  • the obtaining unit 902 is configured to: acquire the following information of the virtual machine in the original virtualization platform: the number of files in the original disk node chain, and the files in the original disk node chain. The format, the storage path of each file in the original disk node chain, and the chain relationship of each file in the original disk node chain.
  • the configuration unit 903 is configured to: according to the original disk node chain Information, configured with the following information: the number of files in the target disk node chain, the format of each file in the target disk node chain, the storage path of each file in the target disk node chain, and the chain relationship of each file in the target disk node chain .
  • the configuration unit 903 is configured to: if the at least two files in the original disk node chain need to be merged, determine the objects to be merged, and merge the objects to be merged into a target disk. a file in the node chain; establishing a chain relationship of each file in the target disk node chain based on a chain relationship of each file in the original disk node chain and the merged file.
  • the configuration unit 903 is configured to: if the files in the original disk node chain are not merged, use the file in the original disk node chain as one of the target disk node chains. a file; establishing a chain relationship of each file in the target disk node chain based on a chain relationship of each file in the original disk node chain.
  • the storage path of each file in the original disk node chain corresponds to a storage area in the first storage system; the storage path of each file in the target disk node chain corresponds to the storage in the second storage system.
  • the converting unit 904 is configured to perform format conversion on each file in the original disk node chain of the virtual machine according to a format of each file in the target disk node chain; If at least two files in the original disk node chain are merged, the objects to be merged are determined, and the objects to be merged are formatted and merged into one file in the target disk node chain; if the original disk node is not needed After the files in the chain are merged, the file in the original disk node chain is formatted and converted into a file in the target disk node chain; according to the storage path of each file in the target disk node chain, Each file in the target disk node chain is stored to migrate the virtual machine from the original virtualization platform to the target virtualization platform.
  • the device further includes:
  • the calculating unit 905 is configured to calculate a conversion time of all files in the original disk node chain of the virtual machine after the configuration of the target disk node chain information is completed;
  • the converting unit 904 is configured to: if the conversion time meets a preset condition, convert each file in the original disk node chain of the virtual machine to use the virtual machine from the original virtualization platform Migrate to the target virtualization platform.
  • the embodiments of the present application can maintain a chain structure for all the disk mirror nodes as needed, or merge redundant chain nodes as needed, and have the automatic configuration of flexible configuration, and are applicable to cross-vendor platform switching and cross-storage switching; Based on the migration method, it is well developed to maximize the diversity of existing virtual machines in different platforms.
  • the virtual machine migration apparatus is a virtual machine cross-platform migration tool based on flexible format conversion on an image file and having a visual configuration.
  • the device has at least the following advantages: (1) The virtual machine image file in the VHD/VHDX format can be converted into a virtual machine image file in the QCOW2 format to implement virtual machine migration across the virtualization platform; (2) the virtual machine can be guaranteed Before the platform migration, the chain structure formed by the incremental differential snapshot technology can still be retained in the new virtualized platform after migration, and is not affected by the migration; (3) It can be flexibly selected according to user needs.
  • the image file nodes of the virtual machine disk image file chain of the chain structure are format converted and merged to flexibly meet the storage distribution requirements of the migrated image files of the new platform; (4) for hosting virtual machines When the storage of the image is changed, the corresponding target storage database can be flexibly configured according to the distribution information of the original mirror node on the original storage; (5) The visual configuration of the virtual machine is automatically migrated.
  • the embodiment of the present application further provides a virtual machine migration apparatus, including one or more processors (the processor may include, but not limited to, a Micro Controller Unit (MCU) or may be A processing device such as a Programmable Gate Array (FPGA), a memory configured to store data, and a transfer device configured to be a communication function.
  • the call monitoring device may also include more or fewer components.
  • the memory in the call monitoring device stores the respective units in the virtual machine migration device shown in FIG.
  • An embodiment of the present application further provides an electronic device including a processor and a memory, where the computer stores computer program instructions, and when the processor executes the computer program instructions, the processor is configured to execute The virtual machine migration method described in any of the embodiments of the present application.
  • embodiments of the present application can be provided as a method, system, or computer program product. Accordingly, the application can take the form of a hardware embodiment, a software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded into a computer or other programmable data processing device Having a series of operational steps performed on a computer or other programmable device to produce computer-implemented processing such that instructions executed on a computer or other programmable device are provided for implementing one or more processes in a flowchart and/or Or block diagram the steps of a function specified in a box or multiple boxes.
  • the embodiment of the present invention further provides a computer storage medium, wherein a computer program is configured, and the computer program is configured to execute the virtual machine migration method of the embodiment of the present invention.
  • the virtual machine to be migrated is selected in the original virtualization platform; the original disk node chain information of the virtual machine in the original virtualization platform is obtained; according to the original disk node chain information, Configuring target disk node chain information; converting, according to the target disk node chain information, each file in the original disk node chain of the virtual machine to migrate the virtual machine from the original virtualization platform to a target virtual Platform.
  • the chained structure formed by the incremental differential snapshot technology can still be retained after the migration, and is not affected by the migration.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种虚拟机迁移方法及装置、计算机存储介质、电子设备,所述方法包括:在原虚拟化平台中选择出待迁移的虚拟机(501);获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息(502);根据所述原磁盘节点链信息,配置目标磁盘节点链信息(503);基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台(504)。

Description

一种虚拟机迁移方法及装置、计算机存储介质、电子设备
相关申请的交叉引用
本申请基于申请号为201710049191.4、申请日为2017年01月20日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及虚拟机迁移技术,尤其涉及一种虚拟机迁移方法及装置、计算机存储介质、电子设备。
背景技术
许多企业、教育、医疗等机构建设有自己的云桌面。资源池云数据中心在初期阶段,基于成本易维护性以及方案的局限性等一系列因素,可能只选择了一种较为成熟的虚拟化方案。而在中后期阶段,在高性能以及解决方案优化等各种需求驱动下,需要全部或者选择性的将部分原虚拟化平台中的虚拟机迁移至新虚拟化平台。这涉及到不同虚拟化平台间虚拟机的迁移,目前存在的迁移方案是利用已有的迁移工具,将镜像导出,进行强制镜像格式转换,最后导入转换后的磁盘镜像,从而完成不同平台间虚拟机迁移。
由于已有迁移工具对虚拟机磁盘的每个镜像文件只能做合并格式转换,也就是说虚拟机磁盘在镜像格式转换后每个磁盘对应一个镜像文件,每个磁盘最后是以一个镜像的方式迁移至新虚拟化平台,无法保持原虚拟机磁盘镜像文件在原虚拟化平台的链式结构。
申请内容
为解决上述技术问题,本申请实施例提供了一种虚拟机迁移方法及装置、计算机存储介质、电子设备。
本申请实施例提供了一种虚拟机迁移方法,所述方法包括:
在原虚拟化平台中选择出待迁移的虚拟机;
获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;
根据所述原磁盘节点链信息,配置目标磁盘节点链信息;
基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例还提供了一种虚拟机迁移装置,所述装置包括:
选择单元,配置为在原虚拟化平台中选择出待迁移的虚拟机;
获取单元,配置为获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;
配置单元,配置为根据所述原磁盘节点链信息,配置目标磁盘节点链信息;
转换单元,配置为基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例又提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,该计算机程序配置为执行上述任意一种虚拟机迁移方法。
本申请实施例又提供了一种电子设备,其中,所述电子设备包括处理器和存储器,所述存储器中存储有计算机程序指令,当所述处理器执行所述计算机程序指令时,所述处理器配置为执行上面所述任意一种虚拟机迁移方法。
本申请实施例的技术方案中,在原虚拟化平台中选择出待迁移的虚拟机;获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;根据所述原磁盘节点链信息,配置目标磁盘节点链信息;基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。采用本申请实施例的技术方案,在虚拟机实现跨虚拟化平台迁移时,基于增量差分快照技术所形成的链式结构在迁移后的目标虚拟化平台仍可以保留,不受迁移影响。
附图说明
附图以示例而非限制的方式大体示出了本文中所讨论的各个实施例。
图1为现有和改造后的差分镜像格式转换方式对比示意图;
图2为现有虚拟机迁移方案示意图;
图3为保持链式关系的虚拟机迁移方案示意图;
图4为XEN平台到KVM平台迁移前后虚拟机镜像在存储上的分布对比图;
图5为本申请实施例的虚拟机迁移方法的流程示意图;
图6为不同平台相同存储保持链式迁移图;
图7为不同平台不同存储保持链式迁移图;
图8为不同平台不同存储灵活配置合并节点迁移图;
图9为本申请实施例的虚拟机迁移装置的结构组成示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
虚拟机迁移如果无法保持原虚拟机磁盘镜像文件在原虚拟化平台的链 式结构,这对于1:N模式虚拟机,在迁移之后会带来以下问题:(1)基于磁盘增量快照技术的诸如冰点还原,链式克隆等其他相关功能在新老虚拟化平台虚拟机迁移割接后,由于文件链的关系结构变化都无法再正常使用;(2)打乱了虚拟机镜像文件在存储上面的分布,造成虚拟机镜像文件在高速固态硬盘(SSD,Solid State Drives)和低速盘的分布不合理;(3)对于承载镜像的存储也需要迁移的情况,无法根据镜像节点在原存储上的分布决定哪些节点做合并迁移,哪些节点保留链式结构迁移,因而无法对原镜像节点灵活配置对应的目标存储库;(4)以往的迁移方案都需要在新平台重新构造新虚拟机磁盘镜像文件管理数据,在管理系统上重建虚拟机,来导入上传到新平台的原虚拟机合并后的镜像,迁移过程繁琐,耗时耗力。
本申请实施例的技术方案,提供一种虚拟机迁移方法,利用改造后的差分镜像格式转换工具,来实现不同虚拟化平台之间的保持镜像链式关系的虚拟机迁移。
图1为原有和改造后的差分镜像格式转换方式的对比图,如图1所示,对于带有增量差分镜像的链式虚拟机,其镜像磁盘节点链从父节点到子节点依次为:grandpa.vhd、parent.vhd、son.vhd;其中,grandpa.vhd和parent.vhd的文件属性为只读,son.vhd的文件属性为可读写。按照原有迁移工具对虚拟机的磁盘文件链做格式转换后,父节点和子节点合并为一个镜像节点,即grandpa_parent_son.qcow2,这样便改变了原有的链式关系。而利用改造后的img-convert转换工具,对文件做逐级转换后,在目标KVM平台上该虚拟机的磁盘节点链的链式关系保持为从父节点到子节点为:grandpa.qcow2、parent.qcow2、son.qcow2的链式结构,这样,虚拟机在原XEN平台基于增量差分技术的所有功能都可以原封不动的在目标KVM平台继续使用。
图2为不保持链式关系的虚拟机迁移架构图,如图2所示,不保持链 式关系对虚拟机进行迁移后,所有虚拟机的磁盘节点链均融合为一个节点。图3为保持链式关系的虚拟机迁移架构图,如图3所示,保持链式关系对虚拟机进行迁移后,所有虚拟机的磁盘节点链除了节点的格式变化为qcow2外,其磁盘节点链没有发生任何改变,这样,虚拟机在原有方案和新方案迁移前后其在存储上的分布有所不同。
如图4所示,虚拟机在新方案迁移前后其镜像在存储上的分层排布不变,处于公共读位置的根节点依然可以在价格昂贵的高速盘上,而虚拟机自身独自的叶子节点放在低速SAS盘上,这样既保证了性能,又可以降低成本。而虚拟机在原有方案迁移前后其镜像在存储上的分层排布完全改变,虚拟机的磁盘节点链已经融合为一个节点,也即虚拟机要么放在高速但是价格昂贵的SSD盘上,要么放在廉价但是速度相对慢的SAS盘上,无法做到性能与成本的兼顾。
本申请实施例的虚拟机迁移方法,能够灵活保持磁盘节点的链式关系,且带有可视化配置系统,以下为本申请实施例的技术方案的详细阐述:
1.选择虚拟机:首先根据用户需要自行选择需要做虚拟化平台切换的虚拟机,可根据需要浏览该虚拟机的基本信息,如虚拟机的可扩展标记语言(XML,eXtensible Markup Language)配置、磁盘节点链等相关详细信息。
2.转换配置:然后系统自动列出原虚拟机的磁盘镜像格式(也即文件格式)、节点间的链式关系、以及每个节点的大小和具体路径等信息,通过对迁移后的磁盘镜像格式、节点个数、节点间的链式关系、节点合并以及存储路径做配置,来决定迁移后的磁盘镜像节点链式结构及其在存储上的分布。
3.转换评估:系统按照步骤2的转换配置自行计算虚拟机的各个磁盘镜像转换所需的时间,以及判定目标虚拟化平台的存储空间是否满足条件, 最终确定转换评估结果。
4.执行转换:根据转换评估结果,选择执行或者取消转换。
图5为本申请实施例的虚拟机迁移方法的流程示意图,如图5所示,所述方法包括:
步骤501:在原虚拟化平台中选择出待迁移的虚拟机。
步骤502:获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息。
本申请实施例中,所述获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息,包括:
获取所述虚拟机在所述原虚拟化平台中的如下信息:原磁盘节点链中的文件数目、原磁盘节点链中的各个文件的格式、原磁盘节点链中的各个文件的存储路径、原磁盘节点链中的各个文件的链式关系。
步骤503:根据所述原磁盘节点链信息,配置目标磁盘节点链信息。
本申请实施例中,所述根据所述原磁盘节点链信息,配置目标磁盘节点链信息,包括:
根据所述原磁盘节点链信息,配置如下信息:目标磁盘节点链中的文件数目、目标磁盘节点链中的各个文件的格式、目标磁盘节点链中的各个文件的存储路径、目标磁盘节点链中的各个文件的链式关系。
上述方案中,根据所述原磁盘节点链信息,配置所述目标磁盘节点链中的各个文件的链式关系,包括:
如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象合并成目标磁盘节点链中的一个文件;
基于所述原磁盘节点链中的各个文件的链式关系以及所述合并后的文件,建立所述目标磁盘节点链中的各个文件的链式关系。
上述方案中,根据所述原磁盘节点链信息,配置所述目标磁盘节点链 中的各个文件的链式关系,包括:
如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件作为目标磁盘节点链中的一个文件;
基于所述原磁盘节点链中的各个文件的链式关系,建立所述目标磁盘节点链中的各个文件的链式关系。
步骤504:基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例中,所述原磁盘节点链中的各个文件的存储路径对应第一存储系统中的存储区域;所述目标磁盘节点链中的各个文件的存储路径对应第二存储系统中的存储区域;其中,所述第一存储系统与所述第二存储系统相同或不同。
本申请实施例中,所述基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台,包括:
根据所述目标磁盘节点链中的各个文件的格式,对所述虚拟机的原磁盘节点链中的各个文件进行格式转换;
如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象经格式转换后合并成目标磁盘节点链中的一个文件;
如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件经格式转换后作为目标磁盘节点链中的一个文件;
根据所述目标磁盘节点链中的各个文件的存储路径,对目标磁盘节点链中的各个文件进行存储,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例中,配置目标磁盘节点链信息完成后,计算所述虚拟机的原磁盘节点链中的全部文件的转换时间;如果所述转换时间满足预设条件,则对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
上述方案中,基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,是通过本申请实施例的img-convert工具进行转换。img-convert工具对磁盘镜像文件采用逐层转换方式,将VHD文件逐级转换为QCOW2文件,可以使文件格式转换前后父子关系不变,达到保持差分镜像链式关系的目的。
其中,img-convert工具的技术原理阐述如下:(1)原镜像文件校验并获取基本信息:工具打开并解析参数中携带的转换前的虚拟机磁盘镜像文件的最末端叶子节点文件的元数据信息,获取该节点的父节点信息,包括父节点的设备号、UUID、存放位置等;然后采用同样的方法逐级遍历并访问该虚拟机磁盘整个镜像文件链的所有节点,确保该镜像文件链上的所有节点文件完整存在且元数据校验正常,同时获取该磁盘的虚拟大小和各节点的实际大小等信息;(2)创建空数据区的目标镜像文件:根据参数中指定的转换后目标镜像文件链的节点个数,在对应的目标存储库上创建好相同虚拟机大小的qcow2格式的空数据区的镜像文件,并修改各节点的qcow2元数据中的backing-file字段,维护好各节点间的父子关系;(3)节点格式转换:从原镜像最末端叶子节点开始,解析该节点文件的元数据信息,获取该节点文件扇区分布信息,块大小,BATMAP信息,BAT位置,BAT数量,数据校验信息;并根据BATMAP开始读取该VHD镜像文件中的有效数据,并写入到目标的qcow2格式对应节点文件的数据区中;对于在本节点文件中不存在的数据不再遍历到其父节点进行读取,而直接返回读取成功并继续;对于本节点中记录的删除的数据内容,需要在目标节点中同步 生成基于qcow2格式扇区分布的删除标识;数据在写入到目标节点后,完善目标节点qcow2镜像的元数据信息,更新有效数据分布和大小信息;(4)其中对于任意多个需要转换并且合并的节点处理:从最下层的叶子节点开始,解析元数据信息后读取有效数据,并写入到目标的qcow2格式的对应节点文件的数据区中;对于在本节点文件中不存在的数据,往上遍历到需要合并的最顶层文件节点,如果遍历的这几个节点中各自有有效数据,则需要写入到目标文件相应的数据区中,同步实现合并操作;对于本节点中记录的删除的数据内容,则无需往上遍历,直接在目标节点中同步生成基于qcow2格式扇区分布的删除标识。
下面结合具体应用场景对本申请实施例的方案作进一步详细描述。
实施例一:虚拟机在同一厂商不同平台相同存储系统之间的迁移
参照图6,本实施例对虚拟机从XEN平台到KVM平台割接迁移的流程步骤做详尽阐述,本实施例为虚拟机在不同平台同一存储系统间的保持链式关系的迁移,包括:
1)选择虚拟机:首先在原虚拟化平台下选择一台需要做平台迁移的虚拟机,虚拟机名称为testVM,通过界面提供的浏览按钮,点击后可以查看到该虚拟机的XML文件、磁盘等基本信息。
2)转换配置:然后系统自动列出该虚拟机在原虚拟化平台下的磁盘节点链信息,如本例中展示的虚拟机属于链式虚拟机,原磁盘节点链中含有4个文件,格式为VHD,文件实际大小从根节点到叶子节点依次为40G、10G、5G、2G,列表同时展示出每个文件节点在存储上的位置,公共根节点1位于原平台的原存储系统的s1存储上,一般s1为高速存储盘,节点具体路径为/storage/s1/1.vhd,中间节点2,3以及叶子节点4均位于原存储系统的s2存储上,通常s2为低速盘,路径为/storage/s2/2.vhd、/storage/s2/3.vhd、/storage/s2/4.vhd;根据所列信息,由用户自行配置迁移后的磁盘镜像节点链 式结构及其在存储上的分布,需要配置节点是否合并,以及迁移后的存储库。图6配置参数示例迁移后目标节点数仍为4,完全保持原有链式结构,其中,根节点1由vhd格式转换为qcow2格式后变为A节点/storage/s1/A.qcow2,仍然作为虚拟机根节点放在原存储系统的s1上,中间节点2,3转换格式为qcow2分别变为/storage/s2/B.qcow2、/storage/s2/C.qcow2仍位于源存储的s2上,即存储保持不变,只做格式转换,叶子节点4转换后变为D放在源存储的s2上即/storage/s2/D.qcow2,指向其父节点C。
3)转换评估:系统自行计算按照2步配置信息所需转换耗时间。
4)执行转换:根据转换评估结果,选择执行或者取消转换。
实施例二:虚拟机在同一厂商不同平台不同存储系统之间的迁移
参照图7,本实施例对虚拟机从XEN平台到KVM平台割接迁移的流程步骤做详尽阐述,本实施例为虚拟机在不同平台不同存储间的保持链式关系的迁移,包括:
1)选择虚拟机:首先在原虚拟化平台下选择一台需要做平台迁移的虚拟机,虚拟机名称为testVM,通过界面提供的浏览按钮,点击后可以查看到该虚拟机XML文件,磁盘等基本信息。
2)转换配置:然后系统自动列出该虚拟机在原平台下的磁盘节点链信息,如本例中展示的虚拟机属于链式虚拟机,原磁盘节点链中含有4个文件,格式为VHD,文件实际大小从根节点到叶子节点依次为40G、10G、5G、2G,列表同时展示出每个文件节点在存储上的位置,公共根节点1位于原平台原存储类型的的s1存储上,一般s1为高速存储盘,节点具体路径为/storage/s1/1.vhd,中间节点2,3以及叶子节点4均位于原存储系统的s2存储上,通常s2为低速盘,路径为/storage/s2/2.vhd、/storage/s2/3.vhd、/storage/s2/4.vhd;根据所列信息,由用户自行配置迁移后的磁盘镜像节点链式结构及其在存储上的分布,需要配置节点是否合并,以及迁移后的存储 库。图7配置参数示例迁移后目标节点数仍为4完全保持原有链式结构,其中,根节点1由vhd格式转换为qcow2格式后变为A节点/storage_dest/s1/A.qcow2,仍然作为虚拟机根节点放在目标存储系统的s1上,中间节点2,3转换格式为qcow2变为B、C,分别存放在目标存储的s2上,即/storage_dest/s2/B.qcow2、/storage_dest/s2/C.qcow2,叶子节点4转换后变为D放在目标存储的s2上即/storage_dest/s2/D.qcow2,指向其父节点C。3)转换评估:系统自行计算按照2步配置信息所需转换耗时间,以及从XEN平台到KVM平台迁移时,目标存储storage_dest是否满足条件。
4)执行转换:根据转换评估结果,选择执行或者取消转换。
实施例三:虚拟机在不同厂商不同平台不同存储系统之间的切换
参照图8,本实施例对虚拟机从XEN平台到KVM平台割接迁移的流程步骤做详尽阐述,本实施例为虚拟机在不同平台不同存储间的迁移,并且根据需要合并冗余的链式节点,做出指定目标存储库,指定哪些节点参与合并哪些节点保持链式的灵活配置,包括:
1)选择虚拟机:首先在原虚拟化平台下选择一台需要做平台迁移的虚拟机,虚拟机名称为testVM,通过界面提供的浏览按钮,点击后可以查看到该虚拟机XML文件,磁盘等基本信息。
2)转换配置:然后系统自动列出该虚拟机在原平台下的磁盘节点链信息,如本例中展示的虚拟机属于链式虚拟机,原磁盘节点链中含有4个文件,格式为VHD,文件实际大小从根节点到叶子节点依次为40G、10G、5G、2G,列表同时展示出每个文件节点在存储上的位置,公共根节点1位于原平台原存储类型的的s1存储上,一般s1为高速存储盘,节点具体路径为/storage/s1/1.vhd,中间节点2,3以及叶子节点4均位于原存储系统的s2存储上,通常s2为低速盘,路径为/storage/s2/2.vhd、/storage/s2/3.vhd、/storage/s2/4.vhd;根据所列信息,由用户自行配置迁移后的磁盘镜像节点链 式结构及其在存储上的分布,需要配置节点是否合并,以及迁移后的存储库。图8配置参数示例迁移后目标节点数为3,其中,根节点1由vhd格式转换为qcow2格式后变为A节点/storage_dest/s1/A.qcow2,仍然作为虚拟机根节点放在目标存储系统的s1上,而中间节点2,3转换格式为qcow2合并成B节点放在目标存储的s2上/storage_dest/s2/B.qcow2,并指向根节点A,叶子节点4转换后变为C放在目标存储的s2上即/storage_dest/s2/C.qcow2,指向中间合并节点B。
3)转换评估:系统自行计算按照2步配置信息所需转换耗时间,以及从XEN平台到KVM平台迁移时,目标存储storage_dest是否满足条件。
4)执行转换:根据转换评估结果,选择执行或者取消转换。
图9为本申请实施例的虚拟机迁移装置的结构组成示意图,如图9所示,所述装置包括:
选择单元901,配置为在原虚拟化平台中选择出待迁移的虚拟机;
获取单元902,配置为获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;
配置单元903,配置为根据所述原磁盘节点链信息,配置目标磁盘节点链信息;
转换单元904,配置为基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例中,所述获取单元902,配置为:获取所述虚拟机在所述原虚拟化平台中的如下信息:原磁盘节点链中的文件数目、原磁盘节点链中的各个文件的格式、原磁盘节点链中的各个文件的存储路径、原磁盘节点链中的各个文件的链式关系。
本申请实施例中,所述配置单元903,配置为:根据所述原磁盘节点链 信息,配置如下信息:目标磁盘节点链中的文件数目、目标磁盘节点链中的各个文件的格式、目标磁盘节点链中的各个文件的存储路径、目标磁盘节点链中的各个文件的链式关系。
本申请实施例中,所述配置单元903,配置为:如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象合并成目标磁盘节点链中的一个文件;基于所述原磁盘节点链中的各个文件的链式关系以及所述合并后的文件,建立所述目标磁盘节点链中的各个文件的链式关系。
本申请实施例中,所述配置单元903,配置为:如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件作为目标磁盘节点链中的一个文件;基于所述原磁盘节点链中的各个文件的链式关系,建立所述目标磁盘节点链中的各个文件的链式关系。
本申请实施例中,所述原磁盘节点链中的各个文件的存储路径对应第一存储系统中的存储区域;所述目标磁盘节点链中的各个文件的存储路径对应第二存储系统中的存储区域;其中,所述第一存储系统与所述第二存储系统相同或不同。
本申请实施例中,所述转换单元904,配置为:根据所述目标磁盘节点链中的各个文件的格式,对所述虚拟机的原磁盘节点链中的各个文件进行格式转换;如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象经格式转换后合并成目标磁盘节点链中的一个文件;如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件经格式转换后作为目标磁盘节点链中的一个文件;根据所述目标磁盘节点链中的各个文件的存储路径,对目标磁盘节点链中的各个文件进行存储,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例中,所述装置还包括:
计算单元905,配置为配置目标磁盘节点链信息完成后,计算所述虚拟机的原磁盘节点链中的全部文件的转换时间;
所述转换单元904,配置为:如果所述转换时间满足预设条件,则对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
本申请实施例可以根据需要对磁盘镜像节点全部保持链式结构,或者根据需要合并冗余的链式节点,具有灵活配置的自动化特点,同时适用跨厂商平台切换,与跨存储切换;在囊括现有迁移方式的基础上很好的做拓展,从而最大限度的满足现有虚拟机在不同平台迁移的多样化需求。
本申请实施例提供的虚拟机迁移装置是一种基于对镜像文件做灵活的格式转换,并且带有可视化配置的虚拟机跨平台的迁移工具。该装置至少具有以下优势:(1)能够实现将VHD/VHDX格式的虚拟机镜像文件,转换成QCOW2格式的虚拟机镜像文件,实现跨虚拟化平台的虚拟机迁移;(2)能保证虚拟机的磁盘镜像文件在平台迁移前,基于增量差分快照技术所形成的链式结构在迁移后的新虚拟化平台仍可以保留,不受迁移影响;(3)能灵活地根据用户需要有选择性的对链式结构的虚拟机磁盘镜像文件链中的某几个镜像文件节点实现格式转换并进行合并,以灵活满足新平台对迁移后的镜像文件的存储分布要求;(4)对于承载虚拟机镜像的存储发生变化的情况下,能按照原镜像节点在原存储上的分布信息灵活配置对应的目标存储库;(5)实现虚拟机的可视化配置自动化迁移。
本领域技术人员应当理解,图9所示的虚拟机迁移装置中的各单元的实现功能可参照前述虚拟机迁移方法的相关描述而理解。
本申请实施例还提供一种虚拟机迁移装置中,包括一个或多个处理器(处理器可以包括但不限于微处理器(MCU,Micro Controller Unit)或可 编程逻辑器件(FPGA,Field Programmable Gate Array)等的处理装置)、配置为存储数据的存储器、以及配置为通信功能的传输装置。本领域普通技术人员可以理解,通话监控装置还可包括更多或者更少的组件。通话监控装置中的存储器存储有图9所示的虚拟机迁移装置中的各个单元。
本申请实施例还提供一种电子设备,该电子设备包括处理器和存储器,所述存储器中存储有计算机程序指令,当所述处理器执行所述计算机程序指令时,所述处理器配置为执行本申请实施例任意所述的虚拟机迁移方法。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
相应地,本发明实施例还提供一种计算机存储介质,其中存储有计算机程序,该计算机程序配置为执行本发明实施例的虚拟机迁移方法。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。
工业实用性
本申请实施例的技术方案,在原虚拟化平台中选择出待迁移的虚拟机;获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;根据所述原磁盘节点链信息,配置目标磁盘节点链信息;基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。采用本申请实施例的技术方案,在虚拟机实现跨虚拟化平台迁移时,基于增量差分快照技术所形成的链式结构在迁移后的目标虚拟化平台仍可以保留,不受迁移影响。

Claims (18)

  1. 一种虚拟机迁移方法,所述方法包括:
    在原虚拟化平台中选择出待迁移的虚拟机;
    获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;
    根据所述原磁盘节点链信息,配置目标磁盘节点链信息;
    基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  2. 根据权利要求1所述的方法,其中,所述获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息,包括:
    获取所述虚拟机在所述原虚拟化平台中的如下信息:原磁盘节点链中的文件数目、原磁盘节点链中的各个文件的格式、原磁盘节点链中的各个文件的存储路径、原磁盘节点链中的各个文件的链式关系。
  3. 根据权利要求2所述的方法,其中,所述根据所述原磁盘节点链信息,配置目标磁盘节点链信息,包括:
    根据所述原磁盘节点链信息,配置如下信息:目标磁盘节点链中的文件数目、目标磁盘节点链中的各个文件的格式、目标磁盘节点链中的各个文件的存储路径、目标磁盘节点链中的各个文件的链式关系。
  4. 根据权利要求3所述的方法,其中,根据所述原磁盘节点链信息,配置所述目标磁盘节点链中的各个文件的链式关系,包括:
    如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象合并成目标磁盘节点链中的一个文件;
    基于所述原磁盘节点链中的各个文件的链式关系以及所述合并后的文件,建立所述目标磁盘节点链中的各个文件的链式关系。
  5. 根据权利要求3所述的方法,其中,根据所述原磁盘节点链信息, 配置所述目标磁盘节点链中的各个文件的链式关系,包括:
    如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件作为目标磁盘节点链中的一个文件;
    基于所述原磁盘节点链中的各个文件的链式关系,建立所述目标磁盘节点链中的各个文件的链式关系。
  6. 根据权利要求3所述的方法,其中,所述原磁盘节点链中的各个文件的存储路径对应第一存储系统中的存储区域;所述目标磁盘节点链中的各个文件的存储路径对应第二存储系统中的存储区域;其中,所述第一存储系统与所述第二存储系统相同或不同。
  7. 根据权利要求3所述的方法,其中,所述基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台,包括:
    根据所述目标磁盘节点链中的各个文件的格式,对所述虚拟机的原磁盘节点链中的各个文件进行格式转换;
    如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象经格式转换后合并成目标磁盘节点链中的一个文件;
    如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件经格式转换后作为目标磁盘节点链中的一个文件;
    根据所述目标磁盘节点链中的各个文件的存储路径,对目标磁盘节点链中的各个文件进行存储,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  8. 根据权利要求1至7任一项所述的方法,其中,所述方法还包括:
    配置目标磁盘节点链信息完成后,计算所述虚拟机的原磁盘节点链中的全部文件的转换时间;
    如果所述转换时间满足预设条件,则对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  9. 一种虚拟机迁移装置,所述装置包括:
    选择单元,配置为在原虚拟化平台中选择出待迁移的虚拟机;
    获取单元,配置为获取所述虚拟机在所述原虚拟化平台中的原磁盘节点链信息;
    配置单元,配置为根据所述原磁盘节点链信息,配置目标磁盘节点链信息;
    转换单元,配置为基于所述目标磁盘节点链信息,对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  10. 根据权利要求9所述的装置,其中,所述获取单元,配置为:获取所述虚拟机在所述原虚拟化平台中的如下信息:原磁盘节点链中的文件数目、原磁盘节点链中的各个文件的格式、原磁盘节点链中的各个文件的存储路径、原磁盘节点链中的各个文件的链式关系。
  11. 根据权利要求10所述的装置,其中,所述配置单元,配置为:根据所述原磁盘节点链信息,配置如下信息:目标磁盘节点链中的文件数目、目标磁盘节点链中的各个文件的格式、目标磁盘节点链中的各个文件的存储路径、目标磁盘节点链中的各个文件的链式关系。
  12. 根据权利要求11所述的装置,其中,所述配置单元,配置为:如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象合并成目标磁盘节点链中的一个文件;基于所述原磁盘节点链中的各个文件的链式关系以及所述合并后的文件,建立所述目标磁盘节点链中的各个文件的链式关系。
  13. 根据权利要求11所述的装置,其中,所述配置单元,配置为:如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件作为目标磁盘节点链中的一个文件;基于所述原磁盘节点链中的各个文件的链式关系,建立所述目标磁盘节点链中的各个文件的链式关系。
  14. 根据权利要求11所述的装置,其中,所述原磁盘节点链中的各个文件的存储路径对应第一存储系统中的存储区域;所述目标磁盘节点链中的各个文件的存储路径对应第二存储系统中的存储区域;其中,所述第一存储系统与所述第二存储系统相同或不同。
  15. 根据权利要求11所述的装置,其中,所述转换单元,配置为:根据所述目标磁盘节点链中的各个文件的格式,对所述虚拟机的原磁盘节点链中的各个文件进行格式转换;如果需要对原磁盘节点链中的至少两个文件进行合并,则确定待合并的对象,并将所述待合并的对象经格式转换后合并成目标磁盘节点链中的一个文件;如果不需要对原磁盘节点链中的文件进行合并,则将所述原磁盘节点链中的所述文件经格式转换后作为目标磁盘节点链中的一个文件;根据所述目标磁盘节点链中的各个文件的存储路径,对目标磁盘节点链中的各个文件进行存储,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  16. 根据权利要求9至15任一项所述的装置,其中,所述装置还包括:
    计算单元,配置为配置目标磁盘节点链信息完成后,计算所述虚拟机的原磁盘节点链中的全部文件的转换时间;
    所述转换单元,配置为:如果所述转换时间满足预设条件,则对所述虚拟机的原磁盘节点链中的各个文件进行转换,以将所述虚拟机从所述原虚拟化平台迁移至目标虚拟化平台。
  17. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1至8任一项所述的虚拟机迁移方法。
  18. 一种电子设备,所述电子设备包括处理器和存储器,所述存储器中存储有计算机程序指令,当所述处理器执行所述计算机程序指令时,所述处理器配置为执行权利要求1至8任一项所述的虚拟机迁移方法。
PCT/CN2017/115562 2017-01-20 2017-12-12 一种虚拟机迁移方法及装置、计算机存储介质、电子设备 WO2018133578A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710049191.4 2017-01-20
CN201710049191.4A CN106874066B (zh) 2017-01-20 2017-01-20 一种虚拟机迁移方法及装置、电子设备

Publications (1)

Publication Number Publication Date
WO2018133578A1 true WO2018133578A1 (zh) 2018-07-26

Family

ID=59158871

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/115562 WO2018133578A1 (zh) 2017-01-20 2017-12-12 一种虚拟机迁移方法及装置、计算机存储介质、电子设备

Country Status (2)

Country Link
CN (1) CN106874066B (zh)
WO (1) WO2018133578A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485787A (zh) * 2021-06-30 2021-10-08 南京壹进制信息科技有限公司 一种虚拟机无代理热迁移至Openstack的方法
CN113515344A (zh) * 2021-05-17 2021-10-19 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置
CN115102969A (zh) * 2022-06-21 2022-09-23 北京科东电力控制系统有限责任公司 基于调度自动化主站系统埋点的同步方法及系统
CN115421786A (zh) * 2022-11-07 2022-12-02 北京尽微致广信息技术有限公司 一种设计组件迁移方法及相关设备
RU2813491C1 (ru) * 2020-06-23 2024-02-12 Зте Корпорейшн Способ и устройство для переноса виртуальной машины по облачной платформе, а также носитель данных и электронное устройство

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874066B (zh) * 2017-01-20 2021-01-26 中兴通讯股份有限公司 一种虚拟机迁移方法及装置、电子设备
CN107102890A (zh) * 2017-07-12 2017-08-29 郑州云海信息技术有限公司 一种虚拟机的迁移方法及迁移装置
CN107707635A (zh) * 2017-09-15 2018-02-16 国云科技股份有限公司 一种云平台共享存储的虚拟机镜像模板上传方法
CN110019013B (zh) * 2017-12-08 2021-11-05 中国电信股份有限公司 镜像存储方法、装置和计算机可读存储介质
CN108459883A (zh) * 2018-01-11 2018-08-28 杭州魔点科技有限公司 应用程序链式配置管理方法及装置
CN108958946A (zh) * 2018-08-02 2018-12-07 中国建设银行股份有限公司 虚拟化资源池切换方法、装置和电子设备
CN109597671B (zh) * 2018-12-11 2022-06-10 国云科技股份有限公司 一种兼容集中式和分布式运行的桌面云实现方法
CN110688200A (zh) * 2019-09-29 2020-01-14 北京浪潮数据技术有限公司 一种在线迁移虚拟机磁盘树的方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080263258A1 (en) * 2007-04-19 2008-10-23 Claus Allwell Method and System for Migrating Virtual Machines Between Hypervisors
CN102821158A (zh) * 2012-08-20 2012-12-12 广州杰赛科技股份有限公司 一种实现虚拟机迁移的方法和云系统
CN106201653A (zh) * 2016-06-30 2016-12-07 国云科技股份有限公司 一种vmware虚拟机转kvm虚拟机的方法
CN106874066A (zh) * 2017-01-20 2017-06-20 中兴通讯股份有限公司 一种虚拟机迁移方法及装置、电子设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8478801B2 (en) * 2009-05-20 2013-07-02 Vmware, Inc. Efficient reconstruction of virtual disk hierarchies across storage domains
US9928091B2 (en) * 2010-09-30 2018-03-27 Microsoft Technology Licensing, Llc Techniques for streaming virtual machines from a server to a host
CN103685256B (zh) * 2013-12-06 2017-08-04 华为技术有限公司 一种虚拟机迁移管理方法、装置及系统
CN106227587B (zh) * 2016-07-19 2019-05-10 浪潮(北京)电子信息产业有限公司 一种带快照虚拟机整机动态迁移方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080263258A1 (en) * 2007-04-19 2008-10-23 Claus Allwell Method and System for Migrating Virtual Machines Between Hypervisors
CN102821158A (zh) * 2012-08-20 2012-12-12 广州杰赛科技股份有限公司 一种实现虚拟机迁移的方法和云系统
CN106201653A (zh) * 2016-06-30 2016-12-07 国云科技股份有限公司 一种vmware虚拟机转kvm虚拟机的方法
CN106874066A (zh) * 2017-01-20 2017-06-20 中兴通讯股份有限公司 一种虚拟机迁移方法及装置、电子设备

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2813491C1 (ru) * 2020-06-23 2024-02-12 Зте Корпорейшн Способ и устройство для переноса виртуальной машины по облачной платформе, а также носитель данных и электронное устройство
CN113515344A (zh) * 2021-05-17 2021-10-19 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置
CN113515344B (zh) * 2021-05-17 2024-05-28 中国工商银行股份有限公司 跨技术平台的虚拟机自动迁移方法及装置
CN113485787A (zh) * 2021-06-30 2021-10-08 南京壹进制信息科技有限公司 一种虚拟机无代理热迁移至Openstack的方法
CN115102969A (zh) * 2022-06-21 2022-09-23 北京科东电力控制系统有限责任公司 基于调度自动化主站系统埋点的同步方法及系统
CN115421786A (zh) * 2022-11-07 2022-12-02 北京尽微致广信息技术有限公司 一种设计组件迁移方法及相关设备

Also Published As

Publication number Publication date
CN106874066B (zh) 2021-01-26
CN106874066A (zh) 2017-06-20

Similar Documents

Publication Publication Date Title
WO2018133578A1 (zh) 一种虚拟机迁移方法及装置、计算机存储介质、电子设备
US11474896B2 (en) Monitoring, diagnosing, and repairing a management database in a data storage management system
US11194775B2 (en) Efficient database search and reporting, such as for enterprise customers having large and/or numerous files
US20210157628A1 (en) Live synchronization and management of virtual machines across computing and virtualization platforms including in cloud computing environments
US20210133051A1 (en) Creating a customized bootable image for a client computing device from an earlier image such as a backup copy
US20210240308A1 (en) File manager integration with virtualization in an information management system with an enhanced storage manager, including user control and storage management of virtual machines
US10404799B2 (en) Migration to cloud storage from backup
US20180329993A1 (en) Natural language processing integrated with database and data storage management
US20170185488A1 (en) Application-level live synchronization across computing platforms including synchronizing co-resident applications to disparate standby destinations and selectively synchronizing some applications and not others
CN105022656B (zh) 虚拟机快照管理方法和装置
US20230032790A1 (en) Scalable recovery and/or migration to cloud-based custom-made virtual machines without using failed machines' credentials
CN110019138B (zh) 一种基于Zabbix的传输表空间自动迁移方法和系统
JP2022505216A (ja) 依存関係グラフ制御オブジェクトおよび計算パイプラインマイグレーション
US11860892B2 (en) Offline index builds for database tables
AU2019263048A1 (en) Client managed data backup process within an enterprise information management system
US10339011B1 (en) Method and system for implementing data lossless synthetic full backups
KR102205651B1 (ko) 원격 시뮬레이션 과정을 관리하는 클라우드 서비스 제공 방법
KR102348354B1 (ko) 원격 시뮬레이션 과정을 관리하는 클라우드 서비스 제공 방법
US12007856B2 (en) Dynamic resizing and re-distribution of destination data storage resources for bare metal restore operations in a data storage management system
US20230251940A1 (en) Dynamic resizing and re-distribution of destination data storage resources for bare metal restore operations in a data storage management system
CA3215694A1 (en) Automated authoring of software solutions from a data model
Mani et al. Virtualizing Oracle Databases on VSphere

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17893246

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17893246

Country of ref document: EP

Kind code of ref document: A1