Summary of the invention
The method that the status information that the embodiment of the present invention provides the present invention to propose a kind of virtual machine is synchronous, can shorten the time out of host virtual machine, improves the calculated performance of host virtual machine.The embodiment of the present invention additionally provides corresponding Apparatus and system.
A kind of method that first aspect present invention provides status information of virtual machine synchronous, described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, described method comprises:
Suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host;
Startup optimization is in the described host virtual machine of halted state;
While described host virtual machine is in running status, the status information of described host virtual machine is obtained from described storer, and the status information of described host virtual machine is sent to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
In conjunction with first aspect, in the implementation that the first is possible, the described host virtual machine of described time-out, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, described method also comprises:
The network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Receive the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
According to described acknowledge message, the network packet being provided with described mark is exported from described source host.
In conjunction with the first possible implementation of first aspect, in the implementation that the second is possible, after the acknowledge message that the described destination host of described reception sends, described method also comprises:
According to described acknowledge message, delete in described storer the status information of the described host virtual machine stored.
The device that second aspect present invention provides a kind of status information of virtual machine synchronous, described application of installation is in virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine and described device, described destination host runs and has standby virtual machine, described device comprises:
First control module, for when described source host is to the status information of the synchronous described host virtual machine of described destination host, suspends described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host;
Second control module, controls the described host virtual machine being in halted state suspended for the first control module described in startup optimization;
Acquiring unit, while being in running status at described host virtual machine, obtain from described storer described first control module control stored in the status information of described host virtual machine;
Transmitting element, the status information for the described host virtual machine obtained by described acquiring unit sends to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
In conjunction with second aspect, in the implementation that the first is possible, described device also comprises: setting unit and receiving element,
Described setting unit, for when described first control module suspends described host virtual machine, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Described receiving element, for receiving the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
Described transmitting element, for the described acknowledge message received according to described receiving element, the network packet described setting unit being provided with described mark exports from described source host.
In conjunction with the first possible implementation of second aspect, in the implementation that the second is possible, described device also comprises:
Delete cells, for the described acknowledge message received according to described receiving element, deletes in described storer the status information of the described host virtual machine stored.
A kind of method that third aspect present invention provides status information of virtual machine synchronous, described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host comprises processor, storer and I/O I/O equipment, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, described method comprises:
Described processor suspends described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host;
Described processor startup optimization is in the described host virtual machine of halted state;
Described processor, while described host virtual machine is in running status, obtains the status information of described host virtual machine from described storer;
The status information of described host virtual machine sends to described destination host by the described input-output apparatus that described processor triggers described source host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
Fourth aspect present invention provides a kind of source host, described source host is applied to virtual machine tolerant system, described virtual machine tolerant system comprises described source host and destination host, described source host comprises processor, storer and I/O I/O equipment, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, it is characterized in that
Described processor is used for:
Suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described storer;
Startup optimization is in the described host virtual machine of halted state;
While described host virtual machine is in running status, from described storer, obtain the status information of described host virtual machine;
The status information of described host virtual machine sends to described destination host by the described input-output apparatus triggering described source host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
Fifth aspect present invention provides a kind of virtual machine tolerant system, and described virtual machine tolerant system comprises source host and destination host, and described source host runs host virtual machine, and described destination host runs standby virtual machine;
Described source host comprises the synchronous device of the status information of the virtual machine as described in above-mentioned arbitrary technical scheme, and;
Described destination host is used for the state of standby virtual machine according to the state information updating of described host virtual machine.
Sixth aspect present invention provides a kind of virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host
Described source host, for when to the status information of described destination host synchronous described host virtual machine, suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host, startup optimization is in the described host virtual machine of halted state, while described host virtual machine is in running status, from described storer, obtain the status information of described host virtual machine, and the status information of described host virtual machine is sent to described destination host;
Described destination host, for the state of virtual machine standby according to the state information updating of the described host virtual machine received.
In conjunction with the 6th aspect, in the implementation that the first is possible,
Described source host also for: time-out described host virtual machine, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Described source host also for: receive described destination host send acknowledge message, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine, and the network packet being provided with described mark is exported from described source host according to described acknowledge message.
The method that the status information of virtual machine that the embodiment of the present invention adopts is synchronous, described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, described method comprises: suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host; Startup optimization is in the described host virtual machine of halted state; While described host virtual machine is in running status, the status information of described host virtual machine is obtained from described storer, and the status information of described host virtual machine is sent to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Embodiment
A kind of method that the embodiment of the present invention provides the embodiment of the present invention to provide status information of virtual machine synchronous, can shorten the time out of host virtual machine, improves the calculated performance of host virtual machine.The embodiment of the present invention additionally provides corresponding Apparatus and system.Below be described in detail respectively.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
To facilitate understanding of the present embodiment of the invention, first introduce during the embodiment of the present invention describes at this several elements that can introduce, as shown in Figure 1:
Virtual machine VM:
One or the virtual computing machine of multiple stage can be simulated on a physical host by software virtual machine, and these virtual machines carry out work just as real computing machine, can installing operating system and application program on virtual machine, virtual machine is addressable network resource also.For the application program run in virtual machine, virtual machine similarly is carry out work in real computing machine.
Physical host can as source host, also can as destination host, host virtual machine is for running on the source host, and the hardware of source host normal time participate in calculate virtual machine, standby virtual machine is for operating on destination host, when the hardware of source host occur abnormal, take over the virtual machine of the evaluation work of host virtual machine.
Hardware layer:
The hardware platform that virtualized environment runs.Wherein, hardware layer can comprise multiple hardwares, the hardware layer of such as certain computing node can comprise processor (as CPU) and internal memory, the high speed such as network interface card, storer or low speed I/O (I/O can also be comprised, Input/Output) equipment, and there is the miscellaneous equipment of particular procedure function, as input and output memory management unit (IOMMU, Input/Output Memory Management Unit), wherein IOMMU can be used for the conversion of virtual machine physical address and Host physical address.
Host (Host):
As administration and supervision authorities, in order to complete management, the distribution of hardware resource; For virtual machine presents virtual hardware platform; Realize scheduling and the isolation of virtual machine.Wherein, Host may be monitor of virtual machine (VMM); In addition, VMM and 1 privileged virtual machine coordinates sometimes, and both combine composition Host.Wherein, virtual hardware platform provides various hardware resource, as provided virtual cpu, internal memory, virtual disk, Microsoft Loopback Adapter etc. to each virtual machine that it runs.Wherein, this virtual disk may correspond to a file or a logical block equipment of Host.It is on its virtual hardware platform prepared that virtual machine then operates in Host, the one or more virtual machine of the upper operation of Host.Such as, the host shown in Fig. 2 is the combination of Xen platform and privileged virtual machine, and the host shown in Fig. 3 is the combination of KVM platform and privileged virtual machine.
In the embodiment of the present invention, in virtual machine tolerant system, comprise source host and destination host, described source host runs and has host virtual machine, such as: the Guest (M) shown in Fig. 2 or Fig. 3, described destination host runs and has standby virtual machine, such as: the Guest (S) shown in Fig. 2 or Fig. 3, when described source host is to the status information of the synchronous described host virtual machine of described destination host, as shown in Figure 2, Guest (M) is equivalent to host virtual machine, Host (M) is equivalent to privileged virtual machine, Xen is equivalent to host virtual machine watch-dog, Guest (M) storer is equivalent to the storer of host virtual machine, the virtual hard disk of such as host virtual machine, may be used for the mirror image storing Guest (M).Guest (S) is equivalent to standby virtual machine, Host (S) is equivalent to privileged virtual machine, Xen is equivalent to standby monitor of virtual machine, Guest (S) storer is equivalent to the storer of standby virtual machine, such as the virtual hard disk of virtual machine, may be used for the mirror image storing Guest (S).
In embodiment as shown in Figure 2, source host and destination host have run the virtual supporting platform of Xen all respectively, and in figure, dotted line represents and the status information of the virtual machine of the host virtual machine Guest (M) on source host is synchronized on the standby virtual machine Guest (S) of destination host.In fault-tolerant process, FT_M is the process on Host on source host (M), and FT_S is the process of Host on destination host (S).Process described by the embodiment of the present invention realizes in FT_M and FT_S.
In embodiment as shown in Figure 3, source host and destination host have run KVM virtualization supporting platform all respectively, and in figure, dotted line represents and the status information of the virtual machine of the host virtual machine Guest (M) on source host is synchronized on the standby virtual machine Guest (S) of destination host.In fault-tolerant process, QEMU_M is the process on Host on source host (M), and QEMU_S is the process of Host on destination host (S).Process described by the embodiment of the present invention realizes in QEMU_M and QEMU_S.
No matter be in FT_M and FT_S, or in QEMU_M and QEMU_S, in the embodiment of the present invention, the process of the status synchronizing information of virtual machine is substantially identical, concrete synchronizing process can be consulted Fig. 4 and be understood:
S100, status information allocate memory for host virtual machine.
Under virtual machine tolerant system Organization Chart shown in composition graphs 2 and Fig. 3, determine the storer of the status information of storage virtual machine, such as: can distribution diagram 2 or the Guest shown in Fig. 3 (M) storer.In fact in the embodiment of the present invention can be allocate memory, also can be to distribute buffer memory.
S105, wait N millisecond.
N millisecond is default virtual machine sync interval.
S110, time-out host virtual machine.
Suspend host virtual machine, can ensure in the process that succeeding state is synchronous, host virtual machine is consistent with standby virtual machine state.
The storer that S115, the status information copying host virtual machine are distributed in S100.
In the embodiment of the present invention, the status information of host virtual machine is the virtual hardware information of host virtual machine, for when the physical hardware of source host breaks down, standby virtual machine is synchronized to the described host virtual machine of destination host status information according to source host recover host virtual machine suspend in step s 110 before state.
The status information of host virtual machine can be: the information such as host virtual machine internal memory, CPU, network interface card, disk.
S120, the network packet exported for described host virtual machine arrange mark.
Described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces.。
The operation of S125, recovery host virtual machine.
In the process status information of host virtual machine being synchronized to standby virtual machine, first by the status information of host virtual machine stored in storer, then recover the operation of host virtual machine at once, decrease the time that host virtual machine suspends, thus improve the performance of host virtual machine.
S130, from storer, obtain the status information of host virtual machine, and the status information of described host virtual machine is sent to destination host.
Between source host and destination host, transmit data can carry out data transmission by Ethernet.
S135, destination host receive the status information of host virtual machine.
S140, destination host send acknowledge message to source host.
Destination host, by acknowledge message, notifies that described in described source host, destination host has received the status information of described host virtual machine.
The status information of host virtual machine can be point multiple Packet Generation to destination host, the packet that the first buffer memory of destination host receives, until the status information of described host virtual machine receives completely, just sends acknowledge message to source host.
S145, source host receive the acknowledge message that described destination host sends.
S150, destination host are after execution S140, can according to the state of the state information updating of the host virtual machine received for virtual machine, concrete renewal process can be the status information of replacing the host virtual machine received last time by the status information of this host virtual machine received.
S155, receive the confirmation message after, can storer be emptied, and the network packet arranging mark in step S120 is exported described source host.
In the embodiment of the present invention, export and markd network packet is set refers to the network packet of tape label is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
This process is equivalent to host virtual machine in execution business, and perform this service needed when suspending repeatedly host virtual machine, the state A1 of state A0 to host virtual machine of the host virtual machine of business is performed from just, a corresponding generation packet B1, the corresponding B1 of A1 can be expressed as, in fact B1 be the host virtual machine when host virtual machine startup optimization state A0 to next time suspend time described host virtual machine state A1 time period in produce, by that analogy, the corresponding Bn of An, n is greater than 1, such as: when synchronous A2, then mark B2, if in synchronous A2 process, source host hardware fault, then B2 has just been dropped in source host, destination host is according to the last subsynchronous A1 come, computing is restarted from A1 state, regenerate B2, if after A2 synchronously completes, B2 exports opisthogenesis host hardware fault from source host, that then source host abandons is the new packet B3 produced in synchronous A2 process, destination host is directly according to the A2 just synchronously come, computing is restarted from A2 state, from newly producing B3, like this, when be no matter source host fault, the network packet that host virtual machine and standby virtual machine export the object equipment in external network is all continuous print, there will not be recurrent network packet.
In fault-tolerant process, during source host hardware failure, host virtual machine cannot normally run, and source host then can notify that destination host starts standby virtual machine, indicates by standby virtual machine to take over the evaluation work of host virtual machine.
After standby virtual machine receives enabled instruction, can startup optimization immediately, because the state of standby virtual machine is the latest state information that the preamble of host virtual machine fault comes, institute prepares against virtual machine according to the status information startup optimization of the host virtual machine of renewal, can take over the evaluation work of host virtual machine.
Consult Fig. 5, an embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous comprises:
Described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, described method comprises:
101, described host virtual machine is suspended, and by the storer of the status information of described host virtual machine stored in described source host.
102, startup optimization is in the described host virtual machine of halted state.
103, while described host virtual machine is in running status, the status information of described host virtual machine is obtained from described storer, and the status information of described host virtual machine is sent to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
The method that the status information of virtual machine that the embodiment of the present invention adopts is synchronous, described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, described method comprises: suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host; Startup optimization is in the described host virtual machine of halted state; While described host virtual machine is in running status, the status information of described host virtual machine is obtained from described storer, and the status information of described host virtual machine is sent to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 5, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, the described host virtual machine of described time-out, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, described method also comprises:
The network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Receive the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
According to described acknowledge message, the network packet being provided with described mark is exported from described source host.
In the embodiment of the present invention, export and markd network packet is set refers to the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 5, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, after the acknowledge message that the described destination host of described reception sends, described method can also comprise:
According to described acknowledge message, delete in described storer the status information of the described host virtual machine stored.
In the embodiment of the present invention, complete in destination host standby virtual machine synchronous after, delete the status information of the host virtual machine stored in storer, can storage space be discharged.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 5 or embodiment, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous,
Before the described host virtual machine of described time-out, described method also comprises:
Status information for described host virtual machine determines described storer.
In the embodiment of the present invention, determine that storer also can be for the status information of host virtual machine distributes buffer memory from storage resources.
The associated description that the detailed process of several embodiments of the method that the status information of the virtual machine that Fig. 5 is corresponding is synchronous can be consulted in Fig. 1 to Fig. 4 is understood, and this place does not do and too much repeats.
Consult Fig. 6, one embodiment of the device that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, described application of installation is in virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host runs and has host virtual machine and described device, described destination host runs and has standby virtual machine, it is characterized in that, described device comprises:
First control module 201, for when described source host is to the status information of the synchronous described host virtual machine of described destination host, suspends described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host;
Second control module 202, controls the described host virtual machine being in halted state suspended for the first control module 201 described in startup optimization;
Acquiring unit 203, while being in running status at described host virtual machine, obtain from described storer described first control module 201 control stored in described status information;
Transmitting element 204, the status information for the described host virtual machine obtained by described acquiring unit 203 is sent to described destination host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
In the embodiment of the present invention, the first control module 201, when described source host is to the status information of the synchronous described host virtual machine of described destination host, suspends described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host; First control module 201 described in second control module 202 startup optimization controls the described host virtual machine being in halted state suspended; Acquiring unit 203 while described host virtual machine is in running status, obtain from described storer described first control module control stored in described status information; The status information of the described host virtual machine that described acquiring unit 203 obtains is sent to described destination host by transmitting element 204, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the device that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 6, consult Fig. 7, in another embodiment of the synchronous device that the embodiment of the present invention provides, described synchronous device also comprises: setting unit 205 and receiving element 206, described setting unit 205, for when described first control module 201 suspends described host virtual machine, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces.
Described receiving element 206, for receiving the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
Described transmitting element 204, for the described acknowledge message received according to described receiving element 206, the network packet described setting unit being provided with described mark exports from described source host.
In the embodiment of the present invention, export from source host and markd network packet is set refers to the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 7, consult Fig. 8, in another embodiment of the synchronous device that the embodiment of the present invention provides, described synchronous device also comprises:
Delete cells 207, for the described acknowledge message received according to described receiving element 206, deletes in described storer the status information of the described host virtual machine stored.
In the embodiment of the present invention, complete in destination host standby virtual machine synchronous after, delete the status information of the host virtual machine stored in storer, can storage space be discharged.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 8, consult Fig. 9, in another embodiment of the synchronous device that the embodiment of the present invention provides, described device also comprises:
Determining unit 208, before suspending described host virtual machine at described first control module 201, the status information for described host virtual machine determines described storer.
The description that the synchronous device of the status information of the virtual machine that the embodiment of the present invention provides can consult the embodiment of the method for Fig. 1 to Fig. 5 part is understood, and this place does not do and too much repeats.
Consult Figure 10, an embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous comprises:
Described method is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host and destination host, described source host comprises processor, storer and I/O I/O equipment, described source host runs and has host virtual machine, described destination host runs and has standby virtual machine, when described source host is to the status information of the synchronous described host virtual machine of described destination host, it is characterized in that, described method comprises:
Described processor suspends described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host;
Described processor startup optimization is in the described host virtual machine of halted state;
Described processor, while described host virtual machine is in running status, obtains the status information of described host virtual machine from described storer;
The status information of described host virtual machine sends to described destination host by the described input-output apparatus that described processor triggers described source host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Alternatively, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, the described host virtual machine of described time-out, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, described method can also comprise:
Described processor is that the network packet that described host virtual machine exports arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Receive the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
According to described acknowledge message, the network packet being provided with described mark is exported from described source host.
In the embodiment of the present invention, export from source host and markd network packet is set refers to the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
Alternatively, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous, after the acknowledge message that the described destination host of described reception sends, described method also comprises:
According to described acknowledge message, delete in described storer the status information of the described host virtual machine stored.
In the embodiment of the present invention, complete in destination host standby virtual machine synchronous after, delete the status information of the host virtual machine stored in storer, can storage space be discharged.
Alternatively, in another embodiment of the method that the status information of the virtual machine that the embodiment of the present invention provides is synchronous,
Before the described host virtual machine of described time-out, described method also comprises:
Status information for described host virtual machine determines described storer.
Figure 11 is the structural representation of the source host 2 that the embodiment of the present invention provides.Described source host 2 is applied to virtual machine tolerant system, described virtual machine tolerant system comprises source host 2 and destination host, described source host 2 comprises processor 210, storer 250 and input-output apparatus 230 (optionally), described storer runs and has host virtual machine 2501, described destination host runs and has standby virtual machine, storer 250 can comprise ROM (read-only memory) and random access memory, and provides operational order and data to processor 210.A part for storer 250 can also comprise nonvolatile RAM (NVRAM).
In some embodiments, storer 250 stores following element, executable module or data structure, or their subset, or their superset:
Host 2502: as administration and supervision authorities, in order to complete management, the distribution of hardware resource; For virtual machine presents virtual hardware platform; Realize scheduling and the isolation of virtual machine.Wherein, Host may be monitor of virtual machine (VMM); In addition, VMM and 1 privileged virtual machine coordinates sometimes, and both combine composition Host.Wherein, virtual hardware platform provides various hardware resource, as provided virtual processor, internal memory, virtual disk, Microsoft Loopback Adapter etc. to each virtual machine that it runs.Wherein, this virtual disk may correspond to a file or a logical block equipment of Host.It is on its virtual hardware platform prepared that virtual machine then operates in Host, the one or more virtual machine of the upper operation of Host.
Virtual machine 2501: one or the virtual computing machine of multiple stage can be simulated by software virtual machine on a physical computer, and these virtual machines carry out work just as real computing machine, can installing operating system and application program on virtual machine, virtual machine is addressable network resource also.For the application program run in virtual machine, virtual machine similarly is carry out work in real computing machine.
In embodiments of the present invention, by calling the operational order (this operational order can store in an operating system) that storer 250 stores, when source host is to the status information of the synchronous described host virtual machine of destination host,
Processor 210 for:
Suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described storer;
Startup optimization is in the described host virtual machine of halted state;
While described host virtual machine is in running status, from described storer, obtain the status information of described host virtual machine;
The status information of described host virtual machine sends to described destination host by the described input-output apparatus triggering described source host, so that the state of described destination host standby virtual machine according to the state information updating of described host virtual machine.
Visible, in the embodiment of the present invention, source host 2 is when the status information of synchronous host virtual machine, can by the status information of host virtual machine stored in storer, then start host virtual machine to run, then the status information obtaining virtual machine from storer is carried out synchronously, like this, shorten the time out of host virtual machine, improve the calculated performance of host virtual machine.
Processor 210 controls the operation of source host 2, and processor 210 can also be called CPU (Central Processing Unit, CPU (central processing unit)).Storer 250 can comprise ROM (read-only memory) and random access memory, and provides instruction and data to processor 210.A part for storer 250 can also comprise nonvolatile RAM (NVRAM).In concrete application, each assembly of source host 2 is coupled by bus system 220, and wherein bus system 220 is except comprising data bus, can also comprise power bus, control bus and status signal bus in addition etc.But for the purpose of clearly demonstrating, in the drawings various bus is all designated as bus system 220.
The method that the invention described above embodiment discloses can be applied in processor 210, or is realized by processor 210.Processor 210 may be a kind of integrated circuit (IC) chip, has the processing power of signal.In implementation procedure, each step of said method can be completed by the instruction of the integrated logic circuit of the hardware in processor 210 or software form.Above-mentioned processor 210 can be general processor, digital signal processor (DSP), special IC (ASIC), ready-made programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components.Can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.The processor etc. of general processor can be microprocessor or this processor also can be any routine.Step in conjunction with the method disclosed in the embodiment of the present invention directly can be presented as that hardware decoding processor is complete, or combines complete by the hardware in decoding processor and software module.Software module can be positioned at random access memory, flash memory, ROM (read-only memory), in the storage medium of this area maturations such as programmable read only memory or electrically erasable programmable storer, register.This storage medium is positioned at storer 250, and processor 210 reads the information in storer 250, completes the step of said method in conjunction with its hardware.
Alternatively, processor 210 is also for suspending described host virtual machine, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
The acknowledge message that input-output apparatus 230 sends for receiving described destination host, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine;
The network packet being provided with described mark also according to described acknowledge message, can export by processor 210 from described source host.
In the embodiment of the present invention, the network packet of release mark refers to and the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
Alternatively, described processor 210 also for according to described acknowledge message, deletes in described storer the status information of the described host virtual machine stored.
In the embodiment of the present invention, complete in destination host standby virtual machine synchronous after, delete the status information of the host virtual machine stored in storer, can storage space be discharged.
Alternatively, described processor 210 is also for before suspending described host virtual machine, and the status information for described host virtual machine determines described storer.
Consult Figure 12, one embodiment of the virtual machine tolerant system that the embodiment of the present invention provides comprises: source host and 2 destination hosts 3, described source host 2 runs and has host virtual machine, such as: VM1, VM2 and VM3, source host 2 also runs and has host 22, the device 20 that the status information of the virtual machine of main side is synchronous is deployed with in host 22, and hardware layer 21, described destination host 3 runs and has standby virtual machine, such as: VM4, VM5 and VM6, destination host 3 also runs and has host 32, the device 30 that the status information of the virtual machine of standby end is synchronous is deployed with in host 32, and hardware layer 31.
The process that between source host with destination host, the status information of host virtual machine is synchronous, in fact can be understood as the reciprocal process between the synchronous device 20 of the status information of the virtual machine the being main side device 30 synchronous with the status information of the standby virtual machine held, such as: as the reciprocal process between the FT_M process in Fig. 2 and FT_S process.QEMU_M process in Fig. 3 and the reciprocal process between QEMU_S process.
Described source host 2, for when to the status information of described destination host synchronous described host virtual machine, suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host, startup optimization is in the described host virtual machine of halted state, while described host virtual machine is in running status, from described storer, obtain the status information of described host virtual machine, and the status information of described host virtual machine is sent to described destination host;
Described destination host 3, for the state of virtual machine standby according to the state information updating of described host virtual machine.
Concrete renewal process can be the status information of replacing the host virtual machine received last time by the status information of this host virtual machine received.
After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the tolerant system that the embodiment of the present invention provides, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Alternatively, described source host 2 also for: suspend described host virtual machine, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Receive the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine, according to described acknowledge message, the network packet being provided with described mark is exported from described source host.
In the embodiment of the present invention, the network packet of release mark refers to and the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
The description that the source host provided in the embodiment of the present invention can consult device embodiment part is understood, and this place does not do and too much repeats.
Consult Figure 13, another embodiment of the virtual machine tolerant system that the embodiment of the present invention provides comprises:
Described virtual machine tolerant system comprises source host 2 and destination host 3, described source host 2 runs and has host virtual machine 2501, described destination host 3 runs and has standby virtual machine 3501, at described source host 2 to described destination host 3, the embodiment that the structure of described source host 2 can be consulted corresponding to Figure 11 is understood, and the hardware configuration of destination host 3 is identical with source host 2.
When described source host is to the status information of the synchronous described host virtual machine of described destination host, described source host 2, for when to the status information of described destination host synchronous described host virtual machine, suspend described host virtual machine, and by the storer of the status information of described host virtual machine stored in described source host, startup optimization is in the described host virtual machine of halted state, while described host virtual machine is in running status, from described storer, obtain the status information of described host virtual machine, and the status information of described host virtual machine is sent to described destination host;
Described destination host 3, for the state of virtual machine standby according to the state information updating of the described host virtual machine received.
Concrete renewal process can be the status information of replacing the host virtual machine received last time by the status information of this host virtual machine received.
After suspending host virtual machine in prior art, source host sends the status information of host virtual machine to destination host, until after receiving the confirmation response of destination host transmission, just can recover host virtual machine to run, cause the overlong time suspending host virtual machine, calculated performance difference is compared, the tolerant system that the embodiment of the present invention provides, can by the status information of virtual machine stored in storer, then start host virtual machine to run, when described host virtual machine is in running status, the status information obtaining host virtual machine again from storer is carried out synchronously, like this, shorten the time out of host virtual machine, thus improve the calculated performance of host virtual machine.
Alternatively, described source host 2 also for: suspend described host virtual machine, and by during the storer of the status information of described host virtual machine stored in described source host or afterwards, the network packet exported for described host virtual machine arranges mark, described mark be used to indicate described network packet for host virtual machine described in last time start after and network packet that in time interval of suspending of host virtual machine described in this, described host virtual machine produces;
Receive the acknowledge message that described destination host sends, described acknowledge message is used to indicate the status information that described destination host has received described host virtual machine, according to described acknowledge message, the network packet being provided with described mark is exported from described source host.
In the embodiment of the present invention, the network packet of release mark refers to and the network packet of mark is exported from described source host, the network packet of these tape labels can be forwarded to object equipment by equipment such as routers and (should be noted, here object equipment is for receiving and processing the equipment of this network packet, but not has the destination host moving the virtual machine of coming in the embodiment of the present invention for host).
The network packet of tape label is exported again after receiving the confirmation message, the consistance that host virtual machine and standby virtual machine externally export can be ensured, specifically can be understood as: in the process of the status information of synchronous host virtual machine, the physical hardware of source host breaks down, standby virtual machine can regenerate the network packet identical with arranging markd network packet according to the status information of last time host virtual machine synchronously, these identical network packet are outwards exported by destination host, markd network packet is set will be dropped along with the fault of source host physical hardware on source host, thus ensure the continuity to the object device data reception receiving these network packet, the network packet of repetition can not be received, if after source host receives the confirmation message, the physical hardware of source host breaks down, then destination host can take over the work of host virtual machine according to the status information of the host virtual machine of just synchronously having come, can not produce again in source host and markd network packet is set, but produced network packet of reruning after generation virtual machine activation, like this, the network packet of tape label is outputted to object equipment by source host after receiving the confirmation message, still can keep the continuity that object device data receives.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is that the hardware (such as processor) that can carry out instruction relevant by program has come, this program can be stored in a computer-readable recording medium, and storage medium can comprise: ROM, RAM, disk or CD etc.
Synchronous to the status information of the virtual machine that the embodiment of the present invention provides above method, device and system are described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.