CN109739618A - Virtual machine migration method and device - Google Patents

Virtual machine migration method and device Download PDF

Info

Publication number
CN109739618A
CN109739618A CN201811505526.XA CN201811505526A CN109739618A CN 109739618 A CN109739618 A CN 109739618A CN 201811505526 A CN201811505526 A CN 201811505526A CN 109739618 A CN109739618 A CN 109739618A
Authority
CN
China
Prior art keywords
virtual machine
host
virtualization
trawl performance
queue
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.)
Granted
Application number
CN201811505526.XA
Other languages
Chinese (zh)
Other versions
CN109739618B (en
Inventor
钟晋明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201811505526.XA priority Critical patent/CN109739618B/en
Publication of CN109739618A publication Critical patent/CN109739618A/en
Application granted granted Critical
Publication of CN109739618B publication Critical patent/CN109739618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The disclosure provides a kind of virtual machine migration method and device, pass through configuration combination transmitting-receiving queue in the hardware virtualization trawl performance and half virtualization trawl performance in the first host, when the first host is switched to transition state, the memory information of first virtual machine is synchronized in the second virtual machine, the first virtual machine carries out the interaction of I/O data by the combination transmitting-receiving queue of half virtualization trawl performance and the half virtualization driving network interface card of SR-IOV NIC in entire transition process.The disclosure can automatically complete the switching of transition state in driving side without binding software as a result, be conducive to subsequent O&M, while either under transition state or higher forwarding performance can be kept under non-migrating state.

Description

Virtual machine migration method and device
Technical field
This disclosure relates to field of cloud computer technology, in particular to a kind of virtual machine migration method and device.
Background technique
SR-IOV (Single-Root I/O Virtualization, single I/O virtualization) technology allows in virtual machine Between efficiently shared PCIe (Peripheral Component Interconnect Express, the interconnection of fast peripheral component are total Line) equipment, so that the equipment for directly allowing VM (Virtual Machine, virtual machine) to use host, is obtained higher by hardware I/O performance.
SR-IOV NIC (Network Interface Card, network interface card) generally defines a PF (Physical Function, physical function) and several VF (Virtual Function, virtual functions), PF and VF can make For the use of individual network interface card, VF generally passes through PCIe Signal Transparent Transmission Technology and hardware is transparent in virtual machine, can in this way in virtual machine Directly to access the hardware register of VF.However, since SR-IOV VF network interface card is the physical network card function of PCIe, if the SR- IOV VF network interface card can make virtual client that can not carry out dynamic migration always situated in virtual client.
Summary of the invention
In order to overcome above-mentioned deficiency in the prior art, the disclosure be designed to provide a kind of virtual machine migration method and Device, to solve or improve the above problem.
To achieve the goals above, the embodiment of the present disclosure the technical solution adopted is as follows:
In a first aspect, the disclosure provides a kind of virtual machine migration method, applied to communicated to connect with the second host One host, first host and second host include single I/O virtualized network interfaces card SR-IOV NIC, The SR-IOV NIC includes hardware virtualization driving network interface card and half virtualization driving network interface card, which comprises
After receiving virtual machine (vm) migration instruction, the configuration information of the first virtual machine to be migrated is sent to described second Host, so that second host creates the second virtual machine according to the configuration information, and matches for second virtual machine Set hardware virtualization trawl performance and half virtualization trawl performance;
When second virtual machine is completed to configure, the current operating conditions of first virtual machine are switched to migration shape State, wherein under the transition state, the half virtualization trawl performance of the first virtual machine operation by described half to virtualize The combination transmitting-receiving queue of trawl performance and the half virtualization driving network interface card of the SR-IOV NIC carry out the interaction of I/O data;
Second host is sent by the memory information of first virtual machine, so that second host is by institute The memory information for stating the first virtual machine is synchronized in second virtual machine.
Second aspect, the embodiment of the present disclosure also provide a kind of virtual machine migration method, are applied to receive the first host institute Second host of the first virtual machine of migration, first host and second host include single I/O virtualization Network interface card SR-IOV NIC, the SR-IOV NIC include that hardware virtualization driving network interface card and half virtualization drive network interface card, The described method includes:
Receive the configuration of the first virtual machine to be migrated sent after first host is instructed according to virtual machine (vm) migration Information;
The second virtual machine is created according to the configuration information, and is driven for the second virtual machine configuration hardware virtualization network interface card Dynamic and half virtualization trawl performance, so that first host is when second virtual machine is completed to configure, by described first The current operating conditions of virtual machine are switched to transition state, wherein under the transition state, first virtual machine passes through fortune Row half virtualizes trawl performance with the combination transmitting-receiving queue by the half virtualization trawl performance with the SR-IOV NIC's Half virtualization driving network interface card carries out the interaction of I/O data;
Receive the memory information for first virtual machine that first host is sent, and by first virtual machine Memory information is synchronized in second virtual machine.
The third aspect, the embodiment of the present disclosure also provide a kind of virtual machine migration method, are applied to communication connection between each other The first host and the second host, first host and second host include single I/O virtualization network Interface card SR-IOV NIC, the SR-IOV NIC include that hardware virtualization driving network interface card and half virtualization drive network interface card, described Method includes:
First host is after receiving virtual machine (vm) migration instruction, by the configuration information of the first virtual machine to be migrated It is sent to second host;
Second host creates the second virtual machine according to the configuration information, and hard for second virtual machine configuration Part virtualizes trawl performance and half virtualization trawl performance;
When second virtual machine is completed to configure, first host is by the current operation shape of first virtual machine State is switched to transition state, and sends second place for the memory information of first virtual machine under the transition state Host, wherein under the transition state, first virtual machine is by half virtualization trawl performance of operation to pass through described half Half virtualization driving network interface card of the combination transmitting-receiving queue and the SR-IOV NIC that virtualize trawl performance carries out the friendship of I/O data Mutually;
The memory information of first virtual machine is synchronized in second virtual machine by second host.
Fourth aspect, the embodiment of the present disclosure also provide a kind of virtual machine (vm) migration device, are applied to communicate with the second host First host of connection, first host and second host include single I/O virtualized network interfaces card SR- IOV NIC, the SR-IOV NIC include hardware virtualization driving network interface card and half virtualization driving network interface card, and described device includes:
Configuration information sending module, for receive virtual machine (vm) migration instruction after, by the first virtual machine to be migrated Configuration information is sent to second host, so that second host is virtual according to configuration information creation second Machine, and be the second virtual machine configuration hardware virtualization trawl performance and half virtualization trawl performance;
First switching module is used for when second virtual machine is completed to configure, by the current fortune of first virtual machine Row state is switched to transition state, wherein under the transition state, first virtual machine passes through half virtualization network interface card of operation Driving is to pass through half virtualization driving net of the combination transmitting-receiving queue of the half virtualization trawl performance and the SR-IOV NIC Card carries out the interaction of I/O data;
Memory information sending module, for sending second host for the memory information of first virtual machine, So that the memory information of first virtual machine is synchronized in second virtual machine by second host.
5th aspect, the embodiment of the present disclosure also provide a kind of virtual machine (vm) migration device, are applied to receive the first host institute Second host of the first virtual machine of migration, first host and second host include single I/O virtualization Network interface card SR-IOV NIC, the SR-IOV NIC include that hardware virtualization driving network interface card and half virtualization drive network interface card, Described device includes:
Configuration information receiving module, for receive sent after first host is instructed according to virtual machine (vm) migration wait move The configuration information of the first virtual machine moved;
Creation module, for creating the second virtual machine according to the configuration information, and it is hard for second virtual machine configuration Part virtualizes trawl performance and half virtualization trawl performance, so that first host is completed to configure in second virtual machine When, the current operating conditions of first virtual machine are switched to transition state, wherein under the transition state, described One virtual machine receives and dispatches queue and institute by half virtualization trawl performance of operation with the combination by the half virtualization trawl performance The half virtualization driving network interface card for stating SR-IOV NIC carries out the interaction of I/O data;
Memory information receiving module, for receiving the memory letter for first virtual machine that first host is sent Breath, and the memory information of first virtual machine is synchronized in second virtual machine.
6th aspect, the embodiment of the present disclosure also provide a kind of server, and the server includes:
Storage medium;
Processor;And
Above-mentioned virtual machine (vm) migration device, the virtual machine (vm) migration device are stored in the storage medium and including by institute State the computer executable instructions of processor execution.
7th aspect, the embodiment of the present disclosure also provide a kind of readable storage medium storing program for executing, are stored in the readable storage medium storing program for executing Computer program, the computer program, which is performed, realizes above-mentioned virtual machine migration method.
In terms of existing technologies, the disclosure has the advantages that
The virtual machine migration method and device that the disclosure provides, pass through the hardware virtualization trawl performance in the first host It is virtual by first when the first host is switched to transition state with configuration combination transmitting-receiving queue in half virtualization trawl performance The memory information of machine is synchronized in the second virtual machine, and the first virtual machine passes through half virtualization trawl performance in entire transition process Combination transmitting-receiving queue and SR-IOV network interface card half virtualization driving network interface card carry out I/O data interaction.The disclosure is not necessarily to as a result, The switching of transition state can be automatically completed in driving side using binding software, be conducive to subsequent O&M, while either existing Higher forwarding performance under transition state or can be kept under non-migrating state.
To enable the above objects, features, and advantages of the embodiment of the present disclosure to be clearer and more comprehensible, below in conjunction with embodiment, and Cooperate appended attached drawing, elaborates.
Detailed description of the invention
It, below will be to needed in the embodiment attached in order to illustrate more clearly of the technical solution of the embodiment of the present disclosure Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the disclosure, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of application scenarios schematic diagram of common virtual machine migration method;
Fig. 2 is the application scenarios schematic diagram of another common virtual machine migration method;
Fig. 3 is the application scenarios schematic diagram for the virtual machine migration method that the embodiment of the present disclosure provides;
Fig. 4 is a kind of flow diagram for the virtual machine migration method that the embodiment of the present disclosure provides;
Fig. 5 is another flow diagram for the virtual machine migration method that the embodiment of the present disclosure provides
Fig. 6 is a kind of functional block diagram for the first virtual machine (vm) migration device that the embodiment of the present disclosure provides;
Fig. 7 is another functional block diagram for the first virtual machine (vm) migration device that the embodiment of the present disclosure provides;
Fig. 8 is the functional block diagram for the second virtual machine (vm) migration device that the embodiment of the present disclosure provides;
Fig. 9 is another functional block diagram for the second virtual machine (vm) migration device that the embodiment of the present disclosure provides;
Figure 10 is a kind of structure for server for realizing above-mentioned virtual machine migration method that the embodiment of the present disclosure provides Block diagram.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present disclosure, the technical solution in the embodiment of the present disclosure is carried out clear, complete Site preparation description, it is clear that described embodiment is disclosure a part of the embodiment, instead of all the embodiments.Usually herein The component of the embodiment of the present disclosure described and illustrated in place's attached drawing can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiment of the disclosure provided in the accompanying drawings is not intended to limit below claimed The scope of the present disclosure, but be merely representative of the selected embodiment of the disclosure.Based on the embodiment in the disclosure, this field is common Technical staff's all other embodiment obtained without creative efforts belongs to the model of disclosure protection It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
The technical solution of the disclosure in order to better understand first below carries out specifically the host in the disclosure It is bright.
SR-IOV NIC is installed on host, and runs virtualization software layer Hypervisor.Hypervisor can also Referred to as monitor of virtual machine (Virtual Machine Monitor, VMM), for example, Hypervisor can be VMWare ESXi, KVM (Kernel-based Virtual Machine, the virtual machine based on kernel) etc..In addition, host can also wrap It includes: multiple VM.
SR-IOV NIC can be understood as the network interface card using SR-IOV technology.SR-IOV technology is that one kind is not required to Want virtualization software simulation that can share the physical function of the port I/O of I/O (Input/Output, input/output) equipment Method, a series of VF of I/O equipment physical ports can be created by the technology.Wherein, each VF can with it is right with it The VM answered carries out direct mode operation, therefore the performance close to the machine may be implemented.Generally speaking, SR-IOV is realized PCIe Function distribution shares the resource of a device PCI to multiple virtual interfaces in virtualized environment, so that network transmission can be with VM is assigned directly to around Hypervisor, this reduces the I/O performance costs in Hypervisor.In this way, SR- IOV can provide independent memory space, interruption and DMA (Direct Memory Access, direct memory access) for each VM Stream.SR-IOV introduces two new function types:
Physical function (Physical Function, PF): it supports the PCIe function of SR-IOV extension function, be used to match Set and manage SR-IOV functional characteristic;And
Virtual functions (Virtual Functions, VF): the PCIe function of simplifying, including resource necessary to Data Migration, And the configuration resource set by simplifying with caution.
It as a result, may include: PF and multiple VF in SR-IOV NIC.
In addition, being also integrated with a L2vSwitch (virtual switch) in SR-IOV NIC, which has Basic Layer2 switching function.VF and the L2vSwitch are direct-connected, and VF is equivalent to the port on the L2vSwitch.
It may include: vSwitch and PCI manager in Hypervisor, in addition, being equipped with SR-IOV on Hypervisor The driving of the driver of NIC, referred to as PF.Wherein, PCI manager be used for the pci bus in SR-IOV NIC carry out configuration and Management.
VM refer to by software simulation+hardware auxiliary virtualization have the function of complete hardware system and operate in one it is complete Complete computer in full isolation environment.By VM software, can be simulated on a host another or multiple Virtual computer.Wherein, VM may operate on Hypervisor.Each VM can identify the VF network interface card in SR-IOV NIC It therefore can be by VF driving being installed on each VM to corresponding on SR-IOV NIC for common PCIe device VF network interface card connection, to bypass the vSwitch in Hypervisor.That is, data can be transmitted directly to SR-IOV by VM The upper corresponding VF network interface card of NIC, without the vSwitch being sent in Hypervisor, to bypass the ginseng of Hypervisor With.
On the basis of foregoing description, the process of VM received data packet are as follows: when data packet is sent to SR-IOV NIC, meeting It is sent to L2vSwitch to be classified and exchanged, corresponding VF network interface card is determined according to the destination address of the data packet, thus will The data forward a packet to determining VF network interface card, and VF network interface card initiates dma operation and pass to the data packet to connect with the VF network interface card VM.The process of VM transmission data packet are as follows: VM delivers a packet to the corresponding VF network interface card of SR-IOVNIC, to pass through the VF net Card sends data packet.
The technical issues of knowing such as aforementioned background art, the disclosed invention people have found above-mentioned currently used for solving after study The technical solution of technical problem includes following two:
The first scheme: please referring to application scenarios shown in FIG. 1, in the application scenarios, the first host 100 and second Host 200 includes SR-IOV NIC, and SR-IOV NIC operation has SR-IOV VF network interface card and SR-IOV PF network interface card, and first is empty Quasi- machine configuration is in the first host 100, and in the second host 200, the first virtual machine configuration has the second virtual machine configuration Virtio-net driving and SR-IOV VF driving.When implementing, the first virtual machine can be by binding the active and standby mould of software configuration Formula, for example, under main-use mode bind SR-IOV VF network interface card information (such as MAC Address, IP address etc.), in standby mode Bind the information (such as MAC Address, IP address etc.) of SR-IOVPF network interface card.In this way, when the first virtual machine operates normally, binding Be SR-IOV VF network interface card information, then by SR-IOV VF driving with SR-IOV VF network interface card complete I/O data interaction.When When first virtual machine needs to move in the second host 200, binding be SR-IOV PF network interface card information, then pass through Virtio-net driving completes I/O data interaction with SR-IOV PF network interface card.
However, inventor has found that above scheme has the following problems in the course of the research:
The SR-IOV PF network interface card of first, SR-IOV NIC only can just play work in the transition process of the first virtual machine With occupying physical function resource.
Second, in the transition process of the first virtual machine, I/O is carried out with SR-IOVPF network interface card by Virtio-net driving Data interaction, transmitting-receiving performance is low, causes the cutout time long.
Third, by the way of binding software, for different operating system, order, tool are different, it is difficult to carry out standard Change operation, is unfavorable for subsequent O&M.
Second scheme: please referring to application scenarios shown in Fig. 2, in the application scenarios, the first host 100 and second Host 200 includes SR-IOV NIC, and SR-IOV NIC operation has Vhost-User network interface card, and the first virtual machine configuration is first In host 100, for the second virtual machine configuration in the second host 200, the first virtual machine configuration has Virtio-net driving.
In above scheme, the first virtual machine can drive the Vhost-User net with SR-IOV NIC by Virtio-net Card carries out the interaction of I/O data, the zero-copy of data packet on from the first virtual machine to the first host 100 may be implemented, relatively The mode for carrying out I/O data interaction with SR-IOV PF network interface card in Virtio-net driving, improves I/O performance, in addition, the party Case is not related to SR-IOV VF, can support the thermophoresis of the first virtual machine.
However, inventor has found in the course of the research, although above scheme supports thermophoresis, usually, heat is moved Number and duration are moved compared with normal condition, accounting is seldom, and in normal state, the I/ realized using the above scheme O performance is relative to still lower in such a way that I/O data interaction is completed in SR-IOVVF driving with SR-IOV VF network interface card.For example, In normal condition, carry out to sacrifice a part of performance using the above scheme when I/O data interaction as program processing, so I/O performance is still below SR-IOV VF mode.That is, above scheme is by sacrificing the I/O under a part of normal condition Performance come make the first host 100 support thermophoresis.
Discovery based on above-mentioned technical problem, the disclosed invention people propose that following technical proposals are above-mentioned to solve or improve Problem.In detail, pass through configuration group in the hardware virtualization trawl performance and half virtualization trawl performance in the first host 100 Transmitting-receiving queue is closed, when the first host 100 is switched to transition state, the memory information of the first virtual machine is synchronized to the second void In quasi- machine, the first virtual machine receives and dispatches queue and SR-IOV by the combination of half virtualization trawl performance in entire transition process The half virtualization driving network interface card of NIC carries out the interaction of I/O data.The disclosure can drive as a result, without binding software Side automatically completes the switching of transition state, is conducive to subsequent O&M, while either under transition state or in non-migrating Higher forwarding performance can be kept under state.
It should be noted that defect present in the above scheme in the prior art, is inventor by practicing simultaneously It is being obtained after carefully studying as a result, therefore, the discovery procedure of the above problem and the hereinafter embodiment of the present disclosure are asked for above-mentioned Itd is proposed solution is inscribed, all should be the contribution that inventor makes the disclosure.
The application scenarios for the virtual machine migration method that the embodiment of the present disclosure provides are referring to Fig. 3, in the application scenarios, and the One host 100 and the second host 200 include SR-IOV NIC, SR-IOV NIC include hardware virtualization driving network interface card and Half virtualization driving network interface card, for the first virtual machine configuration in the first host 100, the first virtual machine configuration has hardware virtualization net Card driving and half virtualization trawl performance.
In the embodiments of the present disclosure, hardware virtualization driving network interface card can be SR-IOV VF network interface card, half virtualization driving net Card can be Vhost-User network interface card, and hardware virtualization trawl performance can be SR-IOV VF driving, and half virtualizes trawl performance It can be Virtio-net driving.
Wherein, combination transmitting-receiving queue, the combination are configured in hardware virtualization trawl performance and half virtualization trawl performance The virtual input and output ring of trawl performance can be virtualized by the VF queue of hardware virtualization trawl performance and half by receiving and dispatching queue Unified be abstracted of Virtio-ring obtains, and combination transmitting-receiving queue is allowed to have VF queue and the function of Virtio-ring simultaneously Energy.
As an implementation, the combination transmitting-receiving queue can generate in the following manner: firstly, it is empty to obtain hardware The queue parameter (such as the hardware virtualization of SR-IOV VF driving drives parameter) of the virtual functions VF queue of quasi-ization trawl performance The address of every I/O memory block in the virtual i/o ring Virtio-ring for virtualizing trawl performance with half, and according to the VF team The address of every I/O memory block generates the VF queue and Virtio-ring in the queue parameter of column and the Virtio-ring Queue union, and using the queue union as the combination receive and dispatch queue.It is cut as a result, from hardware virtualization trawl performance When changing to half virtualization trawl performance, or being switched to hardware virtualization trawl performance from half virtualization trawl performance, due to group Virtio-ring and VF queue can be indicated simultaneously by closing transmitting-receiving queue, and there is no need to unload original driving to can be completed and smoothly cut It changes.Wherein, Virtio-ring and VF queue can be used for providing communication for the communication of the first virtual machine and SR-IOV network interface card both sides Channel.
Virtual machine migration method shown in Fig. 4 is described in detail below with reference to application scenarios shown in Fig. 3, this is virtual Machine moving method first host 100 as shown in Fig. 3 executes.It should be appreciated that in other embodiments, the void of the present embodiment The sequence of quasi- machine moving method part step can be exchanged with each other according to actual needs or part steps therein can also To omit or delete.The detailed step of the virtual machine migration method is described below.
Step S110 sends the configuration information of the first virtual machine to be migrated after receiving virtual machine (vm) migration instruction.
In the present embodiment, the first host 100 can be instructed after receiving virtual machine (vm) migration instruction from virtual machine (vm) migration The middle virtual machine information for obtaining the first virtual machine to be migrated in the first host 100 and first virtual machine needs move to The second host 200 host information.Wherein, virtual machine information may include the virtual machine title or void of the first virtual machine Quasi- machine address (such as IP address, MAC Address), host information may include address information (such as the IP of the second host 200 Location, MAC Address).
Then, the first host 100 can obtain the configuration information of the first virtual machine according to virtual machine information, should match confidence Breath may include the network configuration information of the first virtual machine, such as may include hardware virtualization trawl performance and half virtualization net Block the configuration information of driving.
Finally, the first host 100 can send configuration information to the second host 200 according to host information.For example, First host 100 can search the communication port of the second host 200 according to host information, and according to the communication ends found Mouth sends configuration information to the second host 200.
Later, the second host 200 can according to configuration information create the second virtual machine, and for the second virtual machine configuration with The identical hardware virtualization trawl performance of first virtual machine and half virtualization trawl performance, after configuration is complete to the first host 100 send the first feedback information.
The current operating conditions of first virtual machine are switched to transition state by step S120.
In the present embodiment, the first host 100 has determined the second host 200 after receiving the first feedback information The configuration of the second virtual machine is completed, next then judges whether the current operating conditions of the first virtual machine are non-migrating state (Hard state).
Wherein, the first virtual machine runs hardware virtualization trawl performance under Hard state to pass through hardware virtualization net The combination transmitting-receiving queue of card driving and the hardware virtualization driving network interface card of SR-IOV NIC carry out the interaction of I/O data.For example, the One virtual machine can run SR-IOV VF and drive and pass through combination transmitting-receiving queue and SR-IOV NIC in SR-IOV VF driving SR-IOV VF network interface card carry out I/O data interaction.For sending data packet, the first virtual machine is by data packet to be sent It is written in the combination transmitting-receiving queue of SR-IOV VF driving, SR- is sent data packets to by the VF queue in combination transmitting-receiving queue In the SR-IOV VF network interface card of IOV NIC, SR-IOV VF network interface card delivers a packet to destination.
If it is determined that the current operating conditions of the first virtual machine are Hard state, then by the current operation shape of the first virtual machine State is switched to interim transition state PrepareSoft state, and under PrepareSoft state, currently transports from the first virtual machine The VF number of queues for carrying out I/O data interaction is obtained in the combination transmitting-receiving queue of capable hardware virtualization trawl performance.Such as Fruit VF number of queues is 0, then current operating conditions is switched to transition state (Soft state) from PrepareSoft state.Such as This can wait VF queue to complete the transmission of all data packets before being switched to transition state, avoid losing number in handoff procedure According to packet.
Before this, the first virtual machine is under Soft state, and half virtualization trawl performance of operation is to pass through half virtualization net The combination transmitting-receiving queue of card driving and the half virtualization driving network interface card of SR-IOV NIC carry out the interaction of I/O data.For example, first Virtual machine can run Virtio-net driving and by the combination transmitting-receiving queue of Virtio-net driving with SR-IOV NIC's Vhost-User drives the interaction of network interface card progress I/O data.For sending data packet, the first virtual machine can will be to be sent Data packet is written in the combination transmitting-receiving queue of Virtio-net driving, will be counted by the Virtio-ring in combination transmitting-receiving queue It is sent in the Vhost-User driving network interface card of SR-IOV NIC according to packet, Vhost-User driving network interface card delivers a packet to mesh End.
Step S130 sends the memory information of the first virtual machine to the second host 200.
In the present embodiment, the second host 200 is after the memory information for receiving the first virtual machine, by the first virtual machine Memory information is synchronized in the second virtual machine.
Based on above-mentioned design, under transition state, the Vhost- with SR-IOV NIC can be driven by Virtio-net User network interface card carries out the interaction of I/O data, and zero that data packet on from the first virtual machine to the first host 100 may be implemented copies Shellfish carries out the mode of I/O data interaction with SR-IOV PF network interface card relative to Virtio-net driving, improves I/O performance.? Under non-migrating state, it can be driven by SR-IOV VF and complete I/O data interaction with SR-IOV VF network interface card, relative to passing through The Vhost-User network interface card of Virtio-net driving and SR-IOV NIC carry out the mode of the interaction of I/O data, also improve I/O Performance.The present embodiment compared to existing technologies, or can under non-migrating state either under transition state as a result, Enough keep higher forwarding performance.In addition, in transition process, the present embodiment without using arriving SR-IOV PF network interface card, without The switching of transition state can be automatically completed in driving side using binding software, be conducive to subsequent O&M.
Further referring to Fig. 5, after the memory information of the first virtual machine is synchronized to the second virtual machine, the second host 200 send the second feedback information to the first host 100, and on this basis, virtual machine migration method can also include following step It is rapid:
Step S140, the first virtual machine of operation suspension send third feedback information to the second host 200.
In the present embodiment, the first host 100 has determined the second host 200 after receiving the second feedback information Through the memory information of the first virtual machine is synchronized in the second virtual machine, following then the first virtual machine of operation suspension, and send Third feedback information is to the second host 200.
Second host 200 determines that the first virtual machine has timed out operation, connects down after receiving third feedback information Then to open the second virtual machine, and the current operating conditions of the second virtual machine are switched to non-migrating state (Hard state).In detail Carefully, the second virtual machine runs hardware virtualization trawl performance according to hardware virtualization trawl performance under Hard state The hardware virtualization driving network interface card of combination transmitting-receiving queue and SR-IOV NIC carry out the interaction of I/O data.
As an implementation, the current operating conditions of the second virtual machine are switched to non-migrating by the second host 200 The specific implementation of state can be with are as follows: judges whether current operating conditions are Soft state, if current operating conditions are Current operating conditions are then switched to interim non-migrating state (PrepareHard state), in PrepareHard by Soft state Under state, is obtained from the combination transmitting-receiving queue of the currently running half virtualization trawl performance of the second virtual machine and carrying out I/O The virtual i/o ring Virtio-ring quantity of data interaction, if Virtio-ring quantity be 0, by current operating conditions from Interim non-migrating state is switched to non-migrating state.
In this way, Virtio-ring can be waited to complete the transmission of all data packets, kept away before being switched to non-migrating state Exempt from lost data packets in handoff procedure.
Further, still eferring to Fig. 4, the stream of another virtual machine migration method of embodiment of the present disclosure offer is shown Journey schematic diagram.Unlike above example, virtual machine migration method provided in this embodiment is held by the second host 200 Row, it is to be understood that involved in the virtual machine migration method next to be described the step of has retouched in the examples above It stated, the exhaustive of specific each step can refer to above embodiment description, only execute step to the second host 200 below Suddenly it is briefly described.
Step S210 creates the second virtual machine according to configuration information, and is the second virtual machine configuration hardware virtualization network interface card Driving and half virtualization trawl performance.
In the present embodiment, the second host 200 is sent after receiving the first host 100 and being instructed according to virtual machine (vm) migration The first virtual machine to be migrated configuration information after, the second virtual machine is created according to configuration information, and match for the second virtual machine Set hardware virtualization trawl performance and half virtualization trawl performance.
Second host 200 sends the first feedback information when the second virtual machine is completed to configure, to the first host 100, The current operating conditions of first virtual machine are switched to transition state by the first host 100, wherein under transition state, first Queue and SR-IOV are received and dispatched in the combination that virtual machine passes through half virtualization trawl performance by half virtualization trawl performance of operation The half virtualization driving network interface card of NIC carries out the interaction of I/O data.
Then, the memory information of the first virtual machine is sent to the second host 200 by the first host 100.
The memory information of first virtual machine is synchronized in the second virtual machine by step S220.
Further, referring to Fig. 5, after the memory information of the first virtual machine is synchronized to the second virtual machine, the second place Host 200 sends the second feedback information to the first host 100, and the first host 100 is after receiving the second feedback information, i.e., It determines that the memory information of the first virtual machine is synchronized in the second virtual machine by the second host 200, next then suspends fortune The first virtual machine of row, and third feedback information is sent to the second host 200.
Step S230 opens the second virtual machine, and the current operating conditions of the second virtual machine is switched to non-migrating state.
Second host 200 determines that the first virtual machine has timed out operation, connects down after receiving third feedback information Then to open the second virtual machine, and the current operating conditions of the second virtual machine are switched to non-migrating state (Hard state).In detail Carefully, the second virtual machine runs hardware virtualization trawl performance according to hardware virtualization trawl performance under Hard state The hardware virtualization driving network interface card of combination transmitting-receiving queue and SR-IOV NIC carry out the interaction of I/O data.
Further, still eferring to Fig. 4, the flow diagram of another virtual machine migration method is shown.With reality above It applies unlike example, virtual machine migration method provided in this embodiment is by 100 He of the first host that communicates to connect between each other Second host 200 executes, it is to be understood that above the step of involved in the virtual machine migration method next to be described It is had been noted above in embodiment, the exhaustive of specific each step can refer to above embodiment description.
Step S110, the first host 100 is after receiving virtual machine (vm) migration instruction, by the first virtual machine to be migrated Configuration information is sent to the second host 200.
Step S210, the second host 200 create the second virtual machine according to configuration information, and hard for the second virtual machine configuration Part virtualizes trawl performance and half virtualization trawl performance.
When the second virtual machine is completed to configure, the second host 200 sends the first feedback information to the first host 100, First host 100 executes after receiving the first feedback information:
Step S120, the current operating conditions of the first virtual machine are switched to transition state by the first host 100, and are being moved It is executed under shifting state:
The memory information of the first virtual machine is sent the second host 200 by step S130.
Wherein, under transition state, the first virtual machine passes through half virtualization net by half virtualization trawl performance of operation The combination transmitting-receiving queue of card driving and the half virtualization driving network interface card of SR-IOV NIC carry out the interaction of I/O data.
The memory information of first virtual machine is synchronized in the second virtual machine by step S220, the second host 200.
Further, referring to Fig. 6, the embodiment of the present disclosure also provides a kind of first virtual machine (vm) migration device 300, this first The function that virtual machine (vm) migration device 300 is realized can correspond to the step for the virtual machine migration method that above-mentioned first host 100 executes Suddenly.The first virtual machine (vm) migration device 300 can be understood as the processing of above-mentioned first host 100 or the first host 100 Device, it is understood that realize this under the control of the first host 100 independently of except above-mentioned first host or processor The component of maniflest function.As shown in fig. 6, the first virtual machine (vm) migration device 300 may include configuration information sending module 310, One switching module 320 and memory information sending module 330, next to each function mould of the first virtual machine (vm) migration device 300 Block is described in detail.
Configuration information sending module 310 can be used for after receiving virtual machine (vm) migration instruction, empty by be migrated first The configuration information of quasi- machine is sent to the second host 200, so that the second host 200 is virtual according to configuration information creation second Machine, and be the second virtual machine configuration hardware virtualization trawl performance and half virtualization trawl performance.It is appreciated that the configuration information Sending module 310 can be used for executing above-mentioned steps S110, and the detailed implementation about the configuration information sending module 310 can With referring to above-mentioned to the related content of step S110.
First switching module 320 can be used for when the second virtual machine is completed to configure, by the current operation of the first virtual machine State is switched to transition state, wherein under transition state, the first virtual machine is by half virtualization trawl performance of operation to pass through The combination transmitting-receiving queue of half virtualization trawl performance and the half virtualization driving network interface card of SR-IOV NIC carry out the friendship of I/O data Mutually.It is appreciated that first switching module 320 can be used for executing above-mentioned steps S120, about first switching module 320 Detailed implementation is referred to above-mentioned to the related content of step S120.
Memory information sending module 330 can be used for sending the second host for the memory information of the first virtual machine 200, so that the memory information of the first virtual machine is synchronized in the second virtual machine by the second host 200.It is appreciated that the memory Information sending module 330 can be used for executing above-mentioned steps S130, the detailed realization side about the memory information sending module 330 Formula is referred to above-mentioned to the related content of step S130.
In a kind of possible embodiment, configuration information sending module 310 specifically can in the following manner will be wait move The configuration information of the first virtual machine moved is sent to the second host 200:
From virtual machine (vm) migration instruction in obtain the virtual machine information of the first virtual machine to be migrated in the first host 100 with And the host information of the second host 200 that first virtual machine needs to move to, it is virtual that first is obtained according to virtual machine information The configuration information of machine sends configuration information to the second host 200 according to host information.
In a kind of possible embodiment, referring to Fig. 7, the first virtual machine (vm) migration device 300 can also include pause Module 340.
Suspend module 340, can be used for after the memory information of the first virtual machine is synchronized to the second virtual machine, pause fortune The first virtual machine of row, so that in the first virtual machine operation suspension, the second host 200 opens the second virtual machine, and by second The current operating conditions of virtual machine are switched to non-migrating state, wherein under non-migrating state, it is empty that the second virtual machine runs hardware Quasi-ization trawl performance by the combination transmitting-receiving queue of hardware virtualization trawl performance and the hardware virtualization of SR-IOV NIC to be driven Dynamic network interface card carries out the interaction of I/O data.It is appreciated that the pause module 340 can be used for executing above-mentioned steps S140, about this The detailed implementation of pause module 340 is referred to above-mentioned to the related content of step S140.
In a kind of possible embodiment, the first switching module 320 specifically can be virtual by first in the following manner The current operating conditions of machine are switched to transition state:
Whether the current operating conditions for judging the first virtual machine are non-migrating state;
If current operating conditions are non-migrating state, current operating conditions are switched to interim transition state;
Half virtualization under interim transition state, from the currently running hardware virtualization trawl performance of the first virtual machine The virtual functions VF number of queues for carrying out I/O data interaction is obtained in the combination transmitting-receiving queue of trawl performance;
If VF number of queues is 0, current operating conditions are switched to transition state from interim transition state.
Further, referring to Fig. 8, the embodiment of the present disclosure also provides a kind of second virtual machine (vm) migration device 400, this second The function that virtual machine (vm) migration device 400 is realized can correspond to the step for the virtual machine migration method that above-mentioned second host 200 executes Suddenly.The second virtual machine (vm) migration device 400 can be understood as the processing of above-mentioned second host 200 or the second host 200 Device, it is understood that for independently of being realized under the control of the second host 200 except above-mentioned second host 200 or processor The component of disclosure function.As shown in figure 8, the second virtual machine (vm) migration device 400 may include configuration information receiving module 410, Creation module 420 and memory information receiving module 430, next to each functional module of the second virtual machine (vm) migration device 400 It is described in detail.
Configuration information receiving module 410, can be used for receiving after the first host 100 is instructed according to virtual machine (vm) migration and sends The first virtual machine to be migrated configuration information.It is appreciated that the configuration information receiving module 410 can be used for executing it is above-mentioned Step S210, the detailed implementation about the configuration information receiving module 410 are referred to above-mentioned related to step S210 Content.
Creation module 420 can be used for creating the second virtual machine according to configuration information, and be the second virtual machine configuration hardware Trawl performance and half virtualization trawl performance are virtualized, so that when the second virtual machine is completed to configure, the first host 100 is by the The current operating conditions of one virtual machine are switched to transition state, wherein under transition state, the first virtual machine is empty by operation half Quasi-ization trawl performance is to pass through half virtualization driving net of the combination transmitting-receiving queue of half virtualization trawl performance and SR-IOV NIC Card carries out the interaction of I/O data.It is appreciated that the creation module 420 can be used for executing above-mentioned steps S210, about the creation The detailed implementation of module 420 is referred to above-mentioned to the related content of step S210.
Memory information receiving module 430 can be used for receiving the memory letter of the first virtual machine of the first host 100 transmission Breath, and the memory information of the first virtual machine is synchronized in the second virtual machine.It is appreciated that the memory information receiving module 430 It can be used for executing above-mentioned steps S220, the detailed implementation about the memory information receiving module 430 is referred to above-mentioned Content related to step S220.
In a kind of possible embodiment, referring to Fig. 9, the second virtual machine (vm) migration device 400 can also include second Switching module 440.
Second switching module 440 can be used in the first virtual machine operation suspension, open the second virtual machine, and by second The current operating conditions of virtual machine are switched to non-migrating state, wherein under non-migrating state, it is empty that the second virtual machine runs hardware Quasi-ization trawl performance by the combination transmitting-receiving queue of hardware virtualization trawl performance and the hardware virtualization of SR-IOV NIC to be driven Dynamic network interface card carries out the interaction of I/O data.It is appreciated that second switching module 440 can be used for executing above-mentioned steps S230, close It is referred in the detailed implementation of second switching module 440 above-mentioned to the related content of step S230.
In a kind of possible embodiment, the second switching module 440 specifically can be virtual by second in the following manner The current operating conditions of machine are switched to non-migrating state:
Judge whether current operating conditions are transition state;
If current operating conditions are transition state, current operating conditions are switched to interim non-migrating state;
Under interim non-migrating state, team is received and dispatched from the combination of the currently running half virtualization trawl performance of the second virtual machine The virtual i/o ring Virtio-ring quantity for carrying out I/O data interaction is obtained in column;
If Virtio-ring quantity is 0, current operating conditions are switched to non-migrating shape from interim non-migrating state State.
Further, referring to Fig. 10, the embodiment of the present disclosure additionally provides one kind for realizing above-mentioned virtual machine (vm) migration side The server 500 of method, in the present embodiment, the server 500 can be made general bus architecture by bus 510 Lai real It is existing.According to the concrete application of server 500 and overall design constraints condition, bus 510 may include that any number of interconnection is total Line and bridge joint.Together by various circuit connections, these circuits include processor 520, storage medium 530 and bus to bus 510 Interface 540.Optionally, server 500 can be used bus interface 540 and connect network adapter 550 etc. via bus 510. Network adapter 550 can be used for realizing the signal processing function of physical layer in server 500, and realize radiofrequency signal by antenna Send and receive.User interface 560 can connect external equipment, such as: keyboard, display, mouse or control stick etc..Always Line 510 can also connect various other circuits, such as timing source, peripheral equipment, voltage regulator or management circuit, this A little circuits are known in the art, therefore are no longer described in detail.
It can replace, server 500 may also be configured to generic processing system, such as be commonly referred to as chip, the general procedure System includes: to provide the one or more microprocessors of processing function, and provide at least part of outer of storage medium 530 Portion's memory, it is all these all to be linked together by external bus architecture and other support circuits.
Alternatively, following realize can be used in server 500: having processor 520, bus interface 540, Yong Hujie The ASIC (specific integrated circuit) of mouth 560;And it is integrated at least part of the storage medium 530 in one single chip, alternatively, Following realize: one or more FPGA (field programmable gate array), PLD (programmable logic device can be used in server 500 Part), controller, state machine, gate logic, discrete hardware components, any other suitable circuit or to be able to carry out the disclosure logical Any combination of the circuit of various functions described in.
Wherein, processor 520 is responsible for management bus 510 and general processing (is stored on storage medium 530 including executing Software).One or more general processors and/or application specific processor can be used to realize in processor 520.Processor 520 Example includes microprocessor, microcontroller, dsp processor and the other circuits for being able to carry out software.It should be by software broadly It is construed to indicate instruction, data or any combination thereof, regardless of being called it as software, firmware, middleware, microcode, hard Part description language or other.
Storage medium 530 is illustrated as separating with processor 520 in Figure 10, however, those skilled in the art be easy to it is bright White, storage medium 530 or its arbitrary portion can be located at except server 500.For example, storage medium 530 may include passing Defeated line, the carrier waveform modulated with data, and/or the computer product that separates with radio node, these media can be by Processor 520 is accessed by bus interface 540.Alternatively, storage medium 530 or its arbitrary portion are desirably integrated into processing In device 520, for example, it may be cache and/or general register.
The processor 520 can be used for executing the virtual machine migration method in the disclosure.
Further, the embodiment of the present disclosure additionally provides a kind of nonvolatile computer storage media, and the computer is deposited Storage media is stored with computer executable instructions, which can be performed the void in above-mentioned any means embodiment Quasi- machine moving method.
In the embodiment provided by the disclosure, it should be understood that disclosed device and method, it can also be by other Mode realize.Device and method embodiment described above is only schematical, for example, flow chart and frame in attached drawing Figure shows the system frame in the cards of the system of multiple embodiments according to the disclosure, method and computer program product Structure, function and operation.In this regard, each box in flowchart or block diagram can represent a module, section or code A part, a part of the module, section or code includes one or more for implementing the specified logical function Executable instruction.It should also be noted that function marked in the box can also be with not in some implementations as replacement It is same as the sequence marked in attached drawing generation.For example, two continuous boxes can actually be basically executed in parallel, they have When can also execute in the opposite order, this depends on the function involved.It is also noted that in block diagram and or flow chart Each box and the box in block diagram and or flow chart combination, can function or movement as defined in executing it is dedicated Hardware based system realize, or can realize using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the disclosure can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It can replace, can be realized wholly or partly by software, hardware, firmware or any combination thereof.When When using software realization, can entirely or partly it realize in the form of a computer program product.The computer program product Including one or more computer instructions.It is all or part of when loading on computers and executing the computer program instructions Ground is generated according to process or function described in the embodiment of the present disclosure.The computer can be general purpose computer, special purpose computer, Computer network or other programmable devices.The computer instruction may be stored in a computer readable storage medium, or Person is transmitted from a computer readable storage medium to another computer readable storage medium, for example, the computer instruction Wired (such as coaxial cable, optical fiber, digital subscriber can be passed through from a web-site, computer, server or data center Line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or data It is transmitted at center.The computer readable storage medium can be any usable medium that computer can access and either wrap The data storage devices such as electronic equipment, server, the data center integrated containing one or more usable mediums.The usable medium It can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid-state Hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, term " including ", " including " or its any other variant are intended to non-row Its property includes, so that the process, method, article or equipment for including a series of elements not only includes those elements, and And further include the other elements being not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that including institute State in the process, method, article or equipment of element that there is also other identical elements.
It is obvious to a person skilled in the art that the present disclosure is not limited to the details of above-mentioned exemplary embodiment, Er Qie Without departing substantially from the disclosure spirit or essential attributes in the case where, can realize the disclosure in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present disclosure is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the disclosure.Any reference signs in the claims should not be construed as limiting the involved claims.

Claims (17)

1. a kind of virtual machine migration method, which is characterized in that applied to the first host communicated to connect with the second host, institute It states the first host and second host includes single I/O virtualized network interfaces card SR-IOV NIC, the SR-IOV NIC includes hardware virtualization driving network interface card and half virtualization driving network interface card, which comprises
After receiving virtual machine (vm) migration instruction, the configuration information of the first virtual machine to be migrated is sent to second host Machine, so that second host creates the second virtual machine according to the configuration information, and hard for second virtual machine configuration Part virtualizes trawl performance and half virtualization trawl performance;
When second virtual machine is completed to configure, the current operating conditions of first virtual machine are switched to transition state, Wherein, under the transition state, the half virtualization trawl performance of the first virtual machine operation is to pass through the half virtualization net The combination transmitting-receiving queue of card driving and the half virtualization driving network interface card of the SR-IOV NIC carry out the interaction of I/O data;
Second host is sent by the memory information of first virtual machine, so that second host is by described The memory information of one virtual machine is synchronized in second virtual machine.
2. virtual machine migration method according to claim 1, which is characterized in that described to receive virtual machine (vm) migration instruction Afterwards, the step of configuration information of the first virtual machine to be migrated being sent to second host, comprising:
The virtual machine information of the first virtual machine to be migrated in first host is obtained from virtual machine (vm) migration instruction And the host information of the second host that first virtual machine needs to move to;
The configuration information of first virtual machine is obtained according to the virtual machine information;
The configuration information is sent to second host according to the host information.
3. virtual machine migration method according to claim 1, which is characterized in that the memory by first virtual machine Information was sent to after the step of second host, the method also includes:
After the memory information of first virtual machine is synchronized to second virtual machine, first is virtual described in operation suspension Machine opens second virtual machine so that second host is in the first virtual machine operation suspension, and by described the The current operating conditions of two virtual machines are switched to non-migrating state, wherein under the non-migrating state, second virtual machine Hardware virtualization trawl performance is run to receive and dispatch queue and the SR-IOV according to the combination of the hardware virtualization trawl performance The hardware virtualization driving network interface card of NIC carries out the interaction of I/O data.
4. virtual machine migration method according to claim 1, which is characterized in that described by the current of first virtual machine Operating status is switched to the step of transition state, comprising:
Whether the current operating conditions for judging first virtual machine are non-migrating state;
If current operating conditions are non-migrating state, current operating conditions are switched to interim transition state;
Under the interim transition state, received from the combination of the currently running hardware virtualization trawl performance of first virtual machine The virtual functions VF number of queues for carrying out I/O data interaction is obtained in hair queue;
If the VF number of queues is 0, current operating conditions are switched to transition state from the interim transition state.
5. virtual machine migration method according to claim 1, which is characterized in that the combination transmitting-receiving queue passes through with lower section Formula generates:
The queue parameter and half for obtaining the virtual functions VF queue of hardware virtualization trawl performance virtualize the virtual of trawl performance The address of every I/O memory block in I/O ring Virtio-ring;
The VF is generated according to the address of every I/O memory block in the queue parameter and the Virtio-ring of the VF queue The queue union of queue and Virtio-ring, and queue is received and dispatched using the queue union as the combination.
6. a kind of virtual machine migration method, which is characterized in that applied to receiving the first virtual machine for being migrated of the first host Second host, first host and second host include single I/O virtualized network interfaces card SR-IOV NIC, the SR-IOV NIC include hardware virtualization driving network interface card and half virtualization driving network interface card, which comprises
Receive the configuration information of the first virtual machine to be migrated sent after first host is instructed according to virtual machine (vm) migration;
Create the second virtual machine according to the configuration information, and for the second virtual machine configuration hardware virtualization trawl performance and Half virtualization trawl performance, so that first host is when second virtual machine is completed to configure, it is virtual by described first The current operating conditions of machine are switched to transition state, wherein under the transition state, first virtual machine passes through operation half It is empty to virtualize the half of the combination transmitting-receiving queue of trawl performance and the SR-IOV NIC by described half to virtualize trawl performance Quasi-ization drives the interaction of network interface card progress I/O data;
Receive the memory information for first virtual machine that first host is sent, and by the memory of first virtual machine Synchronizing information is into second virtual machine.
7. virtual machine migration method according to claim 6, which is characterized in that the memory by first virtual machine After synchronizing information to the step in second virtual machine, the method also includes:
In the first virtual machine operation suspension, second virtual machine is opened, and by the current fortune of second virtual machine Row state is switched to non-migrating state, wherein under the non-migrating state, second virtual machine runs hardware virtualization net Card driving is to pass through the hardware virtualization of combination the transmitting-receiving queue and the SR-IOV NIC of the hardware virtualization trawl performance Network interface card is driven to carry out the interaction of I/O data.
8. virtual machine migration method according to claim 7, which is characterized in that described by the current of second virtual machine Operating status is switched to the step of non-migrating state, comprising:
Judge whether current operating conditions are transition state;
If current operating conditions are transition state, current operating conditions are switched to interim non-migrating state;
Under the interim non-migrating state, received from the combination of the currently running half virtualization trawl performance of second virtual machine The virtual i/o ring Virtio-ring quantity for carrying out I/O data interaction is obtained in hair queue;
If the Virtio-ring quantity is 0, current operating conditions are switched to non-move from the interim non-migrating state Shifting state.
9. virtual machine migration method according to claim 6, which is characterized in that the combination transmitting-receiving queue passes through with lower section Formula generates:
The queue parameter and half for obtaining the virtual functions VF queue of hardware virtualization trawl performance virtualize the virtual of trawl performance The address of every I/O memory block in I/O ring Virtio-ring;
The VF is generated according to the address of every I/O memory block in the queue parameter and the Virtio-ring of the VF queue The queue union of queue and Virtio-ring, and queue is received and dispatched using the queue union as the combination.
10. a kind of virtual machine migration method, which is characterized in that applied to the first host communicated to connect between each other and second Host, first host and second host include single I/O virtualized network interfaces card SR-IOV NIC, institute Stating SR-IOV NIC includes hardware virtualization driving network interface card and half virtualization driving network interface card, which comprises
First host sends the configuration information of the first virtual machine to be migrated after receiving virtual machine (vm) migration instruction To second host;
Second host creates the second virtual machine according to the configuration information, and empty for the second virtual machine configuration hardware Quasi-ization trawl performance and half virtualization trawl performance;
When second virtual machine is completed to configure, first host cuts the current operating conditions of first virtual machine Transition state is changed to, and sends second host for the memory information of first virtual machine under the transition state Machine, wherein under the transition state, it is empty that first virtual machine passes through described half by half virtualization trawl performance of operation The combination transmitting-receiving queue of quasi-ization trawl performance and the half virtualization driving network interface card of the SR-IOV NIC carry out the friendship of I/O data Mutually;
The memory information of first virtual machine is synchronized in second virtual machine by second host.
11. a kind of virtual machine (vm) migration device, which is characterized in that applied to the first host communicated to connect with the second host, First host and second host include single I/O virtualized network interfaces card SR-IOV NIC, the SR- IOV NIC includes hardware virtualization driving network interface card and half virtualization driving network interface card, and described device includes:
Configuration information sending module, for receive virtual machine (vm) migration instruction after, by the configuration of the first virtual machine to be migrated Information is sent to second host, so that second host creates the second virtual machine according to the configuration information, and For the second virtual machine configuration hardware virtualization trawl performance and half virtualization trawl performance;
First switching module is used for when second virtual machine is completed to configure, by the current operation shape of first virtual machine State is switched to transition state, wherein under the transition state, first virtual machine passes through half virtualization trawl performance of operation With by half virtualization driving network interface card of the combination transmitting-receiving queue of the half virtualization trawl performance and the SR-IOV NIC into The interaction of row I/O data;
Memory information sending module, for sending second host for the memory information of first virtual machine, so that The memory information of first virtual machine is synchronized in second virtual machine by second host.
12. virtual machine (vm) migration device according to claim 11, which is characterized in that the configuration information sending module, tool The configuration information of first virtual machine to be migrated is sent to second host in the following manner by body:
The virtual machine information of the first virtual machine to be migrated in first host is obtained from virtual machine (vm) migration instruction And the host information of the second host that first virtual machine needs to move to;
The configuration information of first virtual machine is obtained according to the virtual machine information;
The configuration information is sent to second host according to the host information.
13. virtual machine (vm) migration device according to claim 11, which is characterized in that described device further include:
Suspend module, for after the memory information of first virtual machine is synchronized to second virtual machine, operation suspension First virtual machine, so that in the first virtual machine operation suspension, it is virtual to open described second for second host Machine, and the current operating conditions of second virtual machine are switched to non-migrating state, wherein under the non-migrating state, The second virtual machine operation hardware virtualization trawl performance is to receive and dispatch team by the combination of the hardware virtualization trawl performance Column carry out the interaction of I/O data with the hardware virtualization driving network interface card of the SR-IOV NIC.
14. virtual machine (vm) migration device according to claim 11, which is characterized in that first switching module especially by The current operating conditions of first virtual machine are switched to transition state by following manner:
Whether the current operating conditions for judging first virtual machine are non-migrating state;
If current operating conditions are non-migrating state, current operating conditions are switched to interim transition state;
It is empty from half in the currently running hardware virtualization trawl performance of first virtual machine under the interim transition state The virtual functions VF number of queues for carrying out I/O data interaction is obtained in the combination transmitting-receiving queue of quasi-ization trawl performance;
If the VF number of queues is 0, current operating conditions are switched to transition state from the interim transition state.
15. a kind of virtual machine (vm) migration device, which is characterized in that applied to receiving the first virtual machine for being migrated of the first host Second host, first host and second host include single I/O virtualized network interfaces card SR-IOV NIC, the SR-IOV NIC include hardware virtualization driving network interface card and half virtualization driving network interface card, and described device includes:
Configuration information receiving module, for receive sent after first host is instructed according to virtual machine (vm) migration it is to be migrated The configuration information of first virtual machine;
Creation module, for creating the second virtual machine according to the configuration information, and it is empty for the second virtual machine configuration hardware Quasi-ization trawl performance and half virtualization trawl performance, so that first host is when second virtual machine is completed to configure, The current operating conditions of first virtual machine are switched to transition state, wherein under the transition state, described first is empty Quasi- machine receives and dispatches queue and the SR- by half virtualization trawl performance of operation with the combination by the half virtualization trawl performance The half virtualization driving network interface card of IOV NIC carries out the interaction of I/O data;
Memory information receiving module, for receiving the memory information for first virtual machine that first host is sent, and The memory information of first virtual machine is synchronized in second virtual machine.
16. virtual machine (vm) migration device according to claim 15, which is characterized in that described device further include:
Second switching module opens second virtual machine in the first virtual machine operation suspension, and by described the The current operating conditions of two virtual machines are switched to non-migrating state, wherein under the non-migrating state, second virtual machine Hardware virtualization trawl performance is run to receive and dispatch queue and the SR- by the combination of the hardware virtualization trawl performance The hardware virtualization driving network interface card of IOVNIC carries out the interaction of I/O data.
17. virtual machine (vm) migration device according to claim 16, which is characterized in that second switching module especially by The current operating conditions of second virtual machine are switched to non-migrating state by following manner:
Judge whether current operating conditions are transition state;
If current operating conditions are transition state, current operating conditions are switched to interim non-migrating state;
Under the interim non-migrating state, received from the combination of the currently running half virtualization trawl performance of second virtual machine The virtual i/o ring Virtio-ring quantity for carrying out I/O data interaction is obtained in hair queue;
If the Virtio-ring quantity is 0, current operating conditions are switched to non-move from the interim non-migrating state Shifting state.
CN201811505526.XA 2018-12-10 2018-12-10 Virtual machine migration method and device Active CN109739618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811505526.XA CN109739618B (en) 2018-12-10 2018-12-10 Virtual machine migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811505526.XA CN109739618B (en) 2018-12-10 2018-12-10 Virtual machine migration method and device

Publications (2)

Publication Number Publication Date
CN109739618A true CN109739618A (en) 2019-05-10
CN109739618B CN109739618B (en) 2021-04-06

Family

ID=66358812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811505526.XA Active CN109739618B (en) 2018-12-10 2018-12-10 Virtual machine migration method and device

Country Status (1)

Country Link
CN (1) CN109739618B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928728A (en) * 2019-11-27 2020-03-27 上海英方软件股份有限公司 Virtual machine copying and switching method and system based on snapshot
CN110955517A (en) * 2019-09-03 2020-04-03 华为技术有限公司 Message forwarding method, computer equipment and intermediate equipment
CN112596818A (en) * 2020-12-30 2021-04-02 上海众源网络有限公司 Application program control method, system and device
CN113472571A (en) * 2021-06-28 2021-10-01 北京汇钧科技有限公司 Intelligent network card equipment and bypass detection method of intelligent network card equipment
CN113553137A (en) * 2021-06-17 2021-10-26 中国人民解放军战略支援部队信息工程大学 DPDK-based access capability network element high-speed data processing method under NFV architecture
CN114546604A (en) * 2022-04-26 2022-05-27 赛芯半导体技术(北京)有限公司 Thermal migration method and device for virtual machine
WO2022143717A1 (en) * 2020-12-29 2022-07-07 华为云计算技术有限公司 Method, apparatus, and system for migrating virtual machine
CN114760242A (en) * 2022-03-30 2022-07-15 深信服科技股份有限公司 Virtual router migration method and device, electronic equipment and storage medium
CN115499385A (en) * 2022-09-21 2022-12-20 中电云数智科技有限公司 Method for avoiding packet loss in vDPA virtual machine thermal migration
CN116932229A (en) * 2023-09-13 2023-10-24 新华三信息技术有限公司 Memory allocation method and device, network manager and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594652A (en) * 2011-01-13 2012-07-18 华为技术有限公司 Migration method of virtual machine, switch and virtual machine system
CN102681913A (en) * 2011-12-21 2012-09-19 中兴通讯股份有限公司 Method and device for realizing live migration along virtual machines
US20160342437A1 (en) * 2015-05-21 2016-11-24 Dell Products, L.P. Data path failover method for sr-iov capable ethernet controller
CN106302322A (en) * 2015-05-19 2017-01-04 腾讯科技(深圳)有限公司 A kind of virtual-machine data flow management method and system
CN106557444A (en) * 2015-09-30 2017-04-05 中兴通讯股份有限公司 The method and apparatus for realizing SR-IOV network interface cards is, the method and apparatus for realizing dynamic migration
CN106815067A (en) * 2015-11-30 2017-06-09 中国移动通信集团公司 The online moving method of virtual machine, device with I/O virtualizations
CN107544841A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 Live migration of virtual machine method and system
CN107729149A (en) * 2017-10-16 2018-02-23 郑州云海信息技术有限公司 A kind of virtual machine migration method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594652A (en) * 2011-01-13 2012-07-18 华为技术有限公司 Migration method of virtual machine, switch and virtual machine system
CN102681913A (en) * 2011-12-21 2012-09-19 中兴通讯股份有限公司 Method and device for realizing live migration along virtual machines
CN106302322A (en) * 2015-05-19 2017-01-04 腾讯科技(深圳)有限公司 A kind of virtual-machine data flow management method and system
US20160342437A1 (en) * 2015-05-21 2016-11-24 Dell Products, L.P. Data path failover method for sr-iov capable ethernet controller
CN106557444A (en) * 2015-09-30 2017-04-05 中兴通讯股份有限公司 The method and apparatus for realizing SR-IOV network interface cards is, the method and apparatus for realizing dynamic migration
CN106815067A (en) * 2015-11-30 2017-06-09 中国移动通信集团公司 The online moving method of virtual machine, device with I/O virtualizations
CN107544841A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 Live migration of virtual machine method and system
CN107729149A (en) * 2017-10-16 2018-02-23 郑州云海信息技术有限公司 A kind of virtual machine migration method and device

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955517A (en) * 2019-09-03 2020-04-03 华为技术有限公司 Message forwarding method, computer equipment and intermediate equipment
WO2021042819A1 (en) * 2019-09-03 2021-03-11 华为技术有限公司 Message forwarding method, computer device, and intermediate device
CN110928728A (en) * 2019-11-27 2020-03-27 上海英方软件股份有限公司 Virtual machine copying and switching method and system based on snapshot
WO2022143717A1 (en) * 2020-12-29 2022-07-07 华为云计算技术有限公司 Method, apparatus, and system for migrating virtual machine
CN112596818A (en) * 2020-12-30 2021-04-02 上海众源网络有限公司 Application program control method, system and device
CN112596818B (en) * 2020-12-30 2023-12-05 上海众源网络有限公司 Application program control method, system and device
CN113553137B (en) * 2021-06-17 2022-11-01 中国人民解放军战略支援部队信息工程大学 DPDK-based access capability network element high-speed data processing method under NFV architecture
CN113553137A (en) * 2021-06-17 2021-10-26 中国人民解放军战略支援部队信息工程大学 DPDK-based access capability network element high-speed data processing method under NFV architecture
CN113472571A (en) * 2021-06-28 2021-10-01 北京汇钧科技有限公司 Intelligent network card equipment and bypass detection method of intelligent network card equipment
CN113472571B (en) * 2021-06-28 2023-11-03 北京汇钧科技有限公司 Intelligent network card device and bypass detection method of intelligent network card device
CN114760242A (en) * 2022-03-30 2022-07-15 深信服科技股份有限公司 Virtual router migration method and device, electronic equipment and storage medium
CN114760242B (en) * 2022-03-30 2024-04-09 深信服科技股份有限公司 Migration method and device of virtual router, electronic equipment and storage medium
CN114546604B (en) * 2022-04-26 2022-08-05 赛芯半导体技术(北京)有限公司 Thermal migration method and device for virtual machine
CN114546604A (en) * 2022-04-26 2022-05-27 赛芯半导体技术(北京)有限公司 Thermal migration method and device for virtual machine
CN115499385A (en) * 2022-09-21 2022-12-20 中电云数智科技有限公司 Method for avoiding packet loss in vDPA virtual machine thermal migration
CN115499385B (en) * 2022-09-21 2023-09-12 中电云数智科技有限公司 Method for preventing packet loss during thermal migration of vDPA virtual machine
CN116932229A (en) * 2023-09-13 2023-10-24 新华三信息技术有限公司 Memory allocation method and device, network manager and storage medium
CN116932229B (en) * 2023-09-13 2023-12-12 新华三信息技术有限公司 Memory allocation method and device, network manager and storage medium

Also Published As

Publication number Publication date
CN109739618B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN109739618A (en) Virtual machine migration method and device
US20240039994A1 (en) Using physical and virtual functions associated with a nic to access an external storage through network fabric driver
US11593278B2 (en) Using machine executing on a NIC to access a third party storage not supported by a NIC or host
US20230115114A1 (en) Hardware assisted virtual switch
US8776090B2 (en) Method and system for network abstraction and virtualization for a single operating system (OS)
US9176767B2 (en) Network interface card device pass-through with multiple nested hypervisors
CN104142849B (en) The shared method and system of more single input/output virtualization virtual functions of main frame
CN103346981B (en) Virtual switch method, relevant apparatus and computer system
US9996484B1 (en) Hardware acceleration for software emulation of PCI express compliant devices
US9031081B2 (en) Method and system for switching in a virtualized platform
JP5323021B2 (en) Apparatus and method for dynamically expandable virtual switch
US9792138B2 (en) Virtual machine migration to hyper visors with virtual function capability
US11586575B2 (en) System decoder for training accelerators
CN116348841A (en) NIC supported distributed storage services
US11303638B2 (en) Atomic update of access control list rules
US20230185732A1 (en) Transparent encryption
Lettieri et al. A survey of fast packet I/O technologies for network function virtualization
CN106557444A (en) The method and apparatus for realizing SR-IOV network interface cards is, the method and apparatus for realizing dynamic migration
WO2019165355A1 (en) Technologies for nic port reduction with accelerated switching
Gai Building a future-proof cloud infrastructure: A unified architecture for network, security, and storage services
US20240028381A1 (en) Virtual i/o device management
US20240004701A1 (en) Methods and apparatus for function virtual configuration space presentation migration and input/output traffic route migration ordering
Yang et al. Isolation guarantee for efficient virtualized network i/o on cloud platform
US10929063B1 (en) Assisted indirect memory addressing
US11138072B2 (en) Protected runtime mode

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