[go: up one dir, main page]

CN109240803A - A kind of virtual machine migration method, device, server and storage medium - Google Patents

A kind of virtual machine migration method, device, server and storage medium Download PDF

Info

Publication number
CN109240803A
CN109240803A CN201811118532.XA CN201811118532A CN109240803A CN 109240803 A CN109240803 A CN 109240803A CN 201811118532 A CN201811118532 A CN 201811118532A CN 109240803 A CN109240803 A CN 109240803A
Authority
CN
China
Prior art keywords
virtual machine
virtualization environment
current virtual
migration
metadata
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201811118532.XA
Other languages
Chinese (zh)
Inventor
蒋晨晓
郭旭亮
黄世杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811118532.XA priority Critical patent/CN109240803A/en
Publication of CN109240803A publication Critical patent/CN109240803A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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

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

The invention discloses a kind of virtual machine migration method, device, server and storage mediums, which comprises the metadata of current virtual machine is obtained in the virtualized environment of source;The metadata configurations file of the current virtual machine is generated according to the metadata of the current virtual machine in purpose virtualized environment;The current virtual machine is moved in the purpose virtualized environment from the source virtualized environment according to the metadata configurations file of the current virtual machine.The batch migration of virtual machine, less cumbersome manual operation may be implemented.

Description

一种虚拟机迁移方法、装置、服务器及存储介质A virtual machine migration method, device, server and storage medium

技术领域technical field

本发明涉及虚拟机技术领域,尤指一种虚拟机迁移方法、装置、服务器及存储介质。The present invention relates to the technical field of virtual machines, in particular to a virtual machine migration method, device, server and storage medium.

背景技术Background technique

随着信息科技的发展,云计算逐步成为业界的发展热点,国内外各大厂商的云计算服务平台也开始纷纷投入到科学、教育、文化、卫生、政府、高性能计算、电子商务、物联网等多个领域进行使用。With the development of information technology, cloud computing has gradually become a hot spot in the industry. The cloud computing service platforms of major manufacturers at home and abroad have also begun to invest in science, education, culture, health, government, high-performance computing, e-commerce, and the Internet of Things. used in many fields.

在传统的数据中心常采用物理服务器直接安装操作系统并部暑网络信息平台的组网模式。随着虚拟化技术、云计算的快速发展,需要将原有大量基于物理服务器构建的信息服务平台迁移到云平台虚拟机环境是一个复杂的系统工程。目前市场上主流的虚拟机迁移工具有XenConvert、Virt-p2v、MicrosoftHyper-V、QEMU-KVM、libvirt等,但是各个管理工具支持的操作系统和虚拟化技术、迁移方式、迁移时间和迁移成功率都不尽相同,存在兼容性低、支持操作系统单一、通用性差、不支持批量迁移等问题。In the traditional data center, the physical server is often used to directly install the operating system and the networking mode of the Shu network information platform. With the rapid development of virtualization technology and cloud computing, it is a complex system engineering to migrate a large number of original information service platforms based on physical servers to the cloud platform virtual machine environment. At present, the mainstream virtual machine migration tools on the market include XenConvert, Virt-p2v, MicrosoftHyper-V, QEMU-KVM, libvirt, etc. However, the operating systems and virtualization technologies, migration methods, migration time and migration success rates supported by each management tool are all different. Different, there are problems such as low compatibility, single supported operating system, poor generality, and no support for batch migration.

其次,随着公有云和私有云在企业内的快速发展和部署,越多越多的企业数据中心呈现出公有云和私有云共存,物理机和虚拟机并用,虚拟化技术多种多样的现象,企业级的数据中心管理也愈加复杂,提出了更高的专业性要求。在这种情况下,企业级的云计算管理平台应运而生,目前市场上主流的平台有OpenStack、CloudStack、云海OS等。在云计算管理平台中,虚拟机的迁移更加灵活多样,根据迁移的源和目的地将分为:物理机到虚拟机的迁移(P2V:Physical to Virtual)、虚拟机到物理机的迁移(V2P:Virtual toPhysical)、虚拟机到虚拟机的迁移(V2V:Virtual to Virtual)。在同一虚拟化平台支持下,V2V实现方式较好,但是在不同虚拟化技术支持下的V2V以及传统的P2V、V2P依旧存在兼容性低、容错性差、迁移效率低下等问题。Secondly, with the rapid development and deployment of public clouds and private clouds in enterprises, more and more enterprise data centers show the coexistence of public clouds and private clouds, the coexistence of physical machines and virtual machines, and the variety of virtualization technologies. , the enterprise-level data center management is becoming more and more complex, and higher professional requirements are put forward. In this case, enterprise-level cloud computing management platforms emerge as the times require. Currently, the mainstream platforms in the market include OpenStack, CloudStack, and Yunhai OS. In the cloud computing management platform, the migration of virtual machines is more flexible and diverse. According to the source and destination of the migration, it will be divided into: physical machine to virtual machine migration (P2V: Physical to Virtual), virtual machine to physical machine migration (V2P). : Virtual to Physical), virtual machine to virtual machine migration (V2V: Virtual to Virtual). Under the support of the same virtualization platform, the implementation of V2V is better, but V2V and traditional P2V and V2P under the support of different virtualization technologies still have problems such as low compatibility, poor fault tolerance, and low migration efficiency.

发明内容SUMMARY OF THE INVENTION

为了解决上述技术问题,本发明提供了一种虚拟机迁移方法、装置、服务器及存储介质,可以实现虚拟机的批量迁移,较少繁琐的人工操作。In order to solve the above technical problems, the present invention provides a virtual machine migration method, device, server and storage medium, which can realize batch migration of virtual machines and reduce tedious manual operations.

为了达到本发明目的,第一方面,本发明提供了一种虚拟机迁移方法,所述方法包括:In order to achieve the purpose of the present invention, in a first aspect, the present invention provides a virtual machine migration method, the method includes:

在源虚拟化环境中获取当前虚拟机的元数据;Obtain the metadata of the current virtual machine in the source virtualization environment;

在目的虚拟化环境中根据所述当前虚拟机的元数据生成所述当前虚拟机的元数据配置文件;generating a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment;

根据所述当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中。The current virtual machine is migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

在上述实施例中,所述方法还包括:In the above embodiment, the method further includes:

在源虚拟化环境中获取所述当前虚拟机对应的第一磁盘文件;obtaining the first disk file corresponding to the current virtual machine in the source virtualization environment;

将所述当前虚拟机对应的第一磁盘文件转换为所述当前虚拟机对应的第二磁盘文件;其中,所述第一磁盘文件为所述源虚拟化环境支持的文件格式;所述第二磁盘文件为所述目的虚拟化环境支持的文件格式;Converting the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine; wherein, the first disk file is a file format supported by the source virtualization environment; the second The disk file is a file format supported by the virtualization environment for the purpose;

在所述目的虚拟化环境中将所述当前虚拟机挂载到与其对应的第二磁盘文件中。The current virtual machine is mounted to its corresponding second disk file in the destination virtualization environment.

在上述实施例中,在所述在源虚拟化环境中获取当前虚拟机的元数据之前,所述方法还包括:In the above embodiment, before obtaining the metadata of the current virtual machine in the source virtualization environment, the method further includes:

检测所述源虚拟化环境是否满足预先设置的第一迁移条件且所述目的虚拟化环境是否满足预先设置的第二迁移条件;Detecting whether the source virtualization environment satisfies a preset first migration condition and whether the destination virtualization environment satisfies a preset second migration condition;

若所述源虚拟化环境满足所述预先设置的第一迁移条件且所述目的虚拟化环境满足所述预先设置的第二迁移条件,执行在所述源虚拟化环境中获取当前虚拟机的元数据的操作。If the source virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, execute obtaining the metadata of the current virtual machine in the source virtualization environment manipulation of data.

在上述实施例中,所述根据当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中,包括:In the above embodiment, the migrating the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine includes:

在所述当前虚拟机的元数据配置文件中读取所述当前虚拟机的迁移配置数据;reading the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine;

根据所述当前虚拟机的迁移配置数据将所述当前虚拟机从所述源虚拟化环境迁移到所述目的虚拟化环境中。The current virtual machine is migrated from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine.

第二方面,本发明还提供了一种虚拟机迁移装置,所述装置包括:获取模块、生成模块和迁移模块;其中,In a second aspect, the present invention also provides a virtual machine migration device, the device includes: an acquisition module, a generation module and a migration module; wherein,

所述获取模块,用于在源虚拟化环境中获取当前虚拟机的元数据;The obtaining module is used to obtain the metadata of the current virtual machine in the source virtualization environment;

所述生成模块,用于在目的虚拟化环境中根据所述当前虚拟机的元数据生成所述当前虚拟机的元数据配置文件;The generating module is configured to generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment;

所述迁移模块,用于根据所述当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中。The migration module is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

在上述实施例中,所述装置还包括:转换模块和挂载模块;其中,In the above embodiment, the device further includes: a conversion module and a mounting module; wherein,

所述获取模块,还用于在源虚拟化环境中获取所述当前虚拟机对应的第一磁盘文件;The obtaining module is further configured to obtain the first disk file corresponding to the current virtual machine in the source virtualization environment;

所述转换模块,用于将所述当前虚拟机对应的第一磁盘文件转换为所述当前虚拟机对应的第二磁盘文件;其中,所述第一磁盘文件为所述源虚拟化环境支持的文件格式;所述第二磁盘文件为所述目的虚拟化环境支持的文件格式;The conversion module is configured to convert the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine; wherein, the first disk file is supported by the source virtualization environment file format; the second disk file is a file format supported by the destination virtualization environment;

所述挂载模块,用于在所述目的虚拟化环境中将所述当前虚拟机挂载到与其对应的第二磁盘文件中。The mounting module is configured to mount the current virtual machine to its corresponding second disk file in the destination virtualization environment.

在上述实施例中,所述获取模块,具体用于检测所述源虚拟化环境是否满足预先设置的第一迁移条件且所述目的虚拟化环境是否满足预先设置的第二迁移条件;若所述源虚拟化环境满足所述预先设置的第一迁移条件且所述目的虚拟化环境满足所述预先设置的第二迁移条件,执行在所述源虚拟化环境中获取当前虚拟机的元数据的操作。In the above embodiment, the obtaining module is specifically configured to detect whether the source virtualization environment satisfies the preset first migration condition and whether the destination virtualization environment satisfies the preset second migration condition; if the The source virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, and the operation of obtaining the metadata of the current virtual machine in the source virtualization environment is performed .

在上述实施例中,所述迁移模块包括:读取子模块和迁移子模块;其中,In the above embodiment, the migration module includes: a reading sub-module and a migration sub-module; wherein,

所述读取子模块,用于在所述当前虚拟机的元数据配置文件中读取所述当前虚拟机的迁移配置数据;The reading submodule is configured to read the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine;

所述迁移子模块,用于根据所述当前虚拟机的迁移配置数据将所述当前虚拟机从所述源虚拟化环境迁移到所述目的虚拟化环境中。The migration submodule is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine.

第三方面,本发明实施例提供了一种服务器,包括:In a third aspect, an embodiment of the present invention provides a server, including:

一个或多个处理器;one or more processors;

存储器,用于存储一个或多个程序,memory for storing one or more programs,

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明任意实施例所述的虚拟机迁移方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual machine migration method described in any embodiment of the present invention.

第四方面,本发明实施例提供了一种存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明任意实施例所述的虚拟机迁移方法。In a fourth aspect, an embodiment of the present invention provides a storage medium on which a computer program is stored, and when the program is executed by a processor, implements the virtual machine migration method described in any embodiment of the present invention.

本发明实施例提出了一种虚拟机迁移方法、装置、服务器及存储介质,先在源虚拟化环境中获取当前虚拟机的元数据;然后在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;再根据当前虚拟机的元数据配置文件将当前虚拟机从所述源虚拟化环境中迁移到目的虚拟化环境中。也就是说,在本发明的技术方案中,可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;然后根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。因此,和现有技术相比,本发明实施例提出的虚拟机迁移方法、装置、服务器及存储介质,可以实现虚拟机的批量迁移,较少繁琐的人工操作;并且,本发明实施例的技术方案实现简单方便、便于普及,适用范围更广。The embodiments of the present invention provide a virtual machine migration method, device, server and storage medium. First, the metadata of the current virtual machine is obtained in the source virtualization environment; then, the metadata of the current virtual machine is generated in the destination virtualization environment. The metadata configuration file of the current virtual machine; and then migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. That is to say, in the technical solution of the present invention, a metadata configuration file of the current virtual machine can be generated according to the metadata of the current virtual machine in the destination virtualization environment; Migrate from the source virtualization environment to the destination virtualization environment. Therefore, compared with the prior art, the virtual machine migration method, device, server, and storage medium proposed by the embodiments of the present invention can realize batch migration of virtual machines, with less tedious manual operations; and, the technology of the embodiments of the present invention The implementation of the scheme is simple and convenient, easy to popularize, and has a wider application range.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the description, claims and drawings.

附图说明Description of drawings

附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification. They are used to explain the technical solutions of the present invention together with the embodiments of the present application, and do not limit the technical solutions of the present invention.

图1为本发明实施例一提供的虚拟机迁移方法的流程示意图;FIG. 1 is a schematic flowchart of a virtual machine migration method according to Embodiment 1 of the present invention;

图2为本发明实施例二提供的虚拟机迁移方法的流程示意图;FIG. 2 is a schematic flowchart of a virtual machine migration method according to Embodiment 2 of the present invention;

图3为本发明实施例三提供的虚拟机迁移方法的流程示意图;3 is a schematic flowchart of a virtual machine migration method according to Embodiment 3 of the present invention;

图4为本发明实施例四提供的虚拟机迁移装置的第一结构示意图;FIG. 4 is a schematic diagram of a first structure of a virtual machine migration apparatus according to Embodiment 4 of the present invention;

图5为本发明实施例四提供的虚拟机迁移装置的第二结构示意图;5 is a schematic diagram of a second structure of a virtual machine migration apparatus according to Embodiment 4 of the present invention;

图6为本发明实施例五提供的服务器的结构示意图。FIG. 6 is a schematic structural diagram of a server according to Embodiment 5 of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, the embodiments in the present application and the features in the embodiments may be arbitrarily combined with each other if there is no conflict.

实施例一Example 1

图1为本发明实施例一提供的虚拟机迁移方法的流程示意图,该方法可以由虚拟机迁移装置或者服务器来执行,该装置或者服务器可以由软件和/或硬件的方式实现,该装置或者服务器可以集成在任何具有网络通信功能的智能设备中。如图1所示,虚拟机迁移方法可以包括以下步骤:FIG. 1 is a schematic flowchart of a virtual machine migration method provided in Embodiment 1 of the present invention. The method may be executed by a virtual machine migration device or server, and the device or server may be implemented by software and/or hardware. The device or server It can be integrated in any smart device with network communication function. As shown in Figure 1, the virtual machine migration method may include the following steps:

步骤101、在源虚拟化环境中获取当前虚拟机的元数据。Step 101: Obtain metadata of the current virtual machine in the source virtualization environment.

在本发明的具体实施中,服务器可以在源虚拟化环境中获取当前虚拟机的元数据。具体地,服务器可以先建立源虚拟化环境和目的虚拟化环境之间的网络连接;然后服务器可以通过该网络连接在在源虚拟化环境中获取当前虚拟机的元数据。In the specific implementation of the present invention, the server may obtain the metadata of the current virtual machine in the source virtualization environment. Specifically, the server may first establish a network connection between the source virtualization environment and the destination virtualization environment; then the server may obtain the metadata of the current virtual machine in the source virtualization environment through the network connection.

步骤102、在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。Step 102 , in the destination virtualization environment, generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine.

在本发明的具体实施例中,服务器可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。In a specific embodiment of the present invention, the server may generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment.

步骤103、根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。Step 103: Migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

在本发明的具体实施例中,服务器可以根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。具体地,服务器可以先在当前虚拟机的元数据配置文件中读取当前虚拟机的迁移配置数据;然后根据当前虚拟机的迁移配置数据将当前虚拟机从源虚拟化环境迁移到目的虚拟化环境中。In a specific embodiment of the present invention, the server may migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. Specifically, the server may first read the migration configuration data of the current virtual machine from the metadata configuration file of the current virtual machine; and then migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine middle.

本发明实施例提出的虚拟机迁移方法,先在源虚拟化环境中获取当前虚拟机的元数据;然后在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;再根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。也就是说,在本发明的技术方案中,可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;然后根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。因此,和现有技术相比,本发明实施例提出的虚拟机迁移方法,可以实现虚拟机的批量迁移,较少繁琐的人工操作;并且,本发明实施例的技术方案实现简单方便、便于普及,适用范围更广。The virtual machine migration method proposed by the embodiment of the present invention first obtains the metadata of the current virtual machine in the source virtualization environment; then generates the metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment; The current virtual machine is then migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. That is to say, in the technical solution of the present invention, a metadata configuration file of the current virtual machine can be generated according to the metadata of the current virtual machine in the destination virtualization environment; Migrate from the source virtualization environment to the destination virtualization environment. Therefore, compared with the prior art, the virtual machine migration method proposed by the embodiments of the present invention can realize batch migration of virtual machines, with less tedious manual operations; and the technical solutions of the embodiments of the present invention are simple and convenient to implement, and easy to popularize , the scope of application is wider.

实施例二Embodiment 2

图2为本发明实施例二提供的虚拟机迁移方法的流程示意图。如图2所示,虚拟机迁移方法可以包括以下步骤:FIG. 2 is a schematic flowchart of a virtual machine migration method according to Embodiment 2 of the present invention. As shown in Figure 2, the virtual machine migration method may include the following steps:

步骤201、在源虚拟化环境中获取当前虚拟机的元数据。Step 201: Obtain metadata of the current virtual machine in the source virtualization environment.

在本发明的具体实施例中,服务器可以在源虚拟化环境中获取当前虚拟机的元数据。具体地,服务器可以先建立源虚拟化环境和目的虚拟化环境之间的网络连接;然后服务器可以通过该网络连接在在源虚拟化环境中获取当前虚拟机的元数据。In a specific embodiment of the present invention, the server may obtain the metadata of the current virtual machine in the source virtualization environment. Specifically, the server may first establish a network connection between the source virtualization environment and the destination virtualization environment; then the server may obtain the metadata of the current virtual machine in the source virtualization environment through the network connection.

步骤202、在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。Step 202 , in the destination virtualization environment, generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine.

在本发明的具体实施例中,服务器可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。In a specific embodiment of the present invention, the server may generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment.

步骤203、根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境迁移到目的虚拟化环境中。Step 203: Migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

在本发明的具体实施例中,服务器可以根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。具体地,服务器可以先在当前虚拟机的元数据配置文件中读取当前虚拟机的迁移配置数据;然后根据当前虚拟机的迁移配置数据将当前虚拟机从源虚拟化环境迁移到目的虚拟化环境中。In a specific embodiment of the present invention, the server may migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. Specifically, the server may first read the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine; and then migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine middle.

步骤204、在源虚拟化环境中获取当前虚拟机对应的第一磁盘文件。Step 204: Acquire the first disk file corresponding to the current virtual machine in the source virtualization environment.

在本发明的具体实施例中,服务器可以在源虚拟化环境中获取当前虚拟机对应的第一磁盘文件。In a specific embodiment of the present invention, the server may obtain the first disk file corresponding to the current virtual machine in the source virtualization environment.

步骤205、将当前虚拟机对应的第一磁盘文件转换为当前虚拟机对应的第二磁盘文件。Step 205: Convert the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine.

在本发明的具体实施例中,服务器可以将当前虚拟机对应的第一磁盘文件转换为当前虚拟机对应的第二磁盘文件;其中,第一磁盘文件为源虚拟化环境支持的文件格式;第二磁盘文件为目的虚拟化环境支持的文件格式。In a specific embodiment of the present invention, the server can convert the first disk file corresponding to the current virtual machine into the second disk file corresponding to the current virtual machine; wherein, the first disk file is a file format supported by the source virtualization environment; Two-disk file is a file format supported by the virtualization environment for the purpose.

步骤206、在目的虚拟化环境中将当前虚拟机挂载到与其对应的第二磁盘文件中。Step 206: Mount the current virtual machine to the second disk file corresponding to the virtual machine in the destination virtualization environment.

在本发明的具体实施例中,服务器可以在目的虚拟化环境中将当前虚拟机挂载到与其对应的第二磁盘文件中。In a specific embodiment of the present invention, the server may mount the current virtual machine to the second disk file corresponding to it in the destination virtualization environment.

本发明实施例提出的虚拟机迁移方法,先在源虚拟化环境中获取当前虚拟机的元数据;然后在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;再根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。也就是说,在本发明的技术方案中,可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;然后根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。因此,和现有技术相比,本发明实施例提出的虚拟机迁移方法,可以实现虚拟机的批量迁移,较少繁琐的人工操作;并且,本发明实施例的技术方案实现简单方便、便于普及,适用范围更广。The virtual machine migration method proposed by the embodiment of the present invention first obtains the metadata of the current virtual machine in the source virtualization environment; then generates the metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment; The current virtual machine is then migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. That is to say, in the technical solution of the present invention, a metadata configuration file of the current virtual machine can be generated according to the metadata of the current virtual machine in the destination virtualization environment; Migrate from the source virtualization environment to the destination virtualization environment. Therefore, compared with the prior art, the virtual machine migration method proposed by the embodiments of the present invention can realize batch migration of virtual machines, with less tedious manual operations; and the technical solutions of the embodiments of the present invention are simple and convenient to implement, and easy to popularize , the scope of application is wider.

实施例三Embodiment 3

图3为本发明实施例三提供的虚拟机迁移方法的流程示意图。如图3所示,虚拟机迁移方法可以包括以下步骤:FIG. 3 is a schematic flowchart of a virtual machine migration method according to Embodiment 3 of the present invention. As shown in Figure 3, the virtual machine migration method may include the following steps:

步骤301、检测源虚拟化环境是否满足预先设置的第一迁移条件且目的虚拟化环境是否满足预先设置的第二迁移条件。Step 301: Detect whether the source virtualization environment satisfies the preset first migration condition and whether the destination virtualization environment satisfies the preset second migration condition.

在本发明的具体实施例中,服务器可以先检测源虚拟化环境是否满足预先设置的第一迁移条件且目的虚拟化环境是否满足预先设置的第二迁移条件;若源虚拟化环境满足预先设置的第一迁移条件且目的虚拟化环境满足预先设置的第二迁移条件,服务器可以执行在源虚拟化环境中获取当前虚拟机的元数据的操作;若若源虚拟化环境满足预先设置的第一迁移条件或者目的虚拟化环境满足预先设置的第二迁移条件,服务器可以结束虚拟机迁移流程。In a specific embodiment of the present invention, the server may first detect whether the source virtualization environment satisfies the preset first migration condition and whether the destination virtualization environment satisfies the preset second migration condition; if the source virtualization environment satisfies the preset second migration condition; If the first migration condition and the destination virtualization environment satisfy the preset second migration condition, the server may perform the operation of obtaining the metadata of the current virtual machine in the source virtualization environment; if the source virtualization environment satisfies the preset first migration condition If the condition or the destination virtualization environment satisfies the preset second migration condition, the server may end the virtual machine migration process.

步骤302、若源虚拟化环境满足预先设置的第一迁移条件且目的虚拟化环境满足预先设置的第二迁移条件,执行在源虚拟化环境中获取当前虚拟机的元数据的操作。Step 302: If the source virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, perform the operation of obtaining the metadata of the current virtual machine in the source virtualization environment.

在本发明的具体实施例中,若源虚拟化环境满足预先设置的第一迁移条件且目的虚拟化环境满足预先设置的第二迁移条件,服务器可以执行在源虚拟化环境中获取当前虚拟机的元数据的操作。In a specific embodiment of the present invention, if the source virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, the server may execute the process of obtaining the current virtual machine in the source virtualization environment. Operations on metadata.

步骤303、在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。Step 303 , in the destination virtualization environment, generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine.

在本发明的具体实施例中,服务器可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件。In a specific embodiment of the present invention, the server may generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment.

步骤304、根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境迁移到目的虚拟化环境中。Step 304: Migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

在本发明的具体实施例中,服务器可以根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。具体地,服务器可以先在当前虚拟机的元数据配置文件中读取当前虚拟机的迁移配置数据;然后根据当前虚拟机的迁移配置数据将当前虚拟机从源虚拟化环境迁移到目的虚拟化环境中。In a specific embodiment of the present invention, the server may migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. Specifically, the server may first read the migration configuration data of the current virtual machine from the metadata configuration file of the current virtual machine; and then migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine middle.

步骤305、在源虚拟化环境中获取当前虚拟机对应的第一磁盘文件。Step 305: Obtain the first disk file corresponding to the current virtual machine in the source virtualization environment.

在本发明的具体实施例中,服务器可以在源虚拟化环境中获取当前虚拟机对应的第一磁盘文件。In a specific embodiment of the present invention, the server may obtain the first disk file corresponding to the current virtual machine in the source virtualization environment.

步骤306、将当前虚拟机对应的第一磁盘文件转换为当前虚拟机对应的第二磁盘文件。Step 306: Convert the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine.

在本发明的具体实施例中,服务器可以将当前虚拟机对应的第一磁盘文件转换为当前虚拟机对应的第二磁盘文件;其中,第一磁盘文件为源虚拟化环境支持的文件格式;第二磁盘文件为目的虚拟化环境支持的文件格式。In a specific embodiment of the present invention, the server can convert the first disk file corresponding to the current virtual machine into the second disk file corresponding to the current virtual machine; wherein, the first disk file is a file format supported by the source virtualization environment; Two-disk file is a file format supported by the virtualization environment for the purpose.

步骤307、在目的虚拟化环境中将当前虚拟机挂载到与其对应的第二磁盘文件中。Step 307: Mount the current virtual machine to the second disk file corresponding to the virtual machine in the destination virtualization environment.

在本发明的具体实施例中,服务器可以在目的虚拟化环境中将当前虚拟机挂载到与其对应的第二磁盘文件中。In a specific embodiment of the present invention, the server may mount the current virtual machine to the second disk file corresponding to it in the destination virtualization environment.

举例说明,在本发明的具体实施例中,虚拟机迁移方法可以包括以下步骤:步骤1、建立源虚拟化环境和目的虚拟化环境之间的网络连接;步骤2、检测源虚拟化环境和目的虚拟化环境中的信息,是否满足V2V迁移条件,如果满足进入步骤3,否则本方法终止;步骤3、将源虚拟化环境中的元数据进行备份,并根据源虚拟化环境的元数据生成目的环境的元数据配置文件;步骤4、将源虚拟化环境中的虚拟机关机并且进行磁盘文件的复制操作,使用复制出来的文件继续下一步操作;步骤5、根据步骤3生成的元数据配置文件在目的虚拟化环境中建立一个与源虚拟机相同配置的目的虚拟机,需要注意的是此目的虚拟机不包含任何虚拟机磁盘;步骤6、根据步骤4生成的磁盘文件进行格式转换,目标格式为目的环境所支持的虚拟磁盘格式;步骤7、在步骤6进行转换的同时可以开启新的虚拟机迁移流程,新的流程从步骤2开始启动;步骤8、步骤6中的虚拟磁盘格式转换完成后,在目的环境中将其挂载给步骤5中建立的目的虚拟机;步骤9、开启目的虚拟机,如果能正常开启虚拟机,则本流程结束(源虚拟机可根据具体要求进行删除),否则进入步骤10;步骤10、在目的虚拟机的虚拟光驱上,挂载修复镜像repair.iso,自动修复后弹出修复镜像并重新开启虚拟机,如果能够正常开启虚拟机,则本流程结束(源虚拟机可根据具体要求进行删除),否则虚拟机V2V失败,重新开启源虚拟机进行使用。For example, in a specific embodiment of the present invention, the virtual machine migration method may include the following steps: step 1, establishing a network connection between the source virtualization environment and the destination virtualization environment; step 2, detecting the source virtualization environment and the destination virtualization environment Whether the information in the virtualized environment satisfies the V2V migration conditions, if so, go to step 3, otherwise the method is terminated; step 3, back up the metadata in the source virtualized environment, and generate a purpose according to the metadata of the source virtualized environment The metadata configuration file of the environment; Step 4, the virtual machine in the source virtualization environment is powered off and the disk file copy operation is performed, and the copied file is used to continue the next operation; Step 5, according to the metadata configuration file generated in step 3 Create a destination virtual machine with the same configuration as the source virtual machine in the destination virtualization environment. It should be noted that this destination virtual machine does not contain any virtual machine disks; step 6, perform format conversion according to the disk file generated in step 4, and the destination format The virtual disk format supported by the destination environment; Step 7, can open a new virtual machine migration process while converting in step 6, and the new process starts from step 2; Step 8, the virtual disk format conversion in step 6 is completed Then, mount it to the destination virtual machine established in step 5 in the destination environment; step 9, start the destination virtual machine, if the virtual machine can be started normally, this process ends (the source virtual machine can be deleted according to specific requirements) , otherwise go to step 10; step 10, mount the repair image repair.iso on the virtual CD-ROM of the destination virtual machine, pop up the repair image after automatic repair and restart the virtual machine, if the virtual machine can be started normally, this process ends ( The source virtual machine can be deleted according to specific requirements), otherwise the V2V of the virtual machine fails, and the source virtual machine is restarted for use.

本发明实施例提出的虚拟机迁移方法,先在源虚拟化环境中获取当前虚拟机的元数据;然后在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;再根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。也就是说,在本发明的技术方案中,可以在目的虚拟化环境中根据当前虚拟机的元数据生成当前虚拟机的元数据配置文件;然后根据当前虚拟机的元数据配置文件将当前虚拟机从源虚拟化环境中迁移到目的虚拟化环境中。因此,和现有技术相比,本发明实施例提出的虚拟机迁移方法,可以实现虚拟机的批量迁移,较少繁琐的人工操作;并且,本发明实施例的技术方案实现简单方便、便于普及,适用范围更广。The virtual machine migration method proposed by the embodiment of the present invention first obtains the metadata of the current virtual machine in the source virtualization environment; then generates the metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment; The current virtual machine is then migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. That is to say, in the technical solution of the present invention, a metadata configuration file of the current virtual machine can be generated according to the metadata of the current virtual machine in the destination virtualization environment; Migrate from the source virtualization environment to the destination virtualization environment. Therefore, compared with the prior art, the virtual machine migration method proposed by the embodiments of the present invention can realize batch migration of virtual machines, with less tedious manual operations; and the technical solutions of the embodiments of the present invention are simple and convenient to implement, and easy to popularize , the scope of application is wider.

实施例四Embodiment 4

图4为本发明实施例四提供的虚拟机迁移装置的第一结构示意图。如图4所示,本发明实施例所述的虚拟机迁移装置可以包括:获取模块401、生成模块402和迁移模块403;其中,FIG. 4 is a schematic diagram of a first structure of a virtual machine migration apparatus according to Embodiment 4 of the present invention. As shown in FIG. 4 , the virtual machine migration apparatus according to the embodiment of the present invention may include: an acquisition module 401, a generation module 402, and a migration module 403; wherein,

所述获取模块401,用于在源虚拟化环境中获取当前虚拟机的元数据;The obtaining module 401 is used to obtain the metadata of the current virtual machine in the source virtualization environment;

所述生成模块402,用于在目的虚拟化环境中根据所述当前虚拟机的元数据生成所述当前虚拟机的元数据配置文件;The generating module 402 is configured to generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment;

所述迁移模块403,用于根据所述当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中。The migration module 403 is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine.

图5为本发明实施例四提供的虚拟机迁移装置的第二结构示意图。如图5所示,所述装置还包括:转换模块404(图中未示出)和挂载模块405(图中未示出);其中,FIG. 5 is a schematic diagram of a second structure of a virtual machine migration apparatus according to Embodiment 4 of the present invention. As shown in FIG. 5 , the apparatus further includes: a conversion module 404 (not shown in the figure) and a mounting module 405 (not shown in the figure); wherein,

所述获取模块401,还用于在源虚拟化环境中获取所述当前虚拟机对应的第一磁盘文件;The obtaining module 401 is further configured to obtain the first disk file corresponding to the current virtual machine in the source virtualization environment;

所述转换模块404,用于将所述当前虚拟机对应的第一磁盘文件转换为所述当前虚拟机对应的第二磁盘文件;其中,所述第一磁盘文件为所述源虚拟化环境支持的文件格式;所述第二磁盘文件为所述目的虚拟化环境支持的文件格式;The conversion module 404 is configured to convert the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine; wherein, the first disk file is supported by the source virtualization environment The file format; the second disk file is the file format supported by the purpose virtualization environment;

所述挂载模块405,用于在所述目的虚拟化环境中将所述当前虚拟机挂载到与其对应的第二磁盘文件中。The mounting module 405 is configured to mount the current virtual machine to its corresponding second disk file in the destination virtualization environment.

进一步的,所述获取模块401,具体用于检测所述源虚拟化环境是否满足预先设置的第一迁移条件且所述目的虚拟化环境是否满足预先设置的第二迁移条件;若所述源虚拟化环境满足所述预先设置的第一迁移条件且所述目的虚拟化环境满足所述预先设置的第二迁移条件,执行在所述源虚拟化环境中获取当前虚拟机的元数据的操作。Further, the obtaining module 401 is specifically configured to detect whether the source virtualization environment satisfies the preset first migration condition and whether the destination virtualization environment satisfies the preset second migration condition; When the virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, the operation of obtaining the metadata of the current virtual machine in the source virtualization environment is performed.

进一步的,所述迁移模块403包括:读取子模块4031和迁移子模块4032;其中,Further, the migration module 403 includes: a reading sub-module 4031 and a migration sub-module 4032; wherein,

所述读取子模块4031,用于在所述当前虚拟机的元数据配置文件中读取所述当前虚拟机的迁移配置数据;The reading submodule 4031 is configured to read the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine;

所述迁移子模块4032,用于根据所述当前虚拟机的迁移配置数据将所述当前虚拟机从所述源虚拟化环境迁移到所述目的虚拟化环境中。The migration sub-module 4032 is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine.

上述虚拟机迁移装置可执行本发明任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本发明任意实施例提供的虚拟机迁移方法。The above-mentioned virtual machine migration apparatus can execute the method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, reference may be made to the virtual machine migration method provided by any embodiment of the present invention.

实施例五Embodiment 5

图6为本发明实施例五提供的服务器的结构示意图。图6示出了适于用来实现本发明实施方式的示例性服务器的框图。图6显示的服务器12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 6 is a schematic structural diagram of a server according to Embodiment 5 of the present invention. Figure 6 shows a block diagram of an exemplary server suitable for implementing embodiments of the present invention. The server 12 shown in FIG. 6 is only an example, and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.

如图6所示,服务器12以通用计算设备的形式表现。服务器12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。As shown in FIG. 6, server 12 takes the form of a general-purpose computing device. Components of server 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components including system memory 28 and processing unit 16.

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.

服务器12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被服务器12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by server 12, including volatile and non-volatile media, removable and non-removable media.

系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。服务器12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32 . Server 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in Figure 6, a disk drive may be provided for reading and writing to removable non-volatile magnetic disks (eg "floppy disks"), as well as removable non-volatile optical disks (eg CD-ROM, DVD-ROM) or other optical media) to read and write optical drives. In these cases, each drive may be connected to bus 18 through one or more data media interfaces. Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42, which may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data , each or some combination of these examples may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the described embodiments of the present invention.

服务器12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该服务器12交互的设备通信,和/或与使得该服务器12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,服务器12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与服务器12的其它模块通信。应当明白,尽管图中未示出,可以结合服务器12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The server 12 may also communicate with one or more external devices 14 (eg, keyboards, pointing devices, displays 24, etc.), with one or more devices that enable a user to interact with the server 12, and/or with the Server 12 can communicate with any device (eg, network card, modem, etc.) that communicates with one or more other computing devices. Such communication may take place through input/output (I/O) interface 22 . Also, the server 12 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 20 . As shown, network adapter 20 communicates with other modules of server 12 via bus 18 . It should be understood that, although not shown, other hardware and/or software modules may be used in conjunction with server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and Data backup storage system, etc.

处理单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的虚拟机迁移方法。The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, to implement the virtual machine migration method provided by the embodiment of the present invention.

实施例六Embodiment 6

本发明实施例六提供了一种计算机存储介质。Embodiment 6 of the present invention provides a computer storage medium.

本发明实施例的计算机可读存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer-readable storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable mediums. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium, including - but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).

本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Claims (10)

1.一种虚拟机迁移方法,其特征在于,所述方法包括:1. A virtual machine migration method, wherein the method comprises: 在源虚拟化环境中获取当前虚拟机的元数据;Obtain the metadata of the current virtual machine in the source virtualization environment; 在目的虚拟化环境中根据所述当前虚拟机的元数据生成所述当前虚拟机的元数据配置文件;generating a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment; 根据所述当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中。The current virtual machine is migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 在源虚拟化环境中获取所述当前虚拟机对应的第一磁盘文件;obtaining the first disk file corresponding to the current virtual machine in the source virtualization environment; 将所述当前虚拟机对应的第一磁盘文件转换为所述当前虚拟机对应的第二磁盘文件;其中,所述第一磁盘文件为所述源虚拟化环境支持的文件格式;所述第二磁盘文件为所述目的虚拟化环境支持的文件格式;Converting the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine; wherein, the first disk file is a file format supported by the source virtualization environment; the second The disk file is a file format supported by the virtualized environment for the purpose; 在所述目的虚拟化环境中将所述当前虚拟机挂载到与其对应的第二磁盘文件中。The current virtual machine is mounted to its corresponding second disk file in the destination virtualization environment. 3.根据权利要求1所述的方法,其特征在于,在所述在源虚拟化环境中获取当前虚拟机的元数据之前,所述方法还包括:3 . The method according to claim 1 , wherein, before obtaining the metadata of the current virtual machine in the source virtualization environment, the method further comprises: 3 . 检测所述源虚拟化环境是否满足预先设置的第一迁移条件且所述目的虚拟化环境是否满足预先设置的第二迁移条件;Detecting whether the source virtualization environment satisfies a preset first migration condition and whether the destination virtualization environment satisfies a preset second migration condition; 若所述源虚拟化环境满足所述预先设置的第一迁移条件且所述目的虚拟化环境满足所述预先设置的第二迁移条件,执行在所述源虚拟化环境中获取当前虚拟机的元数据的操作。If the source virtualization environment satisfies the preset first migration condition and the destination virtualization environment satisfies the preset second migration condition, execute obtaining the metadata of the current virtual machine in the source virtualization environment manipulation of data. 4.根据权利要求1所述的方法,其特征在于,所述根据当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中,包括:4. The method according to claim 1, wherein the current virtual machine is migrated from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine, include: 在所述当前虚拟机的元数据配置文件中读取所述当前虚拟机的迁移配置数据;reading the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine; 根据所述当前虚拟机的迁移配置数据将所述当前虚拟机从所述源虚拟化环境迁移到所述目的虚拟化环境中。The current virtual machine is migrated from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine. 5.一种虚拟机迁移装置,其特征在于,所述装置包括:获取模块、生成模块和迁移模块;其中,5. A virtual machine migration device, characterized in that the device comprises: an acquisition module, a generation module and a migration module; wherein, 所述获取模块,用于在源虚拟化环境中获取当前虚拟机的元数据;The obtaining module is used to obtain the metadata of the current virtual machine in the source virtualization environment; 所述生成模块,用于在目的虚拟化环境中根据所述当前虚拟机的元数据生成所述当前虚拟机的元数据配置文件;The generating module is configured to generate a metadata configuration file of the current virtual machine according to the metadata of the current virtual machine in the destination virtualization environment; 所述迁移模块,用于根据所述当前虚拟机的元数据配置文件将所述当前虚拟机从所述源虚拟化环境中迁移到所述目的虚拟化环境中。The migration module is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the metadata configuration file of the current virtual machine. 6.根据权利要求5所述的装置,其特征在于,所述装置还包括:转换模块和挂载模块;其中,6. The device according to claim 5, characterized in that, the device further comprises: a conversion module and a mounting module; wherein, 所述获取模块,还用于在源虚拟化环境中获取所述当前虚拟机对应的第一磁盘文件;The obtaining module is further configured to obtain the first disk file corresponding to the current virtual machine in the source virtualization environment; 所述转换模块,用于将所述当前虚拟机对应的第一磁盘文件转换为所述当前虚拟机对应的第二磁盘文件;其中,所述第一磁盘文件为所述源虚拟化环境支持的文件格式;所述第二磁盘文件为所述目的虚拟化环境支持的文件格式;The conversion module is configured to convert the first disk file corresponding to the current virtual machine into a second disk file corresponding to the current virtual machine; wherein, the first disk file is supported by the source virtualization environment file format; the second disk file is a file format supported by the destination virtualization environment; 所述挂载模块,用于在所述目的虚拟化环境中将所述当前虚拟机挂载到与其对应的第二磁盘文件中。The mounting module is configured to mount the current virtual machine to its corresponding second disk file in the destination virtualization environment. 7.根据权利要求5所述的装置,其特征在于:7. The device according to claim 5, wherein: 所述获取模块,具体用于检测所述源虚拟化环境是否满足预先设置的第一迁移条件且所述目的虚拟化环境是否满足预先设置的第二迁移条件;若所述源虚拟化环境满足所述预先设置的第一迁移条件且所述目的虚拟化环境满足所述预先设置的第二迁移条件,执行在所述源虚拟化环境中获取当前虚拟机的元数据的操作。The obtaining module is specifically configured to detect whether the source virtualization environment satisfies the preset first migration condition and whether the destination virtualization environment satisfies the preset second migration condition; if the source virtualization environment satisfies the preset first migration condition; When the preset first migration condition is satisfied and the destination virtualization environment satisfies the preset second migration condition, the operation of obtaining the metadata of the current virtual machine in the source virtualization environment is performed. 8.根据权利要求5所述的装置,其特征在于,所述迁移模块包括:读取子模块和迁移子模块;其中,8. The device according to claim 5, wherein the migration module comprises: a reading submodule and a migration submodule; wherein, 所述读取子模块,用于在所述当前虚拟机的元数据配置文件中读取所述当前虚拟机的迁移配置数据;The reading submodule is configured to read the migration configuration data of the current virtual machine in the metadata configuration file of the current virtual machine; 所述迁移子模块,用于根据所述当前虚拟机的迁移配置数据将所述当前虚拟机从所述源虚拟化环境迁移到所述目的虚拟化环境中。The migration submodule is configured to migrate the current virtual machine from the source virtualization environment to the destination virtualization environment according to the migration configuration data of the current virtual machine. 9.一种服务器,其特征在于,包括:9. A server, characterized in that, comprising: 一个或多个处理器;one or more processors; 存储器,用于存储一个或多个程序,memory for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1至4中任一项所述的虚拟机迁移方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual machine migration method according to any one of claims 1 to 4. 10.一种存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1至4中任一项所述的虚拟机迁移方法。10. A storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the virtual machine migration method according to any one of claims 1 to 4 is implemented.
CN201811118532.XA 2018-09-25 2018-09-25 A kind of virtual machine migration method, device, server and storage medium Pending CN109240803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811118532.XA CN109240803A (en) 2018-09-25 2018-09-25 A kind of virtual machine migration method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811118532.XA CN109240803A (en) 2018-09-25 2018-09-25 A kind of virtual machine migration method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN109240803A true CN109240803A (en) 2019-01-18

Family

ID=65056817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811118532.XA Pending CN109240803A (en) 2018-09-25 2018-09-25 A kind of virtual machine migration method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN109240803A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112135303A (en) * 2020-09-11 2020-12-25 苏州浪潮智能科技有限公司 Data center rapid networking method, system, terminal and storage medium
CN113918284A (en) * 2021-10-13 2022-01-11 江苏安超云软件有限公司 Method and device for cloud host batch migration, electronic equipment and storage medium
CN117290059A (en) * 2023-11-27 2023-12-26 四川中电启明星信息技术有限公司 Cross-chip architecture linux virtual machine transfer method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464812A (en) * 2009-01-06 2009-06-24 北京航空航天大学 Virtual machine migration method
CN102597958A (en) * 2009-11-16 2012-07-18 国际商业机器公司 Symmetric live migration of virtual machines
WO2013097903A1 (en) * 2011-12-29 2013-07-04 Telefonaktiebolaget L M Ericsson (Publ) Virtual machine migration using 3gpp mcim
CN103544045A (en) * 2013-10-16 2014-01-29 南京大学镇江高新技术研究院 HDFS-based virtual machine image storage system and construction method thereof
CN106648838A (en) * 2016-12-31 2017-05-10 云宏信息科技股份有限公司 Configuration method and device for resource pool management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464812A (en) * 2009-01-06 2009-06-24 北京航空航天大学 Virtual machine migration method
CN102597958A (en) * 2009-11-16 2012-07-18 国际商业机器公司 Symmetric live migration of virtual machines
WO2013097903A1 (en) * 2011-12-29 2013-07-04 Telefonaktiebolaget L M Ericsson (Publ) Virtual machine migration using 3gpp mcim
CN103544045A (en) * 2013-10-16 2014-01-29 南京大学镇江高新技术研究院 HDFS-based virtual machine image storage system and construction method thereof
CN106648838A (en) * 2016-12-31 2017-05-10 云宏信息科技股份有限公司 Configuration method and device for resource pool management

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112135303A (en) * 2020-09-11 2020-12-25 苏州浪潮智能科技有限公司 Data center rapid networking method, system, terminal and storage medium
CN112135303B (en) * 2020-09-11 2022-12-09 苏州浪潮智能科技有限公司 Data center rapid networking method, system, terminal and storage medium
CN113918284A (en) * 2021-10-13 2022-01-11 江苏安超云软件有限公司 Method and device for cloud host batch migration, electronic equipment and storage medium
CN113918284B (en) * 2021-10-13 2022-08-02 江苏安超云软件有限公司 Method and device for cloud host batch migration, electronic equipment and storage medium
CN117290059A (en) * 2023-11-27 2023-12-26 四川中电启明星信息技术有限公司 Cross-chip architecture linux virtual machine transfer method and system
CN117290059B (en) * 2023-11-27 2024-03-15 四川中电启明星信息技术有限公司 Cross-chip architecture linux virtual machine transfer method and system

Similar Documents

Publication Publication Date Title
TWI637613B (en) Systems and methods for enabling access to extensible storage devices over a network as local storage via nvme controller
US9430268B2 (en) Systems and methods for supporting migration of virtual machines accessing remote storage devices over network via NVMe controllers
CN106797388B (en) Cross-system multimedia data encoding and decoding method, apparatus, electronic device and computer program product
CN102567074B (en) USB (universal serial bus) device redirecting method facing virtual machines
CN106648826B (en) For the method and apparatus of thermophoresis virtual machine
CN102917095B (en) A kind of method of the terminal test based on android system and device
CN106775924B (en) Virtual machine starts method and apparatus
CN105359088A (en) Method for Optimizing Provisioning Time Using Dynamically Generated Virtual Disk Contents
CN109388475A (en) A kind of dispositions method, device, electronic equipment and the storage medium of physics bare machine
US20140109095A1 (en) Seamless extension of local computing power
US11409615B2 (en) Cloning storage volumes from backup
CN110471740A (en) Methods, apparatus, devices, and computer storage media for performing machine learning tasks
CN113242175A (en) Storage gateway based on SPDK and implementation method thereof
WO2018192478A1 (en) Cloud management platform, virtual machine management method, system thereof
CN106406979A (en) How to Migrate a XenServer Platform Virtual Machine to a KVM Virtualization Platform
CN109189555A (en) A kind of implementation method of Port Mirroring, device, server and storage medium
CN109104491A (en) A kind of micro services call method, device, server and storage medium
CN110019208A (en) A kind of data migration method, device and medium
US11573818B2 (en) Containerized computing environments
CN109240803A (en) A kind of virtual machine migration method, device, server and storage medium
WO2017045272A1 (en) Virtual machine migration method and device
CN102855093B (en) System and method for realizing automatic thin provisioning dynamic capacity expansion of storage system
CN111796903A (en) Virtual machine migration method, server and computer storage medium
CN109657167B (en) Data acquisition method, device, server and storage medium
US11416318B1 (en) Application programming interface for integration flow design

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190118