WO2020063879A1 - 一种虚拟机迁移方法及装置 - Google Patents
一种虚拟机迁移方法及装置 Download PDFInfo
- Publication number
- WO2020063879A1 WO2020063879A1 PCT/CN2019/108586 CN2019108586W WO2020063879A1 WO 2020063879 A1 WO2020063879 A1 WO 2020063879A1 CN 2019108586 W CN2019108586 W CN 2019108586W WO 2020063879 A1 WO2020063879 A1 WO 2020063879A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- virtualization platform
- virtual machine
- image file
- migrated
- file
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
- G06F9/4856—Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Definitions
- the present application relates to the field of virtualization technology, and in particular, to a method and a device for migrating a virtual machine.
- KVM kernel-based virtual machines
- XEN open source virtual machine monitors
- cloud computing has developed rapidly, and major manufacturers have invested funds and technical forces to develop their own cloud products.
- V2V virtual machine migration a new requirement has arisen, namely virtual-to-virtual (V2V) virtual machine migration.
- V2V virtual machine migration One of the main methods used for V2V virtual machine migration is static migration.
- Static migration can also be called regular migration or offline migration (offline migration), which refers to the migration from one physical machine to another when the virtual machine is powered off or suspended.
- offline migration offline migration
- the present application provides a virtual machine migration method and device, which are used to implement automatic migration of a virtual machine and improve the efficiency of virtual machine migration.
- an embodiment of the present application provides a method for migrating a virtual machine, including:
- the image file of the virtual machine to be migrated from the object storage OBS; start a preset command to process the downloaded image file to obtain a private image corresponding to the image file; the preset command is based on the source virtualization platform and The difference between the target virtualization platforms is configured; the source virtualization platform is the virtualization platform where the virtual machine to be migrated was before migration, and the target virtualization platform is the virtual machine to which the virtual machine to be migrated is to be migrated A virtualization platform; using the private image to issue a virtual machine running on the destination virtualization platform.
- the image file of the virtual machine to be migrated is processed by executing a preset command, so that the automatic migration of the image file of the virtual machine to be migrated can be realized without manual operations by the user, which can effectively improve the migration efficiency and meet user needs.
- the startup preset command processing the image file of the virtual machine to be migrated includes: modifying a disk partition name of the image file to a universal unique identifier UUID of the disk partition, and / Or, convert the format of the image file into a preset format.
- the operating system of the virtual machine to be migrated is a Linux operating system;
- the startup preset command processing the image file further includes: checking the initrd file of the image file When the driver files required by the target virtualization platform are not included, the driver files required by the target virtualization platform are loaded.
- the operating system of the virtual machine to be migrated is a Windows operating system;
- the startup preset command to process the image file further includes: a driver required by the target virtualization platform The file is imported offline into the registry of the image file.
- the method before starting the preset command to process the image file, the method further includes: determining that the information of the image file of the virtual machine to be migrated passes the validity check; the information of the image file includes At least one of the following: the size of the image file, and the system disk size of the image file.
- the source virtualization platform includes any one of a VMware virtualization platform, a Virtual Server virtualization platform, an open source virtual machine monitor XEN virtualization platform, and a kernel-based virtual machine KVM virtualization platform.
- the purpose virtualization platform includes a XEN virtualization platform and / or a KVM virtualization platform.
- an embodiment of the present application provides a virtual machine migration device, and the device has a function of implementing the methods described in the various possible designs of the first aspect.
- This function can be realized by hardware, and can also be implemented by hardware executing corresponding software.
- the hardware or software includes one or more modules corresponding to the above functions, such as a download module, a processing module, and a distribution module; wherein the download module is used to download the image file of the virtual machine to be migrated from the object storage OBS; the processing module Configured to start a preset command to process the downloaded image file to obtain a private image corresponding to the image file of the virtual machine to be migrated; the preset command is based on between the source virtualization platform and the destination virtualization platform The difference configuration; the source virtualization platform is the virtualization platform where the virtual machine to be migrated was before migration, the destination virtualization platform is the virtualization platform to which the virtual machine to be migrated is migrated; a distribution module, Configured to use the private image to issue a virtual machine on the destination virtualization platform.
- a download module is used to download the image file of the virtual machine to be migrated from the object storage OBS
- the processing module Configured to start a preset command to process the downloaded image file to obtain a private image corresponding to the image file of
- the processing module is specifically configured to modify a disk partition name of the image file to a universally unique identifier UUID of the disk partition, and / or convert a format of the image file to a pre- Format.
- the processing module may be specifically configured to: the initrd file that detects the image file does not include the destination virtualization When the driver file required by the platform is loaded, the driver file required by the target virtualization platform is loaded.
- the processing module may be specifically configured to: import the driver file required by the destination virtualization platform offline into the image file In the registry.
- the processing module before the processing module starts a preset command to process the image file of the virtual machine to be migrated, it is further configured to: determine that the information of the image file of the virtual machine to be migrated passes a validity check
- the information of the image file includes at least one of the following: the size of the image file, and the system disk size of the image file.
- the source virtualization platform includes any one of a VMware virtualization platform, a Virtual Server virtualization platform, an open source virtual machine monitor XEN virtualization platform, and a kernel-based virtual machine KVM virtualization platform.
- the purpose virtualization platform includes a XEN virtualization platform and / or a KVM virtualization platform.
- an embodiment of the present application provides a virtual machine migration device, including: a processor and a memory; the memory stores computer execution instructions, and when the device runs, the processor executes the computer execution instructions stored in the memory to The apparatus is caused to perform the method according to the various possible designs of the first aspect described above.
- an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores instructions, and when the computer-readable storage medium runs on the computer, causes the computer to execute the various possible Design the method described.
- the present application also provides a computer program product including instructions, which when executed on a computer, causes the computer to execute the method described in various possible designs of any one of the first to fifth aspects. .
- FIG. 1 is a schematic diagram of a system architecture applicable to an embodiment of the present application
- FIG. 2a and FIG. 2b are schematic flowcharts respectively corresponding to a virtual machine migration method provided by an embodiment of the present application
- FIG. 3 is a schematic flowchart of a virtual machine migration method according to an embodiment of the present application.
- FIG. 4 is a schematic diagram of an interface of a management console
- FIG. 5 is a schematic structural diagram of a virtual machine migration device according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of another virtual machine migration apparatus according to an embodiment of the present application.
- the usual implementation method is semi-automatic migration.
- Linux virtual machines that is, the operating system of the virtual machine is Linux operating system
- the customer uninstalls the platform tools on the original virtualization platform and manually Handle system startup file settings, file system mount settings, and manual loading of virtualized drivers that may be required, then package the image, and try to migrate to the destination virtualization platform;
- Windows virtual machines that is, the operating system of the virtual machine is Windows operating system
- the customer uninstalled the platform tools from the original virtualization platform and installed the platform tools of the target virtualization platform, manually loaded the registry, and manually handled the file system mount, network driver, etc., and then encapsulated the image to try to migrate to the target virtualization platform.
- an embodiment of the present application provides a virtual machine migration method, which is used to improve the virtual machine migration efficiency.
- FIG. 1 is a schematic diagram of a system architecture applicable to an embodiment of the present application.
- the system architecture includes: a management console (console), an image management service (IMS), and an object storage (object storage, OBS) and conversion service nodes.
- IMS image management service
- OBS object storage
- the management console is used to provide an interface that can be operated by the user. For example, the user can select an image file on the interface provided by the management console to register a private image, enter the basic information of the image file, and determine whether to automate V2V. deal with.
- the image file (or image) is a cloud server or bare metal server template that contains the software and the necessary configuration, contains the operating system or business data, and can also contain application software (for example, database software) and proprietary software. Images are divided into public images, private images, and shared images. Public images are the default images provided by the system. Private images are images created by users. Shared images are private images shared by other users. This embodiment of the present application will focus on research into converting an external image file into a private image.
- the mirroring service is used to provide simple and convenient mirroring self-management functions. Users can apply for cloud servers and bare metal servers flexibly and conveniently using public images, private images, or shared images. At the same time, users can also create private images from external image files.
- Object storage can be used to store external image files uploaded by users and private images generated after system processing is complete.
- the conversion service node is used to convert an external image file into a private image.
- the functions performed by the conversion service node may include converting the format of the external image file.
- FIG. 1 only illustrates the main function nodes involved in the process of converting an external image file into a private image file.
- FIG. 1 may also include other function nodes, such as a virtual machine Function nodes, not specifically limited.
- FIG. 2a and FIG. 2b are schematic flowcharts respectively corresponding to the virtual machine migration method provided by the embodiment of the present application. As shown in Figure 2a, it includes:
- Step 201 Download an image file of the virtual machine to be migrated from the object store. This step may be performed by a conversion service node illustrated in FIG. 1.
- the image file of the virtual machine to be migrated may be downloaded from the object store.
- the management console can export the image file of the virtual machine to be migrated from the source virtual machine platform according to the user's operation instruction, and upload the image file of the virtual machine to be migrated to the object store.
- the source virtualization platform is the virtualization platform where the virtual machine to be migrated was located before the migration.
- the source virtualization platform may include a VMware virtualization platform, a Virtual Server virtualization platform, a XEN virtualization platform, and a KVM virtualization platform. It is understandable that the source virtualization platform may be any other virtualization platform (as shown in FIG. 2b).
- the format of the image file in different virtualization platforms may be different.
- the format of the image file of the virtual machine to be migrated that can be supported in the embodiment of the present application includes vhd, vmdk, qcow2, raw, vhdx, qcow, vdi, qed , Zvhd, zvhd2, etc.
- the vhd format refers to the Microsoft virtual disk format (microSoft virtual hard disk format)
- the qcow2 format refers to one of the disk image formats supported by qemu, usually applied on the KVM virtualization platform
- the vmdk format refers to the virtual created by the VMware virtualization platform Hard disk format, other formats will not be introduced one by one.
- Step 202 Start a preset command to process the downloaded image file, and obtain a private image corresponding to the image file of the virtual machine to be migrated; the preset command is based on between the source virtualization platform and the destination virtualization platform.
- the target virtualization platform is the virtualization platform to which the virtual machine to be migrated is migrated.
- the target virtualization platform may include a XEN virtualization platform and / or a KVM virtualization platform. This step may be performed by a conversion service node illustrated in FIG. 1.
- initiating a preset command to process the downloaded image file may include: modifying a disk partition name of the image file to a universal uniqueness of the disk partition.
- Identification code universalally unique identifier, UUID.
- starting a preset command to process the downloaded image file may further include: checking the Whether the initrd file of the image file includes a driver file required by the target virtualization platform, and if not, loads a driver file required by the target virtualization platform. For example, you can check whether the initrd file of the image file includes the XEN driver and virtio driver, and if not, load the XEN driver and virtio driver.
- starting a preset command to process the downloaded image file may further include:
- the driver file required by the target virtualization platform is imported offline into the registry of the image file.
- the driver can be validated without user login, so as to achieve the best performance.
- the service startup technology or other possible technologies may also be used in combination, which is not specifically limited.
- initiating a preset command to process the downloaded image file may include: converting the format of the image file to a preset format by using a preset tool. Specifically, you can start the qemu-img tool to convert the format of the image file. For example, you can convert the format of the image file to zvhd.
- the process in Example 1 may be performed first, then the process in Example 2 and the process in Example 4 may be performed, thereby realizing the mirroring of the Linux virtual machine.
- the file is converted to a private image; in another possible embodiment, the process in Example 1 can be performed first, then the process in Example 3, and the process in Example 4 can be performed to implement the image file of the Windows virtual machine. Convert to private image.
- the above examples 1 to 4 are only some exemplary processing methods based on possible differences between the source virtualization platform and the destination virtualization platform. In other possible embodiments, the source virtual platform may also be based on the source virtual platform. There may be other differences between the virtualization platform and the target virtualization platform to configure a preset command, so as to more effectively implement the automatic migration of the image file of the virtual machine.
- the format of the image file of the virtual machine to be migrated downloaded from the object store may be vhd, vmdk, raw, vhdx, qcow, vdi, qed, zvhd or zvhd2, etc. Therefore, you can use the qemu-img tool to convert the format of the image file. For example, you can convert it to qcow2, which makes it easy to mount the image file. .vhd xxx.qcow2 ". It should be noted that if the format of the image file is converted to qcow2, in the above example 4, the format of the image file may be converted from qcow2 to zvhd.
- the validity check of the information of the image file of the virtual machine to be migrated may be performed. If the validity check is passed, a preset command may be started to perform the image file of the virtual machine to be migrated. Processing. If the validity check fails (or the validity check fails), it can be determined that the private image creation fails.
- the information of the image file includes: the size of the image file and the system disk size of the image file. Performing a validity check on the information of the image file may refer to determining whether the size of the image file exceeds a first preset range, and determining Whether the size of the system disk of the image file exceeds the second preset range. If neither of them exceeds the validity check, the validity check is passed. If any of them exceeds, the validity check fails.
- the first preset range may be obtained according to the processing capability of the conversion service node, and the second preset range may be set by a user, which is not specifically limited in this embodiment of the present application.
- Step 203 Use the private image to issue a virtual machine running on the target virtualization platform.
- the image file of the virtual machine to be migrated is processed by executing a preset command, so that the automatic migration of the image file of the virtual machine to be migrated can be realized without manual operations by the user, which can effectively improve the migration efficiency and meet user needs .
- FIG. 3 is a schematic flowchart of a virtual machine migration method provided by an embodiment of the present application. The following further describes the embodiment of the present application with reference to FIG. 3. As shown in Figure 3, the method includes:
- Step 301 The user exports an image file of the virtual machine to be migrated from the source virtualization platform.
- the source virtualization platform may be a VMware virtualization platform, a Virtual Server virtualization platform, a XEN virtualization platform, or a KVM virtualization platform.
- the format of the image file of the virtual machine to be migrated may be vhd, vmdk, qcow2, or raw.
- Step 302 The user uploads the image file of the virtual machine to be migrated to the object store.
- step 303 the user chooses to import the image file of the virtual machine to be migrated in the management console (see the content shown in the third line in FIG. 4), and chooses to perform background automated V2V processing (see the content shown in the last line in FIG. 4) .
- Step 304 The management console sends first control information to the image service, and the first control information is used to notify the image service that the image file of the virtual machine to be migrated has been uploaded to the object store.
- Step 305 After receiving the first control information, the image service sends second control information to the conversion service node, where the second control information is used to instruct the conversion service node to convert the image file of the virtual machine to be migrated into a private image.
- Step 306 After receiving the second control information, the conversion service node downloads an image file of the virtual machine to be migrated from the object store.
- Step 307 The conversion service node converts the format of the image file of the virtual machine to be migrated, such as qcow2. Understandably, if the format of the image file of the virtual machine to be migrated is qcow2, step 307 may not be performed.
- Step 308 The conversion service node mounts the image file of the virtual machine to be migrated.
- Step 309 The conversion service node performs a validity check on the image file of the virtual machine to be migrated. If the validity check is passed, step 310 is performed, otherwise, the process ends.
- Step 310 The conversion service node changes the disk partition name of the image file to the UUID of the disk partition.
- Step 311 The conversion service node loads the driver required by the destination virtualization platform in the image file, such as a XEN driver and a virtio driver.
- Step 312 The conversion service node converts the format of the image file into a preset format, such as zvhd, through a preset tool to obtain a private image.
- a preset format such as zvhd
- Step 313 The conversion service node uploads the private image to the object store.
- the private image in the object store can be used to issue virtual machines running on the target virtualization platform in the future.
- the disk partition name can be unified into the UUID automatically during the migration process, and the virtio driver (including virtio_blk, virtio_scsi, virtio_net can be automatically injected during the migration process).
- the virtio driver including virtio_blk, virtio_scsi, virtio_net can be automatically injected during the migration process).
- Virtio_pci, virtio_ring, virtio For Windows virtual machines, XEN drivers required for XEN virtualization platform startup and virtio drivers required for KVM virtualization platform startup can be automatically injected during the migration process, and driver information can also be automatically loaded into the Windows registry during the migration process To ensure that the virtual machine is powered on and started from disk.
- Windows systems you can also set related services to take effect automatically during the startup process (such as enabling windows PnP (Plug and Play) to automatically discover devices (no restart required), so that users can log in to the corresponding optimization can automatically take effect to facilitate compliance
- the user ’s habit of using Windows Server can also enable the Firstboot system service (rhsrvany) to ensure that all devices are ready (windowsrvany)).
- you can also use technologies that do not interfere with other applications during the import process such as enabling pnp_wait. exe, call CMP_WaitNoPendingInstallEvents, to avoid conflicts with other startup programs when the system starts), so as to ensure the success rate of the Windows driver offline import process.
- each device in the foregoing embodiments may include a hardware structure and / or a software module corresponding to each function.
- Those skilled in the art should easily realize that the present invention can be implemented in the form of hardware or a combination of hardware and computer software by combining the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is performed by hardware or computer software-driven hardware depends on the specific application of the technical solution and design constraints. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
- FIG. 5 shows a possible exemplary block diagram of a device involved in an embodiment of the present invention.
- the device 500 may be used to implement various possible designs in the foregoing method embodiments.
- the device 500 can exist in the form of software.
- the apparatus 500 may include a download module 501, a processing module 502, and a distribution module 503.
- the processing module 502 may be a processor or a controller, for example, it may be a general-purpose central processing unit (central processing unit, CPU). It may implement or execute various exemplary logical blocks described in connection with the present disclosure (as shown in Figures 2a and 2b).
- the processor may also be a combination that implements computing functions, such as a combination including one or more microprocessors and so on.
- the apparatus 600 includes: a processor 602, a communication interface 603, and a memory 601.
- the device 600 may further include a bus 604.
- the communication interface 603, the processor 602, and the memory 601 can be connected to each other through a communication line 604.
- the communication line 604 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (extended industry standard architecture). , Referred to as EISA) bus and so on.
- the bus 604 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only a thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
- the processor 602 may be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the solution of the present application.
- the communication interface 603 uses any device such as a transceiver to communicate with other devices or a communication network.
- the memory 601 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM), or other types that can store information and instructions
- the dynamic storage device can also be electrically erasable programmable read-only memory (electrically server-programmable read-only memory (EEPROM)), compact disc (read-only memory (CD-ROM) or other optical disk storage, Optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can Any other media accessed by the computer, but not limited to this.
- the memory may exist independently, and is connected to the processor through the communication line 604. The memory can also be integrated with the processor.
- the memory 601 is configured to store a computer execution instruction for executing the solution of the present application, and the processor 602 controls execution.
- the processor 602 is configured to execute a computer execution instruction stored in the memory 601, so as to implement the method provided by the foregoing embodiment of the present application.
- the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
- the embodiments of the present application also provide a computer program product.
- the computer program product includes computer software instructions that can be loaded by a processor to implement the method in the process shown in FIG. 2a, FIG. 2b, or FIG. 3 in this application.
- this application may be provided as a method, an apparatus (device), or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects, which are collectively referred to herein as a "module” or “system”. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The computer program is stored / distributed in a suitable medium, provided with or as part of the hardware, or in other distributed forms, such as via the Internet or other wired or wireless telecommunications systems.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a particular manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
- the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请涉及虚拟化技术领域,公开了一种虚拟机迁移方法及装置,其中方法包括:从对象存储中下载待迁移虚拟机的镜像文件;启动预设命令对下载的所述镜像文件进行处理,得到所述待迁移虚拟机的镜像文件对应的私有镜像,并使用所述私有镜像发放在所述目的虚拟化平台运行的虚拟机,其中,预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的。采用上述方法,通过执行预设命令对待迁移虚拟机的镜像文件进行处理,从而能够实现待迁移虚拟机的镜像文件的自动化迁移,无需用户执行手动操作,能够有效提高迁移效率,满足用户需求。
Description
本申请涉及虚拟化技术领域,尤其涉及一种虚拟机迁移方法及装置。
随着虚拟化技术的日益成熟,出现了很多成熟的开源虚拟化技术,比如基于内核的虚拟机(kernel-based virtual machine,KVM)、开放源代码虚拟机监视器(XEN)等开源虚拟化技术。在此基础上,云计算发展迅速,各大厂商纷纷投入资金和技术力量研发自己的云产品。
然而,由于不同厂商的产品底层可能使用了不同的虚拟化技术,从而产生了一种新的需求,即V2V(virtual-to-virtual)虚拟机迁移。V2V虚拟机迁移所采用的一种主要方式为静态迁移,静态迁移也可以称为常规迁移或离线迁移(offline migration),是指在虚拟机关机或暂停的情况下从一台物理机迁移到另一台物理机。由于虚拟机的文件系统建立在虚拟机镜像上面,因此在虚拟机关机的情况下,只需要简单的迁移虚拟机镜像和相应的配置文件到另外一台物理主机上;如果需要保存虚拟机迁移之前的状态,则在迁移之前将虚拟机暂停,然后拷贝状态至目的主机,最后在目的主机重建虚拟机状态,恢复执行。
由于相同的虚拟机平台具有相同的实现技术和应用程序编程接口(application programming interface,API)接口,因此可以较为容易地实现上述静态迁移。但对于跨平台的虚拟机离线迁移,由于底层实现技术可能不同,实现起来难度较大,仍需进一步研究。
发明内容
有鉴于此,本申请提供了一种虚拟机迁移方法及装置,用于实现虚拟机的自动化迁移,提高虚拟机迁移的效率。
第一方面,本申请实施例提供一种虚拟机迁移方法,包括:
从对象存储OBS中下载待迁移虚拟机的镜像文件;启动预设命令对下载的所述镜像文件进行处理,得到所述镜像文件对应的私有镜像;所述预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的;所述源虚拟化平台为所述待迁移虚拟机迁移前所在的虚拟化平台,所述目的虚拟化平台为所述待迁移虚拟机要迁移到的虚拟化平台;使用所述私有镜像发放在所述目的虚拟化平台运行的虚拟机。
如此,通过执行预设命令对待迁移虚拟机的镜像文件进行处理,从而能够实现待迁移虚拟机的镜像文件的自动化迁移,无需用户执行手动操作,能够有效提高迁移效率,满足用户需求。
在一种可能的设计中,所述启动预设命令对所述待迁移虚拟机的镜像文件进行处理,包括:将所述镜像文件的磁盘分区名修改为磁盘分区的通用唯一识别码UUID,和/或,将所述镜像文件的格式转换为预设格式。
在一种可能的设计中,所述待迁移虚拟机的操作系统为Linux操作系统;所述启动预设命令对所述镜像文件进行处理,还包括:在检查到所述镜像文件的initrd文件中不包括所述目的虚拟化平台所需要的驱动文件时,加载所述目的虚拟化平台所需要的驱动文件。
在一种可能的设计中,所述待迁移虚拟机的操作系统为Windows操作系统;所述启动预设命令对所述镜像文件进行处理,还包括:将所述目的虚拟化平台所需要的驱动文件离线导入所述镜像文件的注册表中。
在一种可能的设计中,所述启动预设命令对所述镜像文件进行处理之前,还包括:确定所述待迁移虚拟机的镜像文件的信息通过有效性检查;所述镜像文件的信息包括以下至少一项:所述镜像文件的大小,所述镜像文件的系统盘大小。
在一种可能的设计中,所述源虚拟化平台包括VMware虚拟化平台、Virtual Server虚拟化平台、开放源代码虚拟机监视器XEN虚拟化平台、基于内核的虚拟机KVM虚拟化平台中的任意一项;所述目的虚拟化平台包括XEN虚拟化平台和/或KVM虚拟化平台。
第二方面,本申请实施例提供一种虚拟机迁移装置,该装置具有实现上述第一方面的各种可能的设计所述的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块,比如下载模块、处理模块和发放模块;其中,下载模块,用于从对象存储OBS中下载待迁移虚拟机的镜像文件;处理模块,用于启动预设命令对下载的所述镜像文件进行处理,得到所述待迁移虚拟机的镜像文件对应的私有镜像;所述预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的;所述源虚拟化平台为所述待迁移虚拟机迁移前所在的虚拟化平台,所述目的虚拟化平台为所述待迁移虚拟机要迁移到的虚拟化平台;发放模块,用于使用所述私有镜像在所述目的虚拟化平台发放虚拟机。
在一种可能的设计中,所述处理模块具体用于:将所述镜像文件的磁盘分区名修改为磁盘分区的通用唯一识别码UUID,和/或,将所述镜像文件的格式转换为预设格式。
在一种可能的设计中,所述待迁移虚拟机的操作系统为Linux操作系统时,所述处理模块可以具体用于:在检查到所述镜像文件的initrd文件中不包括所述目的虚拟化平台所需要的驱动文件时,加载所述目的虚拟化平台所需要的驱动文件。
在一种可能的设计中,所述待迁移虚拟机的操作系统为Windows操作系统时,所述处理模块可以具体用于:将所述目的虚拟化平台所需要的驱动文件离线导入所述镜像文件的注册表中。
在一种可能的设计中,所述处理模块启动预设命令对所述待迁移虚拟机的镜像文件进行处理之前,还用于:确定所述待迁移虚拟机的镜像文件的信息通过有效性检查;所述镜像文件的信息包括以下至少一项:所述镜像文件的大小,所述镜像文件的系统盘大小。
在一种可能的设计中,所述源虚拟化平台包括VMware虚拟化平台、Virtual Server虚拟化平台、开放源代码虚拟机监视器XEN虚拟化平台、基于内核的虚拟机KVM虚拟化平台中的任意一项;所述目的虚拟化平台包括XEN虚拟化平台和/或KVM虚拟化平台。
第三方面,本申请实施例提供一种虚拟机迁移装置,包括:处理器和存储器;该存储器存储计算机执行指令,当该装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该装置执行如上述第一方面的各种可能的设计所述的方法。
第四方面,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质 中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面的各种可能的设计所述的方法。
第五方面,本申请还提供一种包括指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面至第五方面中任意一方面的各种可能的设计所述的方法。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
图1为本申请实施例适用的一种系统架构示意图;
图2a和图2b分别为本申请实施例提供的虚拟机迁移方法所对应的流程示意图;
图3为本申请实施例提供的虚拟机迁移方法的整体流程示意图;
图4为管理控制台的界面示意图;
图5为本申请实施例提供的一种虚拟机迁移装置的结构示意图;
图6为本申请实施例提供的又一种虚拟机迁移装置的结构示意图。
下面结合说明书附图对本申请实施例进行详细说明。
在进行跨平台的虚拟机离线迁移时,通常的实现方式为半自动迁移,比如对于Linux虚拟机(即虚拟机的操作系统为Linux操作系统),客户在原虚拟化平台卸载平台工具(tools),手动处理系统启动文件设置、文件系统挂载设置,以及手动加载可能需要的虚拟化驱动,再封装镜像,尝试迁移到目的虚拟化平台;针对Windows虚拟机(即虚拟机的操作系统为Windows操作系统),客户在原虚拟化平台卸载平台工具,并安装目的虚拟化平台的平台工具,手动加载注册表,以及手动处理文件系统挂载、网络驱动等,再封装镜像,尝试迁移到目的虚拟化平台。
根据上述内容可知,目前离线迁移无法做到自动化处理,实现效率较低,无法满足客户的需求。基于此,本申请实施例提供一种虚拟机迁移方法,用于提高虚拟机迁移效率。
图1为本申请实施例适用的一种系统架构示意图,如图1所示,该系统架构中包括:管理控制台(console)、镜像服务(image management service,IMS)、对象存储(object storage,OBS)和转换服务节点。
其中,管理控制台用于提供可供用户操作的界面,比如,用户可以在管理控制台所提供的界面上选择一个镜像文件注册私有镜像,并输入该镜像文件的基础信息,以及确定是否进行自动化V2V处理。镜像文件(或镜像)是一个包含了软件及必要配置的云服务器或裸金属服务器模版,包含操作系统或业务数据,还可以包含应用软件(例如,数据库软件)和私有软件。镜像分为公共镜像、私有镜像和共享镜像,公共镜像为系统默认提供的镜像,私有镜像为用户自己创建的镜像,共享镜像为其他用户共享的私有镜像。本申请实施例将侧重于研究将外部镜像文件转换为私有镜像。
镜像服务用于提供简单方便的镜像自助管理功能。用户可以灵活便捷的使用公共镜像、私有镜像或共享镜像申请云服务器和裸金属服务器。同时,用户还能通过外部镜像文件创建私有镜像。
对象存储可以用于存储用户上传的外部镜像文件以及系统处理完成后产生的私有镜 像。
转换服务节点用于将外部镜像文件转化为私有镜像,具体来说,转化服务节点执行的功能可以包括对外部镜像文件的格式进行转换等。
需要说明的是,图1中仅示意出将外部镜像文件转化为私有镜像文件的处理过程所涉及的主要功能节点,具体实施中,图1中还可以包括其它的功能节点,比如创建虚拟机的功能节点,具体不做限定。
图2a和图2b分别为本申请实施例提供的虚拟机迁移方法所对应的流程示意图。如图2a所示,包括:
步骤201,从对象存储中下载待迁移虚拟机的镜像文件。该步骤可以由图1中所示意出的转换服务节点来执行。
此处,可以是从对象存储下载待迁移虚拟机的镜像文件。在步骤201之前,管理控制台可以根据用户的操作指令,从源虚拟机平台导出待迁移虚拟机的镜像文件,并将待迁移虚拟机的镜像文件上传到对象存储中。
其中,所述源虚拟化平台为所述待迁移虚拟机迁移前所在的虚拟化平台,源虚拟化平台可以包括VMware虚拟化平台、Virtual Server虚拟化平台、XEN虚拟化平台、KVM虚拟化平台中的任意一项(如图2b所示),可以理解地,源虚拟化平台还可以为其它虚拟化平台。不同虚拟化平台中的镜像文件的格式可能不同,在一个示例中,本申请实施例可以支持的待迁移虚拟机的镜像文件的格式包括vhd、vmdk、qcow2、raw、vhdx、qcow、vdi、qed、zvhd或zvhd2等(图2b中仅示意出部分可能的格式),若待迁移虚拟机的镜像文件的格式为上述所描述的格式以外的其它格式,则可以使用qemu-img工具对镜像文件的格式进行转换,进而将转换后的镜像文件上传到对象存储中。其中,vhd格式是指微软虚拟磁盘格式(microSoft virtual hard disk format),qcow2格式是指qemu支持的磁盘镜像格式之一,通常应用KVM虚拟化平台上,vmdk格式是指VMware虚拟化平台创建的虚拟硬盘格式,其它格式不再一一介绍。
步骤202,启动预设命令对下载的所述镜像文件进行处理,得到所述待迁移虚拟机的镜像文件对应的私有镜像;所述预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的;目的虚拟化平台为所述待迁移虚拟机要迁移到的虚拟化平台,在一个示例中,目的虚拟化平台可以包括XEN虚拟化平台和/或KVM虚拟化平台。该步骤可以由图1中所示意出的转换服务节点来执行。
此处,在一个示例中(为便于描述,简称示例1),启动预设命令对下载的所述镜像文件进行处理,可以包括:将所述镜像文件的磁盘分区名修改为磁盘分区的通用唯一识别码(universally unique identifier,UUID)。具体来说,可以使用blkid命令,查询镜像文件得到磁盘分区的UUID,进而将系统启动文件中(/etc/grub/grub.conf)使用的磁盘分区标识替换为blkid查询到的磁盘分区的UUID,以及将系统启动磁盘自动挂载文件中(/etc/fstab)使用的磁盘分区标识容替换为blkid查询到的磁盘分区的UUID。
在又一个示例中(为便于描述,简称示例2),若待迁移虚拟机的操作系统为Linux操作系统,则启动预设命令对下载的所述镜像文件进行处理,还可以包括:检查所述镜像文件的initrd文件中是否包括所述目的虚拟化平台所需要的驱动文件,若否,则加载所述目的虚拟化平台所需要的驱动文件。比如,可以检查所述镜像文件的initrd文件中是否包 括XEN驱动和virtio驱动,若否,则加载XEN驱动和virtio驱动。
在又一个示例中(为便于描述,简称示例3),若待迁移虚拟机的操作系统为Windows操作系统,则启动预设命令对下载的所述镜像文件进行处理,还可以包括:将所述目的虚拟化平台所需要的驱动文件离线导入所述镜像文件的注册表中。通过采用这种注册表离线导入技术,可以实现无需用户登录即可使驱动生效,以便于达到最佳性能。进一步地,还可以结合使用服务开机启动技术或者其它可能的技术,具体不做限定。
在又一个示例中(为便于描述,简称示例4),启动预设命令对下载的所述镜像文件进行处理,可以包括:通过预设工具将所述镜像文件的格式转换为预设格式。具体来说,可以是启动qemu-img工具对镜像文件的格式进行转换,比如,可以将镜像文件的格式转换为zvhd。
需要说明的是:(1)在一种可能的实施例中,可以先执行示例1中的过程,然后执行示例2中的过程,以及执行示例4中的过程,进而实现将Linux虚拟机的镜像文件转换为私有镜像;在又一种可能的实施例中,可以先执行示例1中的过程,然后执行示例3中的过程,以及执行示例4中的过程,进而实现将Windows虚拟机的镜像文件转换为私有镜像。(2)上述示例1至示例4仅为基于源虚拟化平台与目的虚拟化平台之间可能存在的差异而给出的一些示例性处理方式,在其它可能的实施例中,还可以基于源虚拟化平台与目的虚拟化平台之间可能存在的其它差异来配置预设命令,以便于更有效地实现虚拟机的镜像文件的自动化迁移。
在启动预设命令对下载的所述镜像文件进行处理之前,由于从对象存储中下载的待迁移虚拟机的镜像文件的格式可能为vhd、vmdk、raw、vhdx、qcow、vdi、qed、zvhd或zvhd2等,因此,可以使用qemu-img工具对镜像文件的格式进行转换,比如可以转换为qcow2,从而便于挂载镜像文件,具体的转换命令可以为“qemu-img convert-f vhd-O qcow2 xxx.vhd xxx.qcow2”。需要说明的是,若此处将镜像文件的格式转换为qcow2,则上述示例4中可以是将镜像文件的格式由qcow2转换为zvhd。
进一步地,本申请实施例中还可以对所述待迁移虚拟机的镜像文件的信息进行有效性检查,若通过有效性检查,则可启动预设命令对所述待迁移虚拟机的镜像文件进行处理,若未通过有效性检查(或有效性检查失败),则可确定创建私有镜像失败。在一个示例中,镜像文件的信息包括:镜像文件的大小和镜像文件的系统盘大小,对镜像文件的信息进行有效性检查可以是指判断镜像文件的大小是否超过第一预设范围,以及判断镜像文件的系统盘大小是否超过第二预设范围,若二者均未超过,则通过有效性检查,若存在任一项超过,则有效性检查失败。其中,第一预设范围可以是根据转换服务节点的处理能力得到的,第二预设范围可以是用户设置的,本申请实施例对此不做具体限定。
步骤203,使用所述私有镜像发放在所述目的虚拟化平台运行的虚拟机。此处,可以使用私有镜像发放在XEN虚拟化平台运行的虚拟机,也可以使用私有镜像发放在KVM虚拟化平台运行的虚拟机,如图2b所示。
本申请实施例中,通过执行预设命令对待迁移虚拟机的镜像文件进行处理,从而能够实现待迁移虚拟机的镜像文件的自动化迁移,无需用户执行手动操作,能够有效提高迁移效率,满足用户需求。
图3为本申请实施例提供的虚拟机迁移方法的整体流程示意图,下面结合图3对本申 请实施例做进一步介绍。如图3所示,该方法包括:
步骤301,用户从源虚拟化平台导出待迁移虚拟机的镜像文件。其中,源虚拟化平台可以为VMware虚拟化平台、Virtual Server虚拟化平台、XEN虚拟化平台或KVM虚拟化平台,待迁移虚拟机的镜像文件的格式可能为vhd、vmdk、qcow2或raw。
步骤302,用户将待迁移虚拟机的镜像文件上传到对象存储。
步骤303,用户在管理控制台选择导入待迁移虚拟机的镜像文件(参见图4中第三行所示意的内容),并选择进行后台自动化V2V处理(参见图4中最后一行所示意的内容)。
步骤304,管理控制台向镜像服务发送第一控制信息,第一控制信息用于通知镜像服务所述待迁移虚拟机的镜像文件已上传到对象存储。
步骤305,镜像服务接收到第一控制信息后,向转换服务节点发送第二控制信息,第二控制信息用于指示转换服务节点将待迁移虚拟机的镜像文件转换为私有镜像。
步骤306,转换服务节点接收到第二控制信息后,从对象存储中下载待迁移虚拟机的镜像文件。
步骤307,转换服务节点对待迁移虚拟机的镜像文件的格式进行转换,比如转换为qcow2。可以理解地,若待迁移虚拟机的镜像文件的格式为qcow2,则也可以不执行步骤307。
步骤308,转换服务节点对待迁移虚拟机的镜像文件进行挂载。
步骤309,转换服务节点对待迁移虚拟机的镜像文件进行有效性检查,若通过有效性检查,则执行步骤310,否则,结束。
步骤310,转换服务节点将镜像文件的磁盘分区名修改为磁盘分区的UUID。
步骤311,转换服务节点在镜像文件中加载目的虚拟化平台所需要的驱动,比如XEN驱动和virtio驱动。
步骤312,转换服务节点通过预设工具将镜像文件的格式转换为预设格式,比如zvhd,得到私有镜像。
步骤313,转换服务节点将私有镜像上传到对象存储中。
如此,后续可使用对象存储中的私有镜像发放在目的虚拟化平台运行的虚拟机。
需要说明的是,上述图3中主要介绍一种可能的执行流程,各个步骤的具体实现可以参见有关图2a中的描述,此处不再赘述。
通过采用本发明实施例中提供的虚拟化迁移方法,对于Linux虚拟机,在迁移过程中可以自动将磁盘分区名统一为UUID,并在迁移过程中可以自动化注入virtio驱动(包括virtio_blk、virtio_scsi、virtio_net、virtio_pci、virtio_ring、virtio)。对于Windows虚拟机,在迁移过程中可以自动化注入XEN虚拟化平台启动需要的XEN驱动及KVM虚拟化平台启动需要的virtio驱动,以及,在迁移过程中还可以将驱动信息自动化加载进Windows注册表中,从而保证虚拟机开机从磁盘启动。对于Windows系统,还可以设置相关服务在启动过程中自动生效(比如启用windows PnP(Plug and Play)自动发现设备(不需要重启),从而实现无需用户登录相应的优化即可自动生效,以便于符合用户使用Windows Server的习惯,还可以启用Firstboot系统服务(rhsrvany),确保所有设备都就绪(windows srvany)),进一步地,还可以通过在导入过程不被其他应用程序干扰的技术(比如启用pnp_wait.exe,调用CMP_WaitNoPendingInstallEvents,避免系统启动的时候,跟别的启动程序冲突), 从而保证Windows驱动离线导入过程的成功率。
可以理解的是,上述实施例中的各个设备为了实现相应的功能,其可以包括执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
在采用集成的单元的情况下,图5示出了本发明实施例中所涉及的装置的可能的示例性框图,该装置500可以用于实现上述方法实施例中各种可能的设计,该装置500可以以软件的形式存在。装置500可以包括:下载模块501、处理模块502和发放模块503。其中,处理模块502可以是处理器或控制器,例如可以是通用中央处理器(central processing unit,CPU)。其可以实现或执行结合本发明公开内容所描述的各种示例性的逻辑方框(如图2a和图2b所示)。所述处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合等等。
参阅图6所示,为本申请提供的一种虚拟机迁移装置示意图,该装置600包括:处理器602、通信接口603、存储器601。可选的,装置600还可以包括总线604。其中,通信接口603、处理器602以及存储器601可以通过通信线路604相互连接;通信线路604可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述总线604可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
处理器602可以是一个CPU,微处理器,ASIC,或一个或多个用于控制本申请方案程序执行的集成电路。
通信接口603,使用任何收发器一类的装置,用于与其他设备或通信网络通信。
存储器601可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically er服务器able programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路604与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器601用于存储执行本申请方案的计算机执行指令,并由处理器602来控制执行。处理器602用于执行存储器601中存储的计算机执行指令,从而实现本申请上述实施例提供的方法。
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。
本申请实施例还提供了计算机程序产品。该计算机程序产品包括计算机软件指令,该计算机软件指令可通过处理器进行加载来实现本申请中如图2a、图2b或图3所示的流程中的方法。
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
本领域技术人员应明白,本申请的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式,这里将它们都统称为“模块”或“系统”。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过Internet或其它有线或无线电信系统。
本申请是参照本申请实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (14)
- 一种虚拟机迁移方法,其特征在于,所述方法包括:从对象存储OBS中下载待迁移虚拟机的镜像文件;启动预设命令对下载的所述镜像文件进行处理,得到所述镜像文件对应的私有镜像;所述预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的;所述源虚拟化平台为所述待迁移虚拟机迁移前所在的虚拟化平台,所述目的虚拟化平台为所述待迁移虚拟机要迁移到的虚拟化平台;使用所述私有镜像发放在所述目的虚拟化平台上运行的虚拟机。
- 根据权利要求1所述的方法,其特征在于,所述启动预设命令对所述镜像文件进行处理,包括:将所述镜像文件的磁盘分区名修改为磁盘分区的通用唯一识别码UUID,和/或,将所述镜像文件的格式转换为预设格式。
- 根据权利要求2所述的方法,其特征在于,所述待迁移虚拟机的操作系统为Linux操作系统;所述启动预设命令对所述镜像文件进行处理,还包括:在检查到所述镜像文件的initrd文件中不包括所述目的虚拟化平台所需要的驱动文件时,在所述镜像文件的initrd文件中加载所述目的虚拟化平台所需要的驱动文件。
- 根据权利要求2所述的方法,其特征在于,所述待迁移虚拟机的操作系统为Windows操作系统;所述启动预设命令对所述镜像文件进行处理,还包括:将所述目的虚拟化平台所需要的驱动文件离线导入所述镜像文件的注册表中。
- 根据权利要求1至4中任一项所述的方法,其特征在于,所述启动预设命令对所述镜像文件进行处理之前,还包括:确定所述待迁移虚拟机的镜像文件的信息通过有效性检查;所述镜像文件的信息包括以下至少一项:所述镜像文件的大小,所述镜像文件的系统盘大小。
- 根据权利要求1至5中任一项所述的方法,其特征在于:所述源虚拟化平台包括VMware虚拟化平台、Virtual Server虚拟化平台、开放源代码虚拟机监视器XEN虚拟化平台、基于内核的虚拟机KVM虚拟化平台中的任意一项;所述目的虚拟化平台包括XEN虚拟化平台和/或KVM虚拟化平台。
- 一种虚拟机迁移装置,其特征在于,所述装置包括:下载模块,用于从对象存储OBS中下载待迁移虚拟机的镜像文件;处理模块,用于启动预设命令对下载的所述镜像文件进行处理,得到所述镜像文件对应的私有镜像;所述预设命令是基于源虚拟化平台和目的虚拟化平台之间的差异配置的;所述源虚拟化平台为所述待迁移虚拟机迁移前所在的虚拟化平台,所述目的虚拟化平台为所述待迁移虚拟机要迁移到的虚拟化平台;发放模块,用于使用所述私有镜像发放在所述目的虚拟化平台运行的虚拟机。
- 根据权利要求7所述的装置,其特征在于,所述处理模块具体用于:将所述镜像文件的磁盘分区名修改为磁盘分区的通用唯一识别码UUID,和/或,将所述镜像文件的格式转换为预设格式。
- 根据权利要求8所述的装置,其特征在于,所述待迁移虚拟机的操作系统为Linux操作系统;所述处理模块具体用于:在检查到所述镜像文件的initrd文件中不包括所述目的虚拟化平台所需要的驱动文件时,加载所述目的虚拟化平台所需要的驱动文件。
- 根据权利要求8所述的装置,其特征在于,所述待迁移虚拟机的操作系统为Windows操作系统;所述处理模块具体用于:将所述目的虚拟化平台所需要的驱动文件离线导入所述镜像文件的注册表中。
- 根据权利要求7至10中任一项所述的装置,其特征在于,所述处理模块启动预设命令对所述待迁移虚拟机的镜像文件进行处理之前,还用于:确定所述待迁移虚拟机的镜像文件的信息通过有效性检查;所述镜像文件的信息包括以下至少一项:所述镜像文件的大小,所述镜像文件的系统盘大小。
- 根据权利要求7至11中任一项所述的装置,其特征在于:所述源虚拟化平台包括VMware虚拟化平台、Virtual Server虚拟化平台、开放源代码虚拟机监视器XEN虚拟化平台、基于内核的虚拟机KVM虚拟化平台中的任意一项;所述目的虚拟化平台包括XEN虚拟化平台和/或KVM虚拟化平台。
- 一种虚拟机迁移装置,其特征在于,包括:处理器和存储器;所述存储器,存储计算机执行指令;所述处理器,用于执行所述存储器存储的所述计算机执行指令,以使所述虚拟机迁移装置执行权利要求1至权利要求6任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行权利要求1至权利要求6任一项的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP19866986.3A EP3851959A4 (en) | 2018-09-30 | 2019-09-27 | METHOD AND DEVICE FOR MIGRATION OF VIRTUAL MACHINERY |
| US17/217,519 US12056519B2 (en) | 2018-09-30 | 2021-03-30 | Virtual machine migration method and apparatus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811161732.3A CN109522088A (zh) | 2018-09-30 | 2018-09-30 | 一种虚拟机迁移方法及装置 |
| CN201811161732.3 | 2018-09-30 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US17/217,519 Continuation US12056519B2 (en) | 2018-09-30 | 2021-03-30 | Virtual machine migration method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020063879A1 true WO2020063879A1 (zh) | 2020-04-02 |
Family
ID=65771570
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/108586 Ceased WO2020063879A1 (zh) | 2018-09-30 | 2019-09-27 | 一种虚拟机迁移方法及装置 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US12056519B2 (zh) |
| EP (1) | EP3851959A4 (zh) |
| CN (1) | CN109522088A (zh) |
| WO (1) | WO2020063879A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111930467A (zh) * | 2020-07-02 | 2020-11-13 | 联想(北京)有限公司 | 虚拟机启动方法、装置、设备及计算机可读存储介质 |
| CN114296864A (zh) * | 2021-12-08 | 2022-04-08 | 中国—东盟信息港股份有限公司 | 一种iso镜像转换成容器镜像的方法及设备 |
| WO2022267427A1 (zh) * | 2021-06-25 | 2022-12-29 | 航天云网科技发展有限责任公司 | 虚拟机迁移方法、系统及电子设备 |
| CN118567689A (zh) * | 2024-07-30 | 2024-08-30 | 济南浪潮数据技术有限公司 | 虚拟化系统更新方法、计算机设备、存储介质和程序产品 |
| CN118860425A (zh) * | 2024-06-15 | 2024-10-29 | 腾讯云计算(北京)有限责任公司 | 镜像文件的导入方法、装置、设备、存储介质及产品 |
Families Citing this family (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP3721341A1 (en) * | 2017-12-04 | 2020-10-14 | British Telecommunications Public Limited Company | Portable virtual machine image |
| CN109522088A (zh) * | 2018-09-30 | 2019-03-26 | 华为技术有限公司 | 一种虚拟机迁移方法及装置 |
| CN110532061A (zh) * | 2019-08-13 | 2019-12-03 | 国云科技股份有限公司 | 一种在多云环境下迁移虚拟机的方法 |
| CN111104201A (zh) * | 2019-12-11 | 2020-05-05 | 中国联合网络通信集团有限公司 | 系统迁移方法和装置、电子设备、存储介质 |
| CN113407294A (zh) | 2020-03-16 | 2021-09-17 | 华为技术有限公司 | 一种虚拟机迁移方法及相关设备 |
| CN111414231B (zh) * | 2020-03-18 | 2022-11-29 | 上海云轴信息科技有限公司 | 一种虚拟机镜像与容器镜像相互转换的方法及设备 |
| CN113296873B (zh) * | 2020-05-15 | 2024-08-06 | 阿里巴巴集团控股有限公司 | 镜像构建方法和装置、终端设备和计算机存储介质 |
| CN111679889B (zh) * | 2020-06-10 | 2023-08-29 | 广州市品高软件股份有限公司 | 一种虚拟机的转换迁移方法和系统 |
| CN111737197A (zh) * | 2020-06-30 | 2020-10-02 | 上海英方软件股份有限公司 | 一种实现不停机迁移业务系统的系统及方法 |
| CN113515344B (zh) * | 2021-05-17 | 2024-05-28 | 中国工商银行股份有限公司 | 跨技术平台的虚拟机自动迁移方法及装置 |
| CN113918284B (zh) * | 2021-10-13 | 2022-08-02 | 江苏安超云软件有限公司 | 云主机批量迁移的方法及装置、电子设备和存储介质 |
| CN114090173A (zh) * | 2021-11-11 | 2022-02-25 | 浪潮云信息技术股份公司 | 一种异构虚拟化平台的虚拟机自动化迁移方法及系统 |
| CN114138409B (zh) * | 2021-11-15 | 2024-03-12 | 苏州浪潮智能科技有限公司 | 虚拟机镜像文件迁移的方法、装置及存储介质 |
| CN114461338B (zh) * | 2022-01-10 | 2022-10-14 | 北京志凌海纳科技有限公司 | virtio驱动程序注入方法和装置 |
| CN114564339A (zh) * | 2022-02-23 | 2022-05-31 | 华云数据控股集团有限公司 | 一种磁盘镜像文件跨平台迁移方法及系统 |
| CN116774915B (zh) * | 2022-09-29 | 2026-04-17 | 福建升腾资讯有限公司 | 一种虚拟机镜像数据的跨平台迁移方法和装置 |
| CN115390996B (zh) * | 2022-10-28 | 2024-02-02 | 安超云软件有限公司 | 虚拟机迁移方法和装置、计算设备和存储介质 |
| CN116661951B (zh) * | 2023-06-02 | 2024-05-14 | 北京首都在线科技股份有限公司 | 镜像文件处理方法、装置、电子设备及存储介质 |
| CN117891472B (zh) * | 2024-03-11 | 2024-06-04 | 杭州吉利汽车数字科技有限公司 | 一种裸金属镜像部署的方法、装置及介质 |
| CN120872477A (zh) * | 2024-04-30 | 2025-10-31 | 华为技术有限公司 | 一种虚拟化环境的数据处理方法及相关装置 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104572274A (zh) * | 2013-10-18 | 2015-04-29 | 宇宙互联有限公司 | 跨云点迁移系统及方法 |
| CN105159760A (zh) * | 2014-05-27 | 2015-12-16 | 中国电信股份有限公司 | 云资源迁移方法和统一的跨平台云资源迁移能力开放接口 |
| US9521198B1 (en) * | 2012-12-19 | 2016-12-13 | Springpath, Inc. | Systems and methods for implementing an enterprise-class converged compute-network-storage appliance |
| CN106569876A (zh) * | 2016-11-11 | 2017-04-19 | 郑州云海信息技术有限公司 | 一种基于直接设备访问模型的虚拟机迁移的方法及装置 |
| CN106775922A (zh) * | 2016-11-22 | 2017-05-31 | 山东浪潮云服务信息科技有限公司 | 一种基于插件机制的虚拟机迁移方法 |
| CN109522088A (zh) * | 2018-09-30 | 2019-03-26 | 华为技术有限公司 | 一种虚拟机迁移方法及装置 |
Family Cites Families (32)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7577722B1 (en) * | 2002-04-05 | 2009-08-18 | Vmware, Inc. | Provisioning of computer systems using virtual machines |
| US8209680B1 (en) * | 2003-04-11 | 2012-06-26 | Vmware, Inc. | System and method for disk imaging on diverse computers |
| US7334157B1 (en) * | 2004-02-26 | 2008-02-19 | Symantec Operating Corporation | Restore of data to a computer system having different hardware |
| US20070006205A1 (en) * | 2005-05-18 | 2007-01-04 | Michael Kennedy | System for virtual image migration |
| US20070226795A1 (en) * | 2006-02-09 | 2007-09-27 | Texas Instruments Incorporated | Virtual cores and hardware-supported hypervisor integrated circuits, systems, methods and processes of manufacture |
| US7441113B2 (en) * | 2006-07-10 | 2008-10-21 | Devicevm, Inc. | Method and apparatus for virtualization of appliances |
| US20080201455A1 (en) * | 2007-02-15 | 2008-08-21 | Husain Syed M Amir | Moving Execution of a Virtual Machine Across Different Virtualization Platforms |
| KR101253560B1 (ko) * | 2009-11-05 | 2013-04-11 | 한국전자통신연구원 | 가상화 솔루션의 관리 시스템, 관리 서버, 및 그 방법 |
| US9280378B2 (en) * | 2011-11-30 | 2016-03-08 | Red Hat, Inc. | Adjustment during migration to a different virtualization environment |
| US8990804B1 (en) * | 2011-12-07 | 2015-03-24 | Amazon Technologies, Inc. | Converting virtual machine images from source to destination virtualization environments |
| US20140052877A1 (en) * | 2012-08-16 | 2014-02-20 | Wenbo Mao | Method and apparatus for tenant programmable logical network for multi-tenancy cloud datacenters |
| CN103036947B (zh) * | 2012-11-21 | 2015-05-20 | 北京航空航天大学 | 基于kvm的虚拟机迁移方法及系统 |
| US9372726B2 (en) * | 2013-01-09 | 2016-06-21 | The Research Foundation For The State University Of New York | Gang migration of virtual machines using cluster-wide deduplication |
| US9104455B2 (en) * | 2013-02-19 | 2015-08-11 | International Business Machines Corporation | Virtual machine-to-image affinity on a physical server |
| US9055119B2 (en) * | 2013-03-26 | 2015-06-09 | Vmware, Inc. | Method and system for VM-granular SSD/FLASH cache live migration |
| US9430213B2 (en) * | 2014-03-11 | 2016-08-30 | Cliqr Technologies, Inc. | Apparatus, systems and methods for cross-cloud software migration and deployment |
| US20150324216A1 (en) * | 2014-05-12 | 2015-11-12 | Netapp, Inc. | Self-repairing configuration service for virtual machine migration |
| US9202058B1 (en) * | 2014-07-07 | 2015-12-01 | Trend Micro Inc. | Root volume encryption mechanism in para-virtualized virtual machine |
| CN106201653A (zh) * | 2016-06-30 | 2016-12-07 | 国云科技股份有限公司 | 一种vmware虚拟机转kvm虚拟机的方法 |
| CN106201702A (zh) * | 2016-07-19 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | 虚拟机迁移的方法、系统及云计算管理平台 |
| CN106406979A (zh) * | 2016-09-04 | 2017-02-15 | 国云科技股份有限公司 | XenServer平台虚拟机迁移至KVM虚拟化平台的方法 |
| US10606625B1 (en) * | 2016-09-16 | 2020-03-31 | Google Llc | Hot growing a cloud hosted block device |
| CN107004032B (zh) * | 2016-11-17 | 2023-12-08 | 华为云计算技术有限公司 | 镜像文件转换方法及装置 |
| CN108664523B (zh) * | 2017-03-31 | 2021-08-13 | 华为技术有限公司 | 一种虚拟磁盘文件格式转换方法和装置 |
| CN107102890A (zh) * | 2017-07-12 | 2017-08-29 | 郑州云海信息技术有限公司 | 一种虚拟机的迁移方法及迁移装置 |
| US10574524B2 (en) * | 2017-07-15 | 2020-02-25 | Vmware, Inc. | Increasing reusability of and reducing storage resources required for virtual machine images |
| CN107678831A (zh) * | 2017-09-25 | 2018-02-09 | 郑州云海信息技术有限公司 | 一种实现跨虚拟化平台间迁移的v2v方法 |
| CN107656797A (zh) * | 2017-09-27 | 2018-02-02 | 郑州云海信息技术有限公司 | 跨虚拟化平台迁移虚拟机的方法和装置 |
| CN109582433B (zh) * | 2017-09-29 | 2022-02-01 | 腾讯科技(深圳)有限公司 | 一种资源调度方法、装置、云计算系统及存储介质 |
| CN108255574A (zh) * | 2017-12-05 | 2018-07-06 | 顺丰科技有限公司 | 一种虚拟机迁移方法及装置 |
| US10776482B2 (en) * | 2018-05-18 | 2020-09-15 | International Business Machines Corporation | Automated virtual machine integrity checks |
| US10503612B1 (en) * | 2018-06-25 | 2019-12-10 | Rubrik, Inc. | Application migration between environments |
-
2018
- 2018-09-30 CN CN201811161732.3A patent/CN109522088A/zh active Pending
-
2019
- 2019-09-27 WO PCT/CN2019/108586 patent/WO2020063879A1/zh not_active Ceased
- 2019-09-27 EP EP19866986.3A patent/EP3851959A4/en not_active Ceased
-
2021
- 2021-03-30 US US17/217,519 patent/US12056519B2/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9521198B1 (en) * | 2012-12-19 | 2016-12-13 | Springpath, Inc. | Systems and methods for implementing an enterprise-class converged compute-network-storage appliance |
| CN104572274A (zh) * | 2013-10-18 | 2015-04-29 | 宇宙互联有限公司 | 跨云点迁移系统及方法 |
| CN105159760A (zh) * | 2014-05-27 | 2015-12-16 | 中国电信股份有限公司 | 云资源迁移方法和统一的跨平台云资源迁移能力开放接口 |
| CN106569876A (zh) * | 2016-11-11 | 2017-04-19 | 郑州云海信息技术有限公司 | 一种基于直接设备访问模型的虚拟机迁移的方法及装置 |
| CN106775922A (zh) * | 2016-11-22 | 2017-05-31 | 山东浪潮云服务信息科技有限公司 | 一种基于插件机制的虚拟机迁移方法 |
| CN109522088A (zh) * | 2018-09-30 | 2019-03-26 | 华为技术有限公司 | 一种虚拟机迁移方法及装置 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP3851959A4 * |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111930467A (zh) * | 2020-07-02 | 2020-11-13 | 联想(北京)有限公司 | 虚拟机启动方法、装置、设备及计算机可读存储介质 |
| CN111930467B (zh) * | 2020-07-02 | 2024-03-26 | 联想(北京)有限公司 | 虚拟机启动方法、装置、设备及计算机可读存储介质 |
| WO2022267427A1 (zh) * | 2021-06-25 | 2022-12-29 | 航天云网科技发展有限责任公司 | 虚拟机迁移方法、系统及电子设备 |
| CN114296864A (zh) * | 2021-12-08 | 2022-04-08 | 中国—东盟信息港股份有限公司 | 一种iso镜像转换成容器镜像的方法及设备 |
| CN118860425A (zh) * | 2024-06-15 | 2024-10-29 | 腾讯云计算(北京)有限责任公司 | 镜像文件的导入方法、装置、设备、存储介质及产品 |
| CN118567689A (zh) * | 2024-07-30 | 2024-08-30 | 济南浪潮数据技术有限公司 | 虚拟化系统更新方法、计算机设备、存储介质和程序产品 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109522088A (zh) | 2019-03-26 |
| US12056519B2 (en) | 2024-08-06 |
| US20210216360A1 (en) | 2021-07-15 |
| EP3851959A1 (en) | 2021-07-21 |
| EP3851959A4 (en) | 2021-11-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12056519B2 (en) | Virtual machine migration method and apparatus | |
| CN102402446B (zh) | 应用软件的安装方法和应用软件的安装装置 | |
| US9841966B2 (en) | Selective migration of virtualized applications | |
| CN101211272B (zh) | 虚拟机生成器、虚拟机生成方法和虚拟机管理器 | |
| US9690593B2 (en) | Server information handling system configuration from an end state definition file | |
| CN109995814B (zh) | 云主机资源的迁移方法及装置、通信设备、存储介质 | |
| US11418566B2 (en) | Adding and removing virtual disks remotely to a streaming machine | |
| EP3149578B1 (en) | Grouping virtual machines in a cloud application | |
| CN108089913B (zh) | 一种超融合系统的虚拟机部署方法 | |
| CN110908753A (zh) | 一种智能融合的云桌面服务器、客户端及系统 | |
| CN111309387B (zh) | 一种驱动加载的方法及装置、电子设备、存储介质 | |
| JP6089065B2 (ja) | アップデート方法及びコンピュータシステム | |
| CN106462442B (zh) | 加载虚拟机的系统和方法 | |
| JP2013522788A (ja) | コンピュータシステムにおけるオペレーティングシステムの通信ネットワーク経由でのロードおよびブートを最適化するための方法、コンピュータプログラム、および装置 | |
| JP2016194891A (ja) | ソフトウェア・コンポーネントを更新するための方法、コンピュータ・システムおよびメモリ装置 | |
| CN110347483A (zh) | 物理机到虚拟机迁移方法、装置及存储介质 | |
| CN108255574A (zh) | 一种虚拟机迁移方法及装置 | |
| CN114756290A (zh) | 一种操作系统安装方法、设备及可读存储介质 | |
| CN112286633B (zh) | 基于CloudStack平台的虚拟机创建方法、装置、设备及存储介质 | |
| CN102929662B (zh) | 一种基于网络批量分区的方法 | |
| WO2025256256A1 (zh) | 镜像文件的导入方法、装置、设备、存储介质及产品 | |
| WO2026016552A1 (zh) | 一种裸金属服务器的配置方法以及服务器 | |
| US11055115B1 (en) | Virtual machine conversion in distributed system of remote desktops | |
| US10776148B1 (en) | System and method for utilizing computational power of a server farm | |
| CN115879095A (zh) | 密码重置方法、装置、计算设备及计算机存储介质 |
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: 19866986 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2019866986 Country of ref document: EP Effective date: 20210412 |
|
| WWW | Wipo information: withdrawn in national office |
Ref document number: 2019866986 Country of ref document: EP |