CN112099916B - Virtual machine data migration method and device, computer equipment and storage medium - Google Patents
Virtual machine data migration method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112099916B CN112099916B CN202010930282.0A CN202010930282A CN112099916B CN 112099916 B CN112099916 B CN 112099916B CN 202010930282 A CN202010930282 A CN 202010930282A CN 112099916 B CN112099916 B CN 112099916B
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- nvme
- equipment
- virtual
- migration
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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; CALCULATING OR 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; CALCULATING OR 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
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 application relates to the technical field of cloud, and discloses a virtual machine data migration method, a virtual machine data migration device, computer equipment and a storage medium, wherein the method comprises the steps of virtualizing remote storage equipment into NVMe (network video management entity) equipment after a virtual machine migration message is detected, transmitting the NVMe equipment to a virtual machine, creating virtual equipment through a virtual middle layer, and migrating virtualization software through the virtual equipment after the NVMe equipment is detected to be offline; when the completion of the migration of the virtualization software is detected, connecting a new NVMe device to the target-end virtual machine, transmitting the new NVMe device to the target-end virtual machine, then matching the NVMe device with the new NVMe device to obtain a matching result, and when the matching result is consistent, completing the data migration of the virtual machine. The application also relates to blockchain technology, and the NVMe equipment is stored in the blockchain. The method and the device have the advantages that the data of the virtual machine are migrated on line, so that the migration efficiency of the data of the virtual machine is improved.
Description
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a method and an apparatus for migrating virtual machine data, a computer device, and a storage medium.
Background
The virtual machine live migration requires only short downtime in the live migration process, normal operation of services on the virtual machine is not affected, and a user cannot obviously perceive interruption of the virtual machine services. For virtual machine live migration, reducing service interruption caused by network migration is an important factor for reducing the downtime of virtual machine live migration.
In a migration method of an NVMe device in a virtual environment, an approach adopted at present is to virtualize a remote storage device into a local NVMe device by using an intelligent network card, and then pass the virtual NVMe device through to an operating system OS of a virtual host. But this solution does not support online migration of virtual machines. Because the virtual machine only copies the memory of Guest OS to the virtual machine of the destination end and rebuilds the virtual storage device supported by the virtualization software. However, the configuration registers of the virtual NVMe device are stored in some registers of the smart network card of the source physical machine (the offset is unknown), and the virtualization software cannot directly access the configuration registers.
To solve this problem, the existing solution is to first bring down the PCI-E Pass Through device and then bring it on line at the target end. However, for the storage device, the file system needs to be unloaded first, and then the file system needs to be mounted again after the migration is completed, so that the real online migration cannot be realized, and the migration efficiency is low. What is needed is a method and apparatus for implementing online migration of virtual machine data to improve the migration efficiency of virtual machine data.
Disclosure of Invention
The embodiment of the application aims to provide a virtual machine data migration method, which is used for realizing online migration of a virtual machine so as to improve the migration efficiency of the virtual machine.
In order to solve the foregoing technical problem, an embodiment of the present application provides a method for migrating virtual machine data, including:
after a message of virtual machine migration is detected, virtualizing a remote storage device into an NVMe device through a source host, and transmitting the NVMe device to the virtual machine;
after the virtual machine receives the NVMe equipment, virtual equipment is established through a virtual middle layer;
migrating virtualization software through the virtual equipment after the NVMe equipment is detected to be offline;
when the completion of the migration of the virtualization software is detected, connecting a new NVMe device to a target end virtual machine, and transmitting the new NVMe device to the target end virtual machine;
in a virtual layer of the target end virtual machine, matching the NVMe equipment with the new NVMe equipment to obtain a matching result, and determining that the data migration of the virtual machine is completed when the matching result is consistent.
Further, after detecting the message of the virtual machine migration, virtualizing the remote storage device into an NVMe device by the source host, and transmitting the NVMe device to the virtual machine includes:
when detecting that the control node acquires the message of virtual machine migration, judging whether a virtual operating system simulator QEMU supports the NVMe equipment;
if the judgment result is that the virtual operating system simulator QEMU supports the NVMe equipment, virtualizing remote storage equipment into the NVMe equipment through the virtual operating system simulator QEMU;
and transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
Further, in the virtual layer of the target virtual machine, a matching result is obtained by matching the NVMe device with the new NVMe device, and when the matching result is consistent, the completing of the data migration of the virtual machine includes:
in a virtual layer of the target end virtual machine, after the new NVMe equipment is detected to be on-line, obtaining a universal unique identification code uuid of the new NVMe equipment;
acquiring a universal unique identification code uuid of the NVMe equipment, and performing universal unique identification code uuid matching on the NVMe equipment and the new NVMe equipment to obtain a matching result;
and if the NVMe equipment is consistent with the universal unique identification code uuid of the new NVMe equipment in the matching result, judging that the data migration of the virtual machine is finished.
Further, the obtaining of the universal unique identifier uuid of the NVMe device, and performing universal unique identifier uuid matching on the NVMe device and the new NVMe device to obtain a matching result include:
acquiring a universal unique identification code uuid of the NVMe equipment;
and matching the NVMe equipment with the new NVMe equipment by using the universal unique identification code uuid in a regular matching mode to obtain a matching result.
Further, when the NVMe device is consistent with the unique universal identification code uuid of the new NVMe device in the matching result, after determining that the virtual machine data migration is completed, the method further includes:
when the virtual machine migration is detected to be completed, re-enabling the virtual machine based on the new NVMe device.
Further, after detecting that the NVMe device is offline, before migrating the virtualization software through the virtual device, the method further includes:
and according to the virtual equipment, shielding the hot plug message of the NVMe equipment, and setting the NVMe equipment to be offline.
In order to solve the foregoing technical problem, an embodiment of the present application provides a virtual machine data migration apparatus, including:
the virtual machine migration management system comprises an NVMe device creating module, a virtual machine migration management module and a virtual machine migration management module, wherein the NVMe device creating module is used for virtualizing remote storage equipment into NVMe devices through a source host and transmitting the NVMe devices to the virtual machine after detecting a message of virtual machine migration;
the virtual equipment creating module is used for creating virtual equipment through a virtual middle layer after the virtual machine receives the NVMe equipment;
the virtualization software migration module is used for migrating virtualization software through the virtual equipment after the NVMe equipment is detected to be offline;
the new NVMe device module is used for connecting a new NVMe device to the target end virtual machine and transmitting the new NVMe device to the target end virtual machine after the completion of the migration of the virtualization software is detected;
and the matching result acquisition module is used for matching the NVMe equipment with the new NVMe equipment in the virtual layer of the target end virtual machine to obtain a matching result, and when the matching result is consistent, determining that the data migration of the virtual machine is completed.
Further, the NVMe device creation module includes:
the judging unit is used for judging whether a virtual operating system simulator QEMU supports the NVMe equipment or not after detecting that the control node acquires the message of virtual machine migration;
the virtual unit is used for virtualizing the remote storage device into the NVMe device through the virtual operating system simulator QEMU if the judgment result indicates that the virtual operating system simulator QEMU supports the NVMe device;
and the transmission unit is used for transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
In order to solve the technical problems, the invention adopts a technical scheme that: a computer device is provided that includes, one or more processors; a memory to store one or more programs to cause the one or more processors to implement the virtual machine migration scheme of any of the above.
In order to solve the technical problems, the invention adopts a technical scheme that: a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a virtual machine migration scheme as described in any one of the above.
According to the migration method of the virtual machine data in the scheme, after the message of virtual machine migration is detected, the remote storage device is virtualized into the NVMe device through the source host, the NVMe device is transmitted to the virtual machine, and then after the virtual machine receives the NVMe device, the virtual device is created through the virtual middle layer, so that the pice direct connection device is shielded, the virtualization software can migrate online, the virtual machine migration is facilitated without off-line restarting, and the online migration is facilitated; when the NVMe equipment is detected to be offline, migrating the virtualization software through the virtual equipment; when the migration is detected to be completed, connecting new NVMe equipment to the target end virtual machine, and transmitting the new NVMe equipment to the target end virtual machine; in a virtual layer of a target end virtual machine, matching is carried out on NVMe equipment and new NVMe equipment to obtain a matching result, when the matching result is consistent, the completion of virtual machine data migration is determined, the NVMe equipment does not need to be subjected to register configuration by virtualization software, the configuration is completed by an operating system of the virtual machine, the decoupling of the virtualization software and specific equipment is realized, in the data migration process, the virtual equipment does not need to be restarted offline, the online migration of virtual machine data is realized, and the efficiency of virtual machine data migration is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is an application environment schematic diagram of a migration method of virtual machine data according to an embodiment of the present application;
fig. 2 is a flowchart of an implementation of a migration method of virtual machine data according to an embodiment of the present application;
fig. 3 is a flowchart of an implementation of step S1 in the migration method of virtual machine data according to the present application;
fig. 4 is a flowchart of an implementation of step S5 in the migration method of virtual machine data according to the present application;
fig. 5 is a schematic diagram of a migration apparatus for virtual machine data according to an embodiment of the present application;
fig. 6 is a schematic diagram of a computer device provided in an embodiment of the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
Referring to fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a web browser application, a search-type application, an instant messaging tool, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the virtual machine data migration method provided in the embodiments of the present application is generally executed by a server, and accordingly, a virtual machine data migration apparatus is generally disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring to fig. 2, fig. 2 shows a specific embodiment of a migration method of virtual machine data.
It should be noted that, if the result is substantially the same, the method of the present invention is not limited to the flow sequence shown in fig. 2, and the method includes the following steps:
s1: and when the message of virtual machine migration is detected, virtualizing the remote storage device into an NVMe device through the source host, and transmitting the NVMe device to the virtual machine.
Specifically, when the user side needs to perform virtual machine migration, the virtual machine migration instruction is sent to the server, after the server detects a virtual machine migration message obtained by the control node, the remote storage device is virtualized into a local NVMe device through the source host, and the NVMe device is transmitted to the virtual machine, so that the NVMe device can be subsequently migrated conveniently.
The source host is a system where the software package blocks are stored, and a place where the resources and software package definition files referred to in the software package are located. All UNIX, Linux, OS/2 or Windows operating systems supported in the Tivoli environment can become source hosts after the Tivoli Management Framework and Software Distribution are installed.
Among them, nvme (nvm express) is an open collection of standards and information to fully demonstrate the advantages of non-volatile memory in all types of computing environments from mobile devices to data centers. NVMe is designed from scratch to provide high bandwidth and low latency memory access for current and future NVM technologies. The NVM Express standard includes: NVM Express-a register interface and command set for PCI Express attached storage, and industry standard software for a variety of operating systems. In this implementation, NVMe devices refer to non-volatile, high-speed transport storage devices.
S2: and after the virtual machine receives the NVMe equipment, creating virtual equipment through the virtual middle layer.
Specifically, after the virtual machine receives the NVMe device, the NVMe device is not directly used, but a virtual device is created through a virtual middle layer. The user side can upload the formatted file system in the virtual device or directly use the bare device (virtual device). The purpose of this is to shield the NVMe device from hot plug messages by creating a virtual device.
The Middle layer (Middle Tier), also called as application server layer or application service layer, is a logical layer between the user interface or Web client and the database. Typically, Web servers are located at this level, where business objects are instantiated. The middle tier is a collection of business rules and functions that generate and manipulate the received information. They accomplish this task through business rules (which can be changed frequently) and are thus encapsulated into components that are physically separate from the application logic itself. The virtual middle layer in this embodiment refers to a middle layer in a virtual environment.
In which, a single device is virtualized into multiple logical devices for simultaneous use by multiple user processes through a virtualization technology, and such virtualized devices are generally called virtual devices. The development of virtual storage draws many successful design ideas in the field of computers, and many successful experiences are drawn from the design ideas of virtual storage, disk technology, RAID to IBM mainframe and the like. In an embodiment, a virtual device is created through a virtual middle layer to shield hot plug messages.
S3: and when the NVMe equipment is detected to be offline, migrating the virtualization software through the virtual equipment.
Specifically, the NVMe device is set to be offline through virtualization software, and after a virtual layer of the server monitors an offline event of the NVMe device, a command queue of the virtual device is suspended, so that the virtualization software is migrated through the virtual device. The purpose of doing so is that NVMe device is desorbed (dettach) from the virtual machine first, so as to realize no-pcie device direct connection device before online migration of the virtualization software, so as to realize normal online migration of the virtualization software.
Among them, PCI express (peripheral component interconnect express) is a high-speed serial computer expansion bus standard, which was originally named "3 GIO", proposed by intel in 2001, and is intended to replace the old PCI, PCI-X and AGP bus standards.
S4: and when the completion of the migration of the virtualization software is detected, connecting a new NVMe device to the target end virtual machine, and transmitting the new NVMe device to the target end virtual machine.
Specifically, after the migration of the virtualization software is completed, the NVMe device migration condition needs to be determined. Therefore, by the same means as in step S1, a new NVMe device is connected to the target virtual machine and is transferred to the target virtual machine. The purpose of this is to directly connect a piece peripheral to the operating system OS of the target-side virtual machine on the target virtual machine, so as to compare NVMe devices subsequently and determine the data migration condition of the virtual machine.
S5: in a virtual layer of the target end virtual machine, matching the NVMe equipment with the new NVMe equipment to obtain a matching result, and when the matching result is consistent, determining that the data migration of the virtual machine is completed.
Specifically, in an operating system OS of the target virtual machine, after receiving a new device online, the virtual layer of the target virtual machine may regard the new device as a new NVMe device online message, and acquire the unique identification code uuid common to the NVMe device and the new NVMe device. And then, by matching the NVMe equipment with the new universal unique identification code uuid of the NVMe equipment, if the universal unique identification codes uuid of the NVMe equipment and the new universal unique identification code uuid of the NVMe equipment are matched, namely the matching results are consistent, the virtual machine migration is judged to be completed.
In this embodiment, after detecting a message of virtual machine migration, the source host virtualizes the remote storage device into an NVMe device, and transmits the NVMe device to the virtual machine, and then after the virtual machine receives the NVMe device, creates a virtual device through the virtual intermediate layer, so as to shield the pice direct connection device, so that virtualization software can migrate online, thereby facilitating the virtual machine migration without offline restart, and facilitating the online migration; when the NVMe equipment is detected to be offline, migrating the virtualization software through the virtual equipment; when the migration is detected to be completed, connecting new NVMe equipment to the target end virtual machine, and transmitting the new NVMe equipment to the target end virtual machine; in a virtual layer of a target end virtual machine, a matching result is obtained by matching the NVMe device with a new NVMe device, when the matching result is consistent, the virtual machine is migrated and completed, decoupling of virtualization software and the device is realized, online migration of the virtual machine is realized, completion of virtual machine data migration is determined, register configuration of the NVMe device is not needed by the virtualization software, the configuration is completed by an operating system of the virtual machine, decoupling of the virtualization software and the specific device is realized, in the data migration process, the virtual device is not needed to be offline and restarted, online migration of virtual machine data is realized, and the efficiency of virtual machine data migration is improved.
Referring to fig. 3, fig. 3 shows a specific implementation of step S1, where in step S1, after it is detected that the control node obtains a message of virtual machine migration, the remote storage device is virtualized into an NVMe device by the source host, and the NVMe device is transmitted to the virtual machine, which is described in detail as follows:
s11: and when detecting that the control node acquires the message of virtual machine migration, judging whether a virtual operating system simulator QEMU supports NVMe equipment.
Specifically, because the NVMe device is to be migrated, after it is detected that the control node acquires the message of virtual machine migration, whether the virtual operating system simulator QEMU supports the NVMe device is required, so that the remote storage device is virtualized into the NVMe device in the following.
Wherein. The virtual operating system simulator QEMU is a set of simulation processors written by fabry Bellard (fabry Bellard) that distribute source code with GPL licenses, and is widely used on GNU/Linux platforms. Bochs, PearPC, etc. are similar to them, but do not have many of their features, such as high speed and cross-platform, and the virtual operating system simulator QEMU can simulate to a speed close to that of a real computer by KQEMU, a closed source accelerator. In this embodiment, the remote storage device is virtualized into an NVMe device by the virtual operating system emulator.
S12: and if the judgment result is that the virtual operating system simulator QEMU supports the NVMe equipment, virtualizing the remote storage equipment into the NVMe equipment through the virtual operating system simulator QEMU.
Specifically, when it is determined that the virtual operating system simulator QEMU supports the NVMe device, it is described that, in a virtual environment, the remote storage device can be virtualized into the NVMe device, so that the NVMe device is acquired, and a basis is provided for subsequent NVMe device migration.
S13: and transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
The PCI-E Pass Through technology refers to that the pcie equipment on the host is directly communicated into the virtual machine by the virtualization software, and the operating system OS of the virtual machine directly drives the equipment so as to bypass the virtio virtualization drive commonly used by the virtualization software and achieve the purpose of improving the performance. In this implementation, the NVMe device is transmitted to the virtual machine in a transparent transmission mode of the network card of the virtual machine.
In this embodiment, after it is detected that the control node obtains the message of virtual machine migration, it is determined whether the virtual operating system simulator QEMU supports the NVMe device, if the determination result is that the virtual operating system simulator QEMU supports the NVMe device, the remote storage device is virtualized into the NVMe device by the virtual operating system simulator QEMU, and then the NVMe device is transmitted to the virtual machine in a transparent transmission manner through the virtual machine network card, so that the remote storage device is virtualized into the NVMe device, a basis is provided for online migration of subsequent NVMe devices, and improvement of virtual machine data migration efficiency is facilitated.
Referring to fig. 4, fig. 4 shows a specific implementation manner of step S5, in step S5, in a virtual layer of a target virtual machine, a matching result is obtained by matching an NVMe device with a new NVMe device, and when the matching result is consistent, a specific implementation process of completing data migration of the virtual machine is determined, which is described in detail as follows:
s51: in a virtual layer of a target end virtual machine, after a new NVMe device is detected to be on line, a universal unique identification code uuid of the new NVMe device is obtained.
Specifically, in a virtual layer of the target-side virtual machine, after detecting that a new NVMe device is online, the new NVMe device and the NVMe device are matched to confirm the virtual machine migration condition. So the universally unique identification uuid of the new NVMe device needs to be returned as the matching identification.
The universal Unique identifier uuid (universal Unique identifier) is a standard for software construction, and is also part of the field of distributed computing environment organization of the open software foundation. The unique universal identification number uuid is a 128-bit value that can be calculated by a certain algorithm. To improve efficiency, the commonly used universally unique identification code uuid can be shortened to 16 bits. The universal unique identification code uuid is used to identify the attribute type and is considered as a unique identification in all spaces and times. In general, it is guaranteed that any universally unique identification code uuid generated anywhere that this value is truly unique will not have the same value. One benefit of using a universally unique identification code uuid is that new identifiers can be created for new services. Thus, the client, when looking for a service, only needs to indicate in its service lookup request the universally unique identification number uuid associated with a certain type of service (or a certain specific service), and returns a response if the service provider can match the available service with this universally unique identification number uuid. In this embodiment, the matching result is obtained by matching the unique universal identification code uuid.
S52: and acquiring the universal unique identification code uuid of the NVMe equipment, and performing universal unique identification code uuid matching on the NVMe equipment and the new NVMe equipment to obtain a matching result.
Specifically, each NVMe device has the unique universal identifier uuid, and then the unique universal identifiers uuid of the NVMe device and the new NVMe device are obtained and matched.
S53: and if the NVMe equipment is consistent with the universal unique identification code uuid of the new NVMe equipment in the matching result, judging that the data migration of the virtual machine is completed.
Specifically, since the universal unique identifier uuid has a 128-bit numerical value, when the numerical values are the same, it is determined that the virtual machine migration is completed when the NVMe device is consistent with the universal unique identifier uuid of the new NVMe device.
In this embodiment, in a virtual layer of a target-side virtual machine, after detecting that a new NVMe device is online, a unique universal identification code uuid of the new NVMe device is obtained, the unique universal identification code uuid of the NVMe device is matched with the new NVMe device, a matching result is obtained, the unique universal identification code uuid of the NVMe device is matched with the new NVMe device, a matching result is obtained, online migration of the virtual machine is achieved, and improvement of virtual machine data migration efficiency is facilitated.
Further, step S52 includes:
and acquiring the universal unique identification code uuid of the NVMe device, and matching the NVMe device with the new NVMe device by adopting a regular matching mode to obtain a matching result.
Specifically, as the universal unique identifier uuid is a specific character string, a regular expression can be constructed, and the NVMe device and the new NVMe device are matched through the universal unique identifier uuid in a regular matching manner, so that a matching result is obtained.
In this embodiment, through adopting the regular matching mode, the NVMe device is matched with the new NVMe device by the unique universal identifier uuid, so that the matching efficiency is improved, and further, the virtual machine migration efficiency is improved.
Further, after step S53, the method for migrating virtual machine data further includes:
upon detecting that the virtual machine migration is complete, re-enabling the virtual machine based on the new NVMe device.
Specifically, when it is detected that the migration of the virtual machine is completed, the device needs to be set offline, which easily blocks the io input and output at the user end, so that the virtual machine needs to be restarted, the restart of the virtual machine includes enabling the virtual device, and the io of the upper layer software is newly issued.
Specifically, taking the multipath redundancy multicast as an example, when the device is offline, it will block the ue io because the bottom layer cannot process it. When the device is on-line again, the state of the device is modified to be a normal state, and the io blocked in the queue of the device before the device is re-issued is released again.
Wherein, the Enable is responsible for controlling the input and output of the signal, and is a verb, English 'Enable'. English Enable, prefix en-is the meaning of Enable, able is the ability. Taken together, is enabled. The enabling is colloquially referred to as an "enable" signal, and the feed enabling is a signal that allows feed, i.e. the motor can only be rotated when the feed enabling signal is active.
In this embodiment, when it is detected that the virtual machine migration is completed, the virtual machine is re-enabled based on the new NVMe device, so that the target-side virtual machine can resume normal operation.
Further, after step S3, the method for migrating virtual machine data further includes:
and according to the virtual equipment, shielding the hot plug message of the NVMe equipment, and setting the NVMe equipment to be offline.
Specifically, through the created virtual device, the user only uploads the formatted file system on the virtual device, or directly uses the bare device (virtual device), so as to shield the hot plug message of the NVMe device. And the NVMe device is set to be offline, so that the subsequent virtual softening online migration is ensured under the condition without a pci direct-connection device.
The Hot plugging function is to allow a user to take out and replace damaged components such as a hard disk, a power supply or a board card and the like without closing the system or cutting off the power supply, so that the timely recovery capability, expansibility, flexibility and the like of the system to disasters are improved. The hot plug message is information fed back by the hot plug event.
In this embodiment, according to the virtual device, the hot plug message of the NVMe device is shielded, and the NVMe device is set to be offline, so as to ensure online migration of virtualization softening and improve the migration efficiency of the virtual machine.
Further, the present invention also provides another virtual machine migration scheme: through the dormancy awakening mechanism of the PCIe equipment, the reinitialization process of the equipment is realized. The method comprises the following specific steps:
firstly, a remote storage is connected to a source host machine, an NVMe device is virtualized, and the device is transmitted to a virtual machine for use in a virtual machine network card transparent transmission mode. Then, the operating system OS of the source-end virtual machine initializes the NVMe device normally, and generates a device management structure, which is recorded as NVMe 01. The user side can directly mount a file system on the nvme01 or directly open the bare device for use; when the warm migration occurs, the io on nvme01 is paused first, and waits for the io to return. The virtualization software notifies the operating system OS of the virtual machine to suspend the nvme 01. At this time, the operating system OS of the virtual machine modifies the state of nvme01 to a suspended state, and suspends the IO from the upper layer. And at the moment, normal thermal migration is carried out, then remote storage is reconnected on the target end host computer, and a new NVMe device is established. And then, the hardware addresses of the new NVMe device and the old NVMe device are ensured to be consistent by transmitting the hardware addresses to an operating system OS of the virtual machine in a virtual machine network card transmission mode. This is because the memory of the operating system OS of the target virtual machine is fully copied, so there is a suspended nvme01 device in the memory. And then performing resume operation on the nvme01 device on the operating system OS of the virtual machine, wherein the operation can reinitialize the register information of the nvme device, and the operating system OS of the virtual machine can normally resume nvme0 device because the physical addresses of the devices are consistent. When the resume operation is completed, the operating system OS of the virtual machine sets the nvme01 device state to normal, and releases the upper layer io, and finally the online migration of the virtual machine is realized.
It is emphasized that to further ensure the privacy and security of the NVMe devices, the NVMe devices may also be stored in a node of a blockchain.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
Referring to fig. 5, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a virtual machine data migration apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the virtual machine data migration apparatus of this embodiment includes: an NVMe device creation module 61, a virtual device creation module 62, a virtualization software migration module 63, a new NVMe device module 64, and a matching result acquisition module 65, where:
the NVMe device creating module 61 is configured to, after detecting a message of virtual machine migration, virtualize the remote storage device into an NVMe device through the source host, and transmit the NVMe device to the virtual machine;
a virtual device creating module 62, configured to create a virtual device through a virtual middle layer after the virtual machine receives the NVMe device;
the virtualization software migration module 63 is configured to migrate virtualization software through the virtual device when it is detected that the NVMe device is offline;
the new NVMe device module 64 is configured to connect a new NVMe device to the target-side virtual machine and transmit the new NVMe device to the target-side virtual machine after detecting that the migration of the virtualization software is completed;
and a matching result obtaining module 65, configured to obtain a matching result by matching the NVMe device with the new NVMe device in the virtual layer of the target-side virtual machine, and determine that the data migration of the virtual machine is completed when the matching result is consistent.
Further, the NVMe device creation module 61 includes:
the judging unit is used for judging whether the QEMU supports the NVMe equipment or not after the control node is detected to acquire the message of virtual machine migration;
the virtual unit is used for virtualizing the remote storage device into the NVMe device through the QEMU if the judgment result indicates that the QEMU supports the NVMe device;
and the transmission unit is used for transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
Further, the matching result obtaining module 65 includes:
the universal unique identification code unit is used for acquiring a universal unique identification code uuid of the new NVMe equipment after the new NVMe equipment is detected to be on-line in a virtual layer of the target-end virtual machine;
the matching result matching unit is used for acquiring the universal unique identification code uuid of the NVMe equipment, and performing universal unique identification code uuid matching on the NVMe equipment and the new NVMe equipment to obtain a matching result;
and the migration result judging unit is used for judging that the data migration of the virtual machine is completed if the NVMe equipment is consistent with the universal unique identification code uuid of the new NVMe equipment in the matching result.
Further, the matching result matching unit includes:
the Uuid acquiring subunit is used for acquiring a universal unique identification code Uuid of the NVMe equipment;
and the regular matching subunit is used for matching the NVMe equipment with the new NVMe equipment by using the universal unique identification code uuid in a regular matching mode to obtain a matching result.
Further, after the migration result determining unit, the virtual machine data migration apparatus further includes:
and the virtual device enabling unit is used for re-enabling the virtual machine based on the new NVMe device when the virtual machine migration completion is detected.
Further, before the virtualization software migration module 63, the virtual machine data migration apparatus further includes:
and the hot plug message shielding module is used for shielding the hot plug message of the NVMe equipment according to the virtual equipment and setting the NVMe equipment to be offline.
It is emphasized that to further ensure the privacy and security of the NVMe devices, the NVMe devices may also be stored in a node of a blockchain.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 7 includes a memory 71, and a network interface 73, which are communicatively connected to each other via a system bus. It is noted that only a computer device 7 having three components memory 71, network interface 73 is shown, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 71 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 71 may be an internal storage unit of the computer device 7, such as a hard disk or a memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 7. Of course, the memory 71 may also comprise both an internal storage unit of the computer device 7 and an external storage device thereof. In this embodiment, the memory 71 is generally used for storing an operating system installed in the computer device 7 and various types of application software, such as program codes of a migration method of virtual machine data. Further, the memory 71 may also be used to temporarily store various types of data that have been output or are to be output.
The network interface 73 may comprise a wireless network interface or a wired network interface, and the network interface 73 is typically used to establish a communication connection between the computer device 7 and other electronic devices.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing a server maintenance program, where the server maintenance program is executable by at least one processor to cause the at least one processor to perform the steps of the migration method of virtual machine data as described above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method of the embodiments of the present application.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (10)
1. A migration method of virtual machine data is characterized by comprising the following steps:
after a message of virtual machine data migration is detected, virtualizing a remote storage device into an NVMe device through a source host, and transmitting the NVMe device to the virtual machine;
after the virtual machine receives the NVMe equipment, virtual equipment is established through a virtual middle layer;
when the NVMe equipment is detected to be offline, migrating the virtualization software through the virtual equipment;
when the completion of the migration of the virtualization software is detected, connecting new NVMe equipment to a target end virtual machine, and transmitting the new NVMe equipment to the target end virtual machine;
in a virtual layer of the target end virtual machine, matching the NVMe equipment with the new NVMe equipment to obtain a matching result, and determining that the data migration of the virtual machine is completed when the matching result is consistent.
2. The method for migrating virtual machine data according to claim 1, wherein after detecting a message of virtual machine migration, virtualizing, by a source host, a remote storage device as an NVMe device, and transmitting the NVMe device to the virtual machine includes:
when detecting that the control node acquires the message of virtual machine migration, judging whether a virtual operating system simulator QEMU supports the NVMe equipment;
if the judgment result is that the virtual operating system simulator QEMU supports the NVMe equipment, virtualizing remote storage equipment into the NVMe equipment through the virtual operating system simulator QEMU;
and transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
3. The method for migrating virtual machine data according to claim 1, wherein in a virtual layer of the target-side virtual machine, a matching result is obtained by matching the NVMe device with the new NVMe device, and when the matching result is consistent, the virtual machine data migration completion includes:
in a virtual layer of the target end virtual machine, after the new NVMe equipment is detected to be on-line, obtaining a universal unique identification code uuid of the new NVMe equipment;
acquiring a universal unique identifier uuid of the NVMe equipment, and performing universal unique identifier uuid matching on the NVMe equipment and the new NVMe equipment to obtain a matching result;
and if the NVMe equipment is consistent with the universal unique identification code uuid of the new NVMe equipment in the matching result, judging that the data migration of the virtual machine is finished.
4. The virtual machine data migration method according to claim 3, wherein the obtaining of the universal unique identifier uuid of the NVMe device, and the performing of universal unique identifier uuid matching on the NVMe device and a new NVMe device, to obtain a matching result includes:
acquiring a universal unique identification code uuid of the NVMe equipment;
and matching the NVMe equipment with the new NVMe equipment by using the universal unique identification code uuid in a regular matching mode to obtain a matching result.
5. The method for migrating the virtual machine data according to claim 3, wherein if the NVMe device is consistent with the unique universal identifier uuid of the new NVMe device in the matching result, after the virtual machine data migration is determined to be completed, the method further comprises:
when the virtual machine migration is detected to be completed, re-enabling the virtual machine based on the new NVMe device.
6. The virtual machine data migration method according to any one of claims 1 to 5, wherein after detecting that the NVMe device is offline, before migrating virtualization software through the virtual device, the method further comprises:
and according to the virtual equipment, shielding the hot plug message of the NVMe equipment, and setting the NVMe equipment to be offline.
7. An apparatus for migrating virtual machine data, comprising:
the virtual machine migration management system comprises an NVMe device creating module, a virtual machine migration management module and a virtual machine migration management module, wherein the NVMe device creating module is used for virtualizing remote storage equipment into NVMe devices through a source host and transmitting the NVMe devices to the virtual machine after detecting a message of virtual machine migration;
the virtual equipment creating module is used for creating virtual equipment through a virtual middle layer after the virtual machine receives the NVMe equipment;
the virtual software migration module is used for migrating virtual software through the virtual equipment after the NVMe equipment is detected to be offline;
the new NVMe device module is used for connecting a new NVMe device to the target end virtual machine and transmitting the new NVMe device to the target end virtual machine after the completion of the migration of the virtualization software is detected;
and the matching result acquisition module is used for matching the NVMe equipment with the new NVMe equipment in a virtual layer of the target-end virtual machine to obtain a matching result, and when the matching result is consistent, determining that the data migration of the virtual machine is completed.
8. The virtual machine data migration apparatus according to claim 7, wherein the NVMe device creation module includes:
the judging unit is used for judging whether a virtual operating system simulator QEMU supports the NVMe equipment or not after detecting that the control node acquires the message of virtual machine migration;
the virtual unit is used for virtualizing the remote storage device into the NVMe device through the virtual operating system simulator QEMU if the judgment result indicates that the virtual operating system simulator QEMU supports the NVMe device;
and the transmission unit is used for transmitting the NVMe equipment to the virtual machine in a virtual machine network card transparent transmission mode.
9. A computer device comprising a memory having stored therein a computer program and a processor that, when executing the computer program, implements the method of migrating virtual machine data according to any of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, implements the migration method of virtual machine data according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010930282.0A CN112099916B (en) | 2020-09-07 | 2020-09-07 | Virtual machine data migration method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010930282.0A CN112099916B (en) | 2020-09-07 | 2020-09-07 | Virtual machine data migration method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112099916A CN112099916A (en) | 2020-12-18 |
CN112099916B true CN112099916B (en) | 2022-06-24 |
Family
ID=73750698
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010930282.0A Active CN112099916B (en) | 2020-09-07 | 2020-09-07 | Virtual machine data migration method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112099916B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113918284B (en) * | 2021-10-13 | 2022-08-02 | 江苏安超云软件有限公司 | Method and device for cloud host batch migration, electronic equipment and storage medium |
CN116257276B (en) * | 2023-05-09 | 2023-07-25 | 珠海星云智联科技有限公司 | Virtual host machine user back-end upgrading method supporting virtualized hardware acceleration |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201543225A (en) * | 2014-05-02 | 2015-11-16 | Cavium Inc | Systems and methods for supporting hot plugging of remote storage devices accessed over a network via NVMe controller |
CN111506386A (en) * | 2020-02-27 | 2020-08-07 | 平安科技(深圳)有限公司 | Virtual machine online migration method, device, equipment and computer readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9501245B2 (en) * | 2014-05-02 | 2016-11-22 | Cavium, Inc. | Systems and methods for NVMe controller virtualization to support multiple virtual machines running on a host |
-
2020
- 2020-09-07 CN CN202010930282.0A patent/CN112099916B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201543225A (en) * | 2014-05-02 | 2015-11-16 | Cavium Inc | Systems and methods for supporting hot plugging of remote storage devices accessed over a network via NVMe controller |
CN111506386A (en) * | 2020-02-27 | 2020-08-07 | 平安科技(深圳)有限公司 | Virtual machine online migration method, device, equipment and computer readable storage medium |
Non-Patent Citations (1)
Title |
---|
"基于KVM的虚拟机在线迁移策略研究";李子钰;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20200115;第I137-21页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112099916A (en) | 2020-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI608363B (en) | Architectural mode configuration | |
US9870248B2 (en) | Page table based dirty page tracking | |
US9858102B2 (en) | Data path failover method for SR-IOV capable ethernet controller | |
US20150317088A1 (en) | Systems and methods for nvme controller virtualization to support multiple virtual machines running on a host | |
US11210132B2 (en) | Virtual machine migration in virtualization environment having different virtualization systems | |
CN111988230B (en) | Virtual machine communication method, device and system and electronic equipment | |
WO2021169129A1 (en) | Virtual machine online migration method and apparatus, device, and computer readable storage medium | |
US8813071B2 (en) | Storage reclamation systems and methods | |
US10367688B2 (en) | Discovering changes of network interface controller names | |
CN112099916B (en) | Virtual machine data migration method and device, computer equipment and storage medium | |
CN110968392B (en) | Method and device for upgrading virtualized simulator | |
CN113312141B (en) | Computer system, storage medium and method for offloading serial port simulation | |
CN105700944A (en) | Online migration method and device for virtual machine not in shared storage condition | |
CN113312140A (en) | Virtual trusted platform module | |
US11321077B1 (en) | Live updating of firmware behavior | |
US10467078B2 (en) | Crash dump extraction of guest failure | |
WO2017045272A1 (en) | Virtual machine migration method and device | |
US11144326B2 (en) | System and method of initiating multiple adaptors in parallel | |
CN104199716A (en) | Virtual machine thermal migration method, physical host and system | |
CN113946854A (en) | File access control method and device and computer readable storage medium | |
CN103019847A (en) | Method and system for migrating data of virtual machine | |
US20200167181A1 (en) | Managing related devices for virtual machines utilizing shared device data | |
CN102622245B (en) | Virtual machine automatic-starting control method under sun4v architecture | |
CN116069584A (en) | Extending monitoring services into trusted cloud operator domains | |
US10740021B1 (en) | Systems and methods for recovery of computing environments via a replication solution |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |