WO2016184320A1 - 在线升级机器虚拟器的方法与设备 - Google Patents

在线升级机器虚拟器的方法与设备 Download PDF

Info

Publication number
WO2016184320A1
WO2016184320A1 PCT/CN2016/081253 CN2016081253W WO2016184320A1 WO 2016184320 A1 WO2016184320 A1 WO 2016184320A1 CN 2016081253 W CN2016081253 W CN 2016081253W WO 2016184320 A1 WO2016184320 A1 WO 2016184320A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
machine
memory
specified memory
specified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/081253
Other languages
English (en)
French (fr)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2016184320A1 publication Critical patent/WO2016184320A1/zh
Priority to US15/813,039 priority Critical patent/US11487523B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

Definitions

  • the present invention relates to the field of computers, and in particular, to a technology for upgrading a machine virtual machine online.
  • QEMU machine virtual machine
  • a host such as Linux
  • QEMU processes can be run on one host.
  • Each VCPU (Virtual CPU) of the virtual machine corresponds to one thread of the QEMU process.
  • the QEMU process requests the memory used by the virtual machine on the host.
  • QEMU is also responsible for the simulation of virtual machine devices (such as network card, mouse, disk, etc.), so QEMU is a very important component in KVM virtualization.
  • the QEMU component is hot upgraded under KVM virtualization (that is, online upgrade without shutting down the virtual machine), making rapid iteration of QEMU components possible, in order to introduce new features, fix vulnerabilities, and so on.
  • KVM virtualization that is, online upgrade without shutting down the virtual machine
  • hot upgrade of QEMU components has always been an industry problem.
  • hot migration is a relatively mature technology, in which hot migration refers to migrating a virtual machine from one physical machine to another without shutting down.
  • hot migration refers to migrating a virtual machine from one physical machine to another without shutting down.
  • To upgrade QEMU you can migrate the virtual machine to the local machine and use the upgraded QEMU to migrate the destination VM. After the hot migration is completed, QEMU is upgraded.
  • copying memory is divided into two steps: (1) iteratively copying the source virtual machine memory "dirty page" (meaning that it is not copied to the destination virtual machine or copied to the destination virtual machine) The memory page modified by the source virtual machine is transferred to the destination virtual machine until the number of remaining dirty pages is less than a certain value; (2) the virtual machine is suspended, and the remaining "dirty pages" are copied to the destination virtual machine. If the memory pressure in the virtual machine is large and new dirty pages are generated, the first step may not converge, and the hot migration time will be long or fail.
  • the ID of the QEMU process changes after the hot migration is completed, which may cause unnecessary troubles, such as virtual machine physical CPU utilization (that is, CPU utilization of the QEMU process).
  • the correspondence between the virtual machine name and the QEMU process ID has also changed. This must be considered in the tool.
  • libvirt a mainstream virtualization feature and virtual machine management software
  • does not support local to local hot migration although QEMU itself supports it
  • a method for online upgrade of a machine virtual machine includes: applying a specified memory, the designated memory is not released when the machine virtual machine is updated; suspending the virtual machine operation, And saving related information of the virtual machine to the specified memory; upgrading the machine virtual machine, and transmitting the address of the specified memory as a new parameter to the machine virtual machine; and restoring the virtual Status information of the machine and resume the operation of the virtual machine.
  • the related information of the virtual machine includes: status information of the virtual machine, the virtual machine memory address information, and the virtual machine memory address information.
  • the specified memory is not released when the machine virtual machine is updated, including: modifying a kernel of the host to support a function of not releasing memory when updating the machine virtual machine; and updating the machine virtual machine When requesting a piece of specified memory, the specified memory is not released when the machine virtual machine is updated.
  • the method further includes: writing the content of the unwritten disk in the block device simulated by the current machine virtual machine to the disk after suspending the running of the virtual machine and before saving the related information of the virtual machine.
  • the status information of the virtual machine includes: current status information of all devices that need to be saved by the machine virtual machine.
  • the device that needs to save the state includes any one of a mouse, a keyboard, a cpu, a serial port, and a disk device, or a combination thereof.
  • upgrading the machine virtual machine includes: updating the machine virtual machine executable program and all parameters with an execution module, and adding an address parameter of the specified memory.
  • the method further includes running the upgraded machine virtual machine after upgrading the machine virtual machine.
  • the running the machine virtual machine includes: initializing the upgraded machine virtual machine, and using the virtual machine memory address saved in the specified memory when requesting memory for the virtual machine .
  • restoring the state information of the virtual machine includes: recovering state information of the virtual machine from the specified memory.
  • the method further includes releasing the designated memory after restoring the running of the virtual machine.
  • an apparatus for online upgrade of a machine virtual machine comprising: first means for requesting a specified memory, the designated memory is not updated when the machine virtual machine is updated Is released; a second device, configured to suspend virtual machine operation, and save related information of the virtual machine to the specified memory; and third device, configured to upgrade the machine virtual device, and the specified memory The address is passed into the machine virtual machine as a new parameter; and a fourth device is configured to restore state information of the virtual machine and resume the virtual machine operation.
  • the related information of the virtual machine includes: status information of the virtual machine, the virtual machine memory address information, and the virtual machine memory address information.
  • the first device includes: a first unit, configured to modify a kernel of the host to support a function of not releasing memory when updating the machine virtual machine; and a second unit for updating the machine virtual machine When a piece of specified memory is requested, the specified memory is not released when the machine virtual machine is updated.
  • the second device includes: a third unit, configured to: before the running of the virtual machine is suspended and before saving the related information of the virtual machine, the block device simulated by the current machine virtual machine is not written to the disk. The content is written to disk.
  • the status information of the virtual machine includes: current status information of all devices that need to be saved by the machine virtual machine.
  • the device that needs to save the state includes any one of a mouse, a keyboard, a cpu, a serial port, and a disk device, or a combination thereof.
  • the third device includes: a fourth unit, configured to update the machine virtual machine executable program and all parameters by using an execution module, and add an address parameter of the specified memory.
  • the device further includes: a fifth device, configured to run the upgraded machine virtual machine after upgrading the machine virtual machine.
  • the fifth device includes: a fifth unit, configured to initialize the upgraded machine virtual machine, and use the virtual machine memory address saved in the specified memory when requesting memory for the virtual machine .
  • the fourth device includes: a sixth unit, configured to recover status information of the virtual machine from the specified memory.
  • the device further includes: a sixth device, after releasing the virtual machine, releasing the Specify the memory.
  • an embodiment of the present application applies a specified memory for saving a memory address and status information of a virtual machine, and the specified memory is not released in the update machine virtual machine, After the machine virtual machine is upgraded, the state information of the virtual machine can be directly recovered from the specified memory, thereby speeding up the recovery, shortening the upgrade time, and transmitting the address of the specified memory as a new parameter to the machine.
  • the virtual machine which enables online upgrade (hot upgrade) of the machine virtual machine.
  • the upgrade time can be controlled to be about 100ms to 200ms. The user is not perceived, thereby improving the user experience.
  • FIG. 1 shows a schematic diagram of an apparatus for online upgrade of a machine virtual machine in accordance with an embodiment of an aspect of the present application
  • FIG. 2 shows a first apparatus diagram of an apparatus for online upgrade of a machine virtual machine in accordance with a preferred embodiment of an aspect of the present application
  • FIG. 3 shows a schematic diagram of an apparatus for online upgrade of a machine virtual machine in accordance with a preferred embodiment of an aspect of the present application
  • FIG. 4 shows a flow chart of a method for online upgrade of a machine virtual machine in accordance with another aspect of the present application
  • FIG. 5 shows a flow chart of a method for online upgrade of a machine virtual machine in accordance with a preferred embodiment of another aspect of the present application
  • FIG. 6 shows a flow chart of a method of online upgrading a machine virtual machine in accordance with an embodiment of another aspect of the present application.
  • the apparatus 1 shows an apparatus 1 for online upgrade of a machine virtual machine, wherein the apparatus 1 comprises a first device 11, a second device 12, a third device 13, and a fourth device 14, in accordance with an embodiment of an aspect of the present application.
  • the first device 11 applies for a specified memory, and the specified memory is not released when the machine virtual machine is updated; the second device 12 suspends the virtual machine operation, and saves related information of the virtual machine to In the specified memory; the third device 13 upgrades the machine virtual machine, and transmits the address of the specified memory as a new parameter to the machine virtual machine; the fourth device 14 restores the virtual Status information of the machine and resume the operation of the virtual machine.
  • the device 1 includes, but is not limited to, a user equipment, a network device, or a device formed by integrating a user equipment and a network device through a network.
  • the user equipment includes, but is not limited to, any mobile electronic product that can interact with a user through a touchpad, such as a smart phone, a PDA, etc., and the mobile electronic product can adopt any operating system, such as an android operating system. iOS operating system, etc.
  • the network device includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), and a programmable gate. Arrays (FPGAs), digital processors (DSPs), embedded devices, and more.
  • the network device includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a plurality of servers; wherein the cloud is composed of a large number of computers or network servers based on Cloud Computing Among them, cloud computing is a kind of distributed computing, a virtual supercomputer composed of a group of loosely coupled computers.
  • the network includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless ad hoc network (Ad Hoc network), and the like.
  • the device 1 may also be a script program running on the user equipment, the network device, or the user equipment and the network device, the network device, the touch terminal, or the network device and the touch terminal integrated through the network.
  • the above-mentioned device 1 is only an example, and other existing or future devices 1 may be applicable to the present application, and are also included in the protection scope of the present application, and are hereby incorporated by reference. Included here.
  • continuous refers to the above-mentioned devices respectively in real time or in accordance with set or real-time adjusted working mode requirements, such as the first device.
  • the designated memory is not released when the machine virtual machine is updated, and the second device 12 continuously suspends the running of the virtual machine, and saves related information of the virtual machine to the designated memory,
  • the third device 13 continuously upgrades the machine virtual machine, and transmits the address of the specified memory as a new parameter to the machine virtual machine
  • the fourth device 14 continuously restores the state information of the virtual machine. And resume the virtual machine operation until the device 1 stops working.
  • the first device 11 applies for a specified memory that is not released when the machine virtual machine is updated.
  • the specified memory refers to the virtual machine memory and the virtual machine memory when the machine virtual machine is updated. Specify memory that is not released outside. This specified memory is used to save the virtual machine's memory address and status information when the machine virtual machine is subsequently updated.
  • the specified memory is the memory that can be released when the machine virtual machine is updated.
  • the method of not exposing the tag to indicate the specified memory only needs to modify the kernel's memory request system call, and the description structure of the specified memory allocated for the application that is not released when the machine virtualizer is updated is updated. Add a flag that is not released. (The memory is recognized when the exec function is called so that they are not released) The modification is simple without increasing the processing pressure of the device. Of course, those skilled in the art should be able to understand that other methods capable of specifying a memory so that the memory can not be released when updating the machine virtual device, as applicable to the present application, are also included in the scope of protection of the present application. The reference is included here.
  • the first device 11 may include a first unit 111 and a second unit 112.
  • the first unit is configured to modify a kernel of the host to support a function of not releasing memory when updating the machine virtual machine; and the second unit is configured to apply for a specified memory when the machine virtual machine is to be updated, The specified memory is not released when the machine virtual machine is updated.
  • the host when the virtual machine is started, the host also requests the virtual machine for a memory and video memory that are not released when the machine virtual machine is updated.
  • each virtual machine corresponds to one QEMU process.
  • the kernel maintains each memory area requested by the QEMU process with the vm_flags parameter.
  • a bit of the parameter stipulated by this parameter indicates whether the memory is released when the machine virtual machine is updated.
  • an anonymous mmap is applied for memory, a flag that is not released when the machine virtualizer is updated is received.
  • the kernel allocates memory, the flag of the vm_flags member of the corresponding description structure of the memory is set to 1.
  • the second device 12 suspends the virtual machine operation and saves related information of the virtual machine into the designated memory.
  • the related information of the virtual machine includes: status information of the virtual machine, the virtual machine memory address information, and the virtual machine memory address information.
  • the state information of the virtual machine includes all the states that need to be saved simulated by the machine virtual machine.
  • the current status information of the device includes all the states that need to be saved simulated by the machine virtual machine.
  • the device that needs to save the state includes any one of a mouse, a keyboard, a cpu, a serial port, and a disk device, or a combination thereof.
  • QEMU Machine Virtual Machine
  • PC Personal Computer
  • QEMU can implement standard peripheral devices including hardware VGA (Video Graphics Array) emulator, PS/2 mouse and keyboard, integrated development environment (IDE) hard disk and CD-ROM (disc read-only memory) interface, and Simulation of floppy disks, etc.
  • VGA Video Graphics Array
  • IDE integrated development environment
  • CD-ROM disc read-only memory
  • Simulation of floppy disks etc.
  • QEMU can also implement simulations including NE2000PCI (Peripheral Controller Interconnect) network adapters, serial ports, a large number of sound cards, and virtual USB (Universal Serial Bus) hubs.
  • NE2000PCI Peripheral Controller Interconnect
  • QEMU can also emulate other non-PC hardware, such as the General ARM (Advanced RISC Machine) baseline board and the MIPS (Million Instructions Per Second) board. Therefore, all the devices that need to be saved in the above-mentioned machine virtual machine are only examples. Other devices that are simulated by existing or future machine virtual machines may be applicable to the present application and should also be included in the scope of protection of the present application. It is hereby incorporated by reference.
  • the second device may comprise a third unit (not shown).
  • the third unit writes the content of the unwritten disk in the block device simulated by the current machine virtual machine to the disk after suspending the running of the virtual machine and before saving the related information of the virtual machine.
  • the QEMU process does not have the memory that is not released when the QEMU process is updated, because when the machine virtual machine is updated, except for the virtual machine memory, the virtual machine memory, and the marked specified memory. Memory will be released.
  • the contents of the memory that are not written to the disk are stored in time, for example, the contents of the unwritten disk are written to a disk or other storage device, and the contents stored in the memory are lost after the QEMU process is updated.
  • the third device 13 upgrades the machine virtual machine and transmits the address of the specified memory as a new parameter to the machine virtual machine.
  • the third device 13 may include a fourth unit (not shown).
  • the third unit is used for profit Updating the machine virtual machine executable program and all parameters with an execution module and adding an address parameter of the specified memory.
  • the execution module may be an exec function family, and the function of the exec function family is to find an executable file according to the specified file name, and use it to replace the content of the calling process, in other words, inside the calling process.
  • the parameter may be a parameter passed in when the QEMU process starts, and an address parameter of a specified memory that saves information about the virtual machine is added.
  • the fourth device 14 restores state information of the virtual machine and resumes operation of the virtual machine.
  • the virtual machine operation is suspended from the second device 12, and the fourth device 14 restores the state information of the virtual machine, and resumes the virtual machine operation, only takes 100ms to 200ms, the machine
  • the hot upgrade of the virtual machine that is, the online upgrade without shutting down the virtual machine
  • the user can be made without awareness, which greatly improves the user experience.
  • the fourth device 14 may include a sixth unit (not shown).
  • the fourth unit is configured to recover status information of the virtual machine from the specified memory.
  • FIG 3 shows an apparatus 1' for online upgrade of a machine virtual machine in accordance with a preferred embodiment of an aspect of the present application, wherein the apparatus 1' includes a first device 11', a second device 12', a third device 13', fourth device 14' and fifth device 15'.
  • the first device 11', the second device 12', the third device 13', and the fourth device 14' are the first device 11, the second device 12, the third device 13, and the fourth device in FIG.
  • the contents of 14 are the same or substantially the same, and will not be repeated here for the sake of brevity.
  • the fifth device 15' is configured to run the upgraded machine virtual machine after upgrading the machine virtual machine.
  • the fifth device includes: a fifth unit (not shown), configured to initialize the upgraded machine virtual machine, and save the specified memory when requesting memory for the virtual machine Virtual machine memory address.
  • the exec function family is a cluster function that replaces the current process image with a new program file, and the program starts execution from the main function.
  • the third device 13 transmits all the parameters of the original QEMU process and the address of the newly specified parameter to the memory to the QEMU (machine virtual machine).
  • New QEMU executable The sequence restarts from the main function and performs various initialization operations. If the address of the specified memory is passed in the parameter, the memory address of the virtual machine stored in the specified memory is used when the memory is requested for the virtual machine.
  • the application, and the virtual machine memory is not released when the exec function is called to initialize and re-run the upgraded executable program of the machine virtual machine, which is why the application can realize the QEMU upgrade without copying the memory. .
  • the upgrade success rate is greatly improved.
  • the virtual machine state is restored according to the state information of the virtual machine stored in the specified memory.
  • the device 1 may further include a sixth device (not shown).
  • the sixth device is configured to release the designated memory after restoring the running of the virtual machine.
  • FIG. 4 shows a flow chart of a method of online upgrading a machine virtual machine in accordance with another aspect of the present application.
  • the method includes step S41, step S42, step S43, and step S44.
  • step S41 the device 1 applies for a specified memory, the designated memory is not released when the machine virtual machine is updated; in step S42, the device 1 suspends the virtual machine operation, and the related information of the virtual machine Saving in the specified memory; in step S43, the device 1 upgrades the machine virtual machine, and transmits the address of the specified memory as a new parameter to the machine virtual machine; in step S44, the device 1 Restore state information of the virtual machine and resume running the virtual machine.
  • the device 1 includes, but is not limited to, a user equipment, a network device, or a device formed by integrating a user equipment and a network device through a network.
  • the user equipment includes, but is not limited to, any mobile electronic product that can interact with a user through a touchpad, such as a smart phone, a PDA, etc., and the mobile electronic product can adopt any operating system, such as an android operating system. iOS operating system, etc.
  • the network device includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), and a programmable gate. Arrays (FPGAs), digital processors (DSPs), embedded devices, and more.
  • the network device includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a plurality of servers; wherein the cloud is composed of a large number of computers or network servers based on Cloud Computing , in which cloud computing is a kind of distributed computing, consisting of a group of loosely coupled A virtual supercomputer consisting of a set of computers.
  • the network includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless ad hoc network (Ad Hoc network), and the like.
  • the device 1 may also be a script program running on the user equipment, the network device, or the user equipment and the network device, the network device, the touch terminal, or the network device and the touch terminal integrated through the network.
  • the above-mentioned device 1 is only an example, and other existing or future devices 1 may be applicable to the present application, and are also included in the protection scope of the present application, and are hereby incorporated by reference. Included here.
  • step S41 the device 1 continues to apply for a specified memory, the designated memory is not released when the machine virtual machine is updated, and in step S42, the device 1 continuously suspends the virtual machine operation, and the virtual machine is suspended.
  • the related information is saved in the specified memory.
  • step S43 the device 1 continuously upgrades the machine virtual machine, and the address of the specified memory is added to the machine virtual machine as a new parameter, in step S44.
  • the device 1 continuously restores the state information of the virtual machine and resumes the operation of the virtual machine until the device 1 stops working.
  • step S41 the device 1 applies for a designated memory that is not released when the machine virtual machine is updated.
  • the specified memory refers to a memory that can be specified not to be released except for virtual machine memory and virtual machine memory when the machine virtual machine is updated. This specified memory is used to save the virtual machine's memory address and status information when the machine virtual machine is subsequently updated.
  • the specified memory is the memory that can be released when the machine virtual machine is updated.
  • the method of not exposing the tag to indicate the specified memory only needs to modify the kernel's memory request system call, and the description structure of the specified memory allocated for the application that is not released when the machine virtualizer is updated is updated. Add a flag that is not released. (The memory is recognized when the exec function is called so that they are not released) The modification is simple without increasing the processing pressure of the device. Of course, those skilled in the art should be able to understand that other methods capable of specifying a memory so that the memory can not be released when updating the machine virtual device, as applicable to the present application, are also included in the scope of protection of the present application. The reference is included here.
  • step S41 the device 1 modifies the kernel of the host to support the function of not releasing the memory when updating the machine virtual machine; and when the machine virtual machine is to be updated, applying a specified memory, the specified memory is The machine virtualizer is not released when it is updated.
  • the host when the virtual machine is started, the host also requests the virtual machine for a memory and video memory that are not released when the machine virtual machine is updated.
  • each virtual machine corresponds to one QEMU process.
  • the kernel maintains the QEMU process application
  • Each memory area has a vm_flags parameter, and a bit of the parameter stipulated by this parameter indicates whether the memory is released when the machine virtual machine is updated.
  • a flag that is not released when the machine virtualizer is updated is received.
  • the kernel allocates memory, the flag of the vm_flags member of the corresponding description structure of the memory is set to 1.
  • step S42 the device 1 suspends the virtual machine operation and saves the related information of the virtual machine into the designated memory.
  • the related information of the virtual machine includes: status information of the virtual machine, the virtual machine memory address information, and the virtual machine memory address information.
  • the state information of the virtual machine includes current state information of all devices that need to be saved by the machine virtual machine.
  • the device that needs to save the state includes any one of a mouse, a keyboard, a cpu, a serial port, and a disk device, or a combination thereof.
  • QEMU Machine Virtual Machine
  • PC Personal Computer
  • QEMU can implement standard peripheral devices including hardware VGA (Video Graphics Array) emulator, PS/2 mouse and keyboard, integrated development environment (IDE) hard disk and CD-ROM (disc read-only memory) interface, and Simulation of floppy disks, etc.
  • VGA Video Graphics Array
  • IDE integrated development environment
  • CD-ROM disc read-only memory
  • Simulation of floppy disks etc.
  • QEMU can also implement simulations including NE2000PCI (Peripheral Controller Interconnect) network adapters, serial ports, a large number of sound cards, and virtual USB (Universal Serial Bus) hubs.
  • NE2000PCI Peripheral Controller Interconnect
  • QEMU can also emulate other non-PC hardware, such as the General ARM (Advanced RISC Machine) baseline board and the MIPS (Million Instructions Per Second) board. Therefore, all the devices that need to be saved in the above-mentioned machine virtual machine are only examples. Other devices that are simulated by existing or future machine virtual machines may be applicable to the present application and should also be included in the scope of protection of the present application. It is hereby incorporated by reference.
  • step S42 the device 1 pauses the operation of the virtual machine and saves the phase of the virtual machine. Before the information is turned off, the contents of the unwritten disk in the block device simulated by the current machine virtual machine are written to the disk.
  • the QEMU process does not have the memory that is not released when the QEMU process is updated, because when the machine virtual machine is updated, except for the virtual machine memory, the virtual machine memory, and the marked specified memory. Memory will be released.
  • the contents of the memory that are not written to the disk are stored in time, for example, the contents of the unwritten disk are written to a disk or other storage device, and the contents stored in the memory are lost after the QEMU process is updated.
  • step S43 the device 1 upgrades the machine virtual machine and passes the address of the specified memory as a new parameter to the machine virtual machine.
  • step S43 the device 1 updates the machine virtual machine executable program and all parameters with an execution module, and adds an address parameter of the specified memory.
  • the execution module may be an exec function family, and the function of the exec function family is to find an executable file according to the specified file name, and use it to replace the content of the calling process, in other words, inside the calling process.
  • the parameter may be a parameter passed in when the QEMU process starts, and an address parameter of a specified memory that saves information about the virtual machine is added.
  • step S44 the device 1 restores the state information of the virtual machine and resumes the virtual machine operation.
  • the device 1 suspends the virtual machine operation from step S42, and the device 1 restores the state information of the virtual machine, and restores the virtual machine running, only 100ms to 200ms, and the machine virtual machine is hot upgraded. (Only online upgrade without shutting down the virtual machine) The time is short, and the user can be made without perception, which greatly improves the user experience.
  • step S44 the device 1 recovers state information of the virtual machine from the specified memory.
  • FIG. 5 illustrates a flow chart of a method of online upgrading a machine virtual machine in accordance with a preferred embodiment of an aspect of the present application.
  • the method includes a step S41', a step S42', a step S43', a step S45', and a step S44', wherein
  • the content of the step S41', the step S42', the step S43', and the step S44' is the same as or substantially the same as the content of the step S41, the step S42, the step S43, and the step S44 in FIG. 4.
  • details are not described herein again.
  • step S45' the device 1 runs the upgraded machine virtual machine after upgrading the machine virtual machine.
  • the running the upgraded machine virtual machine includes: initializing the upgraded machine virtual machine, and using a virtual machine memory address saved in the specified memory when requesting memory for the virtual machine.
  • the exec function family is a cluster function that replaces the current process image with a new program file, and the program starts execution from the main function.
  • the device 1 passes all the parameters of the original QEMU process and the address of the newly specified parameter specified memory to the QEMU (machine virtual machine).
  • the new QEMU executable program restarts from the main function and performs various initialization operations. If the address of the specified memory is passed in the parameter, the virtual machine memory address stored in the specified memory is used when requesting memory from the virtual machine.
  • the method may further include: the device 1 releasing the specified memory after restoring the running of the virtual machine.
  • FIG. 6 shows a flow chart of a method of online upgrading a machine virtual machine in accordance with an embodiment of another aspect of the present application. Applying the method provided in this application to online upgrade the machine virtual machine under KVM virtualization can adopt the following processing flow:
  • Step S61 applying a specified memory, the specified memory is not released when the machine virtual machine is updated.
  • the specified memory is incremented with a flag that causes the specified memory to not be released when the machine virtualizer is updated.
  • step S62 the virtual machine operation is suspended.
  • step S63 the content of the unwritten disk in the block device simulated by the current machine virtual machine is written to the disk.
  • Step S64 saving related information of the virtual machine into the designated memory.
  • the related information of the virtual machine includes: state information of the virtual machine, the virtual machine memory address information, and the virtual machine memory address information.
  • step S65 the machine virtual machine is upgraded, and the address of the specified memory is introduced into the machine virtual machine as a new parameter.
  • the execution module updates the machine virtual machine executable program and all parameters to achieve the purpose of upgrading the machine virtual machine.
  • Step S66 restoring the state information of the virtual machine from the specified memory.
  • the upgraded machine virtual machine is run to initialize the upgraded machine virtual machine, and when the memory is requested for the virtual machine, the virtual machine memory address saved in the specified memory is used.
  • step S67 the virtual machine is resumed.
  • step S68 the specified memory applied in step S51 is released.
  • an embodiment of the present application applies a specified memory, which is used to save a memory address and status information of a virtual machine, and the specified memory is not updated in the machine virtual machine.
  • the state information of the virtual machine can be directly recovered from the specified memory, thereby speeding up the recovery, shortening the upgrade time, and using the address of the specified memory as a new parameter. Passing in the machine virtual machine can increase the success rate of the upgrade and reduce the burden on the developer.
  • the upgrade process can be made not perceived by the user, thereby improving the user experience.
  • the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic box magnetic A tape, tape storage or other magnetic storage device or any other non-transporting medium that can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • the present application can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • the software program of the present application can be executed by a processor to implement the steps or functions described above.
  • the software programs (including related data structures) of the present application can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
  • some of the steps or functions of the present application may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
  • a portion of the present application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or technical solution in accordance with the present application.
  • the program instructions for invoking the method of the present application may be stored in a fixed or removable recording medium, and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run.
  • an embodiment in accordance with the present application includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
  • the apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

一种在线升级机器虚拟器的方法与设备,所述方法与设备申请一指定内存,该指定内存用于保存虚拟机的内存地址和状态信息,且该指定内存在更新机器虚拟器中不被释放,则在机器虚拟器升级之后,所述虚拟机的状态信息可以直接从该指定内存中恢复,从而加快了恢复速度、缩短了升级时间,并且将所述指定内存的地址作为新增参数传入所述机器虚拟器,从而实现了机器虚拟器的在线升级(热升级)。此外,通过在机器虚拟器更新过程中,利用执行模块更新机器虚拟器的可执行文件来实现机器虚拟器原地(即进程ID不变)在线升级,能够使升级时间控制在100ms~200ms左右,做到用户无感知,进而提高用户的使用体验。

Description

在线升级机器虚拟器的方法与设备
本申请要求2015年05月15日递交的申请号为201510249389.8、发明名称为“在线升级机器虚拟器的方法与设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机领域,尤其涉及一种在线升级机器虚拟器的技术。
背景技术
在KVM(Kernel-based Virtual Machine,基于内核虚拟机)虚拟化中,QEMU(机器虚拟器)是运行在主机(Host,例如Linux)上的进程,因此相当于虚拟机的容器。其中,在一个主机上可以运行一个或多个QEMU进程,虚拟机的每个VCPU(Virtual CPU,虚拟中央处理器)对应QEMU进程的一个线程。QEMU进程在主机上申请虚拟机所使用的内存,同时QEMU还负责虚拟机设备(如网卡、鼠标、磁盘等)的模拟,所以QEMU是KVM虚拟化中非常重要的组件。
在KVM虚拟化下热升级(即在不关闭虚拟机的情况下在线升级)QEMU组件,使得QEMU组件的快速迭代变得可能,以便于引入新特性、修复漏洞等。然而QEMU组件热升级一直是业界难题,目前业界还没有QEMU热升级技术,最接近的现有方案是热迁移技术。在KVM虚拟化中,热迁移是比较成熟的技术,其中,热迁移指在不关机的情况下将一台虚拟机从一台物理机迁移到另一台物理机。若要升级QEMU,可以通过将虚拟机进行一次本机到本机的迁移,迁移目的虚拟机使用升级过的QEMU,这样热迁移完成后,QEMU就得到了升级。
利用热迁移技术方案升级QEMU组件存在不少缺陷。第一,该方案需要拷贝内存,目前的热迁移中拷贝内存分为两个步骤:(1)迭代地拷贝源虚拟机内存“脏页”(指没拷贝到目的虚拟机或者在拷贝到目的虚拟机后又被源虚拟机修改过的内存页)到目的虚拟机,直到剩余脏页数小于一定值;(2)暂停虚拟机,将剩余“脏页”拷贝到目的虚拟机。如果虚拟机中内存压力很大,不断产生新的脏页,第一步可能收敛不了,热迁移时间就会很长或者失败。第二,热迁移完成后QEMU进程的ID会改变,这可能会造成一些不必要的麻烦,比如虚拟机物理CPU利用率(即QEMU进程的CPU利用率)监控工 具,在QEMU进程ID变过后,虚拟机名和QEMU进程ID对应关系也改变了,工具中必须要考虑这种情况。第三,libvirt(一款主流的虚拟化功能和虚拟机管理软件)不支持本地到本地的热迁移(尽管QEMU本身支持),需要对libvirt进行较大的修改以使其支持本地到本地的热迁移。由此可见,使用现有技术方案升级QEMU组件成功率不高,会给开发者带来不少麻烦,且升级时间长,影响用户体验。
发明内容
本申请的一个目的是提供一种在线升级机器虚拟器的方法与设备。
根据本申请的一个方面,提供了一种在线升级机器虚拟器的方法,其中,所述方法包括:申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;以及恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
进一步地,所述虚拟机的相关信息包括:所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
进一步地,申请一指定内存,所述指定内存在更新机器虚拟器时不被释放包括:对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;以及将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
进一步地,所述方法还包括:在暂停所述虚拟机运行之后及保存所述虚拟机的相关信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
进一步地,所述虚拟机的状态信息包括:所述机器虚拟器所模拟的所有需要保存状态的设备的当前的状态信息。
进一步地,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
进一步地,对机器虚拟器进行升级包括:利用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
进一步地,所述方法还包括:在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
进一步地,所述运行升级后的所述机器虚拟器包括:对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用所述指定内存中保存的虚拟机内存地址。
进一步地,恢复所述虚拟机的状态信息包括:从所述指定内存中恢复所述虚拟机的状态信息。
进一步地,所述方法还包括:在恢复所述虚拟机运行之后,释放所述指定内存。
根据本申请的另一方面,还提供了一种在线升级机器虚拟器的设备,其中,所述设备包括:第一装置,用于申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;第二装置,用于暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;第三装置,用于对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;以及第四装置,用于恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
进一步地,所述虚拟机的相关信息包括:所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
进一步地,所述第一装置包括:第一单元,用于对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;以及第二单元,用于将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
进一步地,所述第二装置包括:第三单元,用于在暂停所述虚拟机运行之后及保存所述虚拟机的相关信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
进一步地,所述虚拟机的状态信息包括:所述机器虚拟器所模拟的所有需要保存状态的设备的当前的状态信息。
进一步地,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
进一步地,所述第三装置包括:第四单元,用于利用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
进一步地,所述设备还包括:第五装置,用于在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
进一步地,所述第五装置包括:第五单元,用于对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用所述指定内存中保存的虚拟机内存地址。
进一步地,所述第四装置包括:第六单元,用于从所述指定内存中恢复所述虚拟机的状态信息。
进一步地,所述设备还包括:第六装置,用于在恢复所述虚拟机运行之后,释放所 述指定内存。
与现有技术相比,本申请的一个实施例通过申请一指定内存,该指定内存用于保存虚拟机的内存地址和状态信息,且该指定内存在更新机器虚拟器中不被释放,则在机器虚拟器升级之后,所述虚拟机的状态信息可以直接从该指定内存中恢复,从而加快了恢复速度、缩短了升级时间,并且将所述指定内存的地址作为新增参数传入所述机器虚拟器,从而实现了机器虚拟器的在线升级(热升级)。此外,通过在机器虚拟器更新过程中,利用执行模块更新机器虚拟器的可执行文件来实现机器虚拟器原地(即进程ID不变)在线升级,能够使升级时间控制在100ms~200ms左右,做到用户无感知,进而提高用户的使用体验。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:
图1示出根据本申请一个方面的一个实施例的一种在线升级机器虚拟器的设备示意图;
图2示出根据本申请一个方面的一个优选实施例的一种在线升级机器虚拟器的设备的第一装置示意图;
图3示出根据本申请一个方面的一个优选实施例的一种在线升级机器虚拟器的设备示意图;
图4示出根据本申请另一个方面的一种在线升级机器虚拟器的方法流程图;
图5示出根据本申请另一个方面的一个优选实施例的一种在线升级机器虚拟器的方法流程图;
图6示出根据本申请另一个方面的一个实施例的一种在线升级机器虚拟器的方法流程图。
附图中相同或相似的附图标记代表相同或相似的部件。
具体实施方式
下面结合附图对本申请作进一步详细描述。
图1示出根据本申请一个方面的一个实施例的一种在线升级机器虚拟器的设备1,其中,设备1包括第一装置11、第二装置12、第三装置13和第四装置14。
具体地,所述第一装置11申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;所述第二装置12暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;所述第三装置13对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;所述第四装置14恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
在此,所述设备1包括但不限于用户设备、网络设备、或用户设备与网络设备通过网络相集成所构成的设备。所述用户设备其包括但不限于任何一种可与用户通过触摸板进行人机交互的移动电子产品,例如智能手机、PDA等,所述移动电子产品可以采用任意操作系统,如android操作系统、iOS操作系统等。其中,所述网络设备包括一种能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述网络设备其包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云;在此,云由基于云计算(Cloud Computing)的大量计算机或网络服务器构成,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个虚拟超级计算机。所述网络包括但不限于互联网、广域网、城域网、局域网、VPN网络、无线自组织网络(Ad Hoc网络)等。优选地,设备1还可以是运行于所述用户设备、网络设备、或用户设备与网络设备、网络设备、触摸终端或网络设备与触摸终端通过网络相集成所构成的设备上的脚本程序。当然,本领域技术人员应能理解上述设备1仅为举例,其他现有的或今后可能出现的设备1如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
上述各装置之间是持续不断工作的,在此,本领域技术人员应理解“持续”是指上述各装置分别实时地或者按照设定的或实时调整的工作模式要求,例如所述第一装置11持续申请一指定内存,所述指定内存在更新机器虚拟器时不被释放,所述第二装置12持续暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中,所述第三装置13持续对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中,所述第四装置14持续恢复所述虚拟机的状态信息,并恢复所述虚拟机运行,直至所述设备1停止工作。
首先,所述第一装置11申请一指定内存,所述指定内存在更新机器虚拟器时不被释放。
在此,所述指定内存指的是能够在在更新机器虚拟器时,虚拟机内存、虚拟机显存 以外指定不被释放的内存。该指定内存用于在后续更新机器虚拟器时保存虚拟机的内存地址和状态信息。在此,指定内存为能够在更新机器虚拟器时不被释放的内存。
在优选的实施例中,采用不被释放标记以标示指定内存的方法只需修改内核的内存申请系统调用,对带有更新机器虚拟器时不被释放标记的申请在分配的指定内存的描述结构中增加一不被释放标记。(在调用exec函数时识别出这些内存从而不释放它们的)修改方式简单不增加设备处理压力。当然本领域技术人员应该能够理解,其他能够指定一个内存使该内存能够在更新机器虚拟器时不被释放的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
具体的,如图2所示,所述第一装置11可以包括第一单元111和第二单元112。所述第一单元用于对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;所述第二单元用于将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
在此,在启动虚拟机时,主机还会为所述虚拟机申请一个在更新机器虚拟器时不释放的内存和显存。
例如,以采用KVM/QEMU的虚拟化方案为例,每个虚拟机对应一个QEMU进程,当QEMU进程在启动时,相当于创建了一台新的虚拟机。内核维护QEMU进程申请的每个内存区域带有vm_flags参数,约定这个参数的某位标志表示该内存在更新机器虚拟器时是否被释放。通过匿名mmap申请内存时传入更新机器虚拟器时不被释放的标志,内核在分配内存时就将这块内存对应描述结构的vm_flags成员的标志位设为1。
当然,本领域技术人员应能理解上述机器虚拟器和对指定内存增加标记的方法仅为举例,其他现有的或今后可能出现的机器虚拟器或对指定内存增加标记的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
然后,所述第二装置12暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中。
具体地,所述虚拟机的相关信息包括:所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
在此,将所述虚拟机的状态信息保存至所述指定内存中,而非将虚拟机的状态信息保存至磁盘,可以在机器虚拟器升级后快速从指定内存中恢复虚拟机状态,提高了速度,节约了时间。
具体地,所述虚拟机的状态信息包括所述机器虚拟器所模拟的所有需要保存状态的 设备的当前的状态信息。
具体地,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
本领域技术人员应能理解,将QEMU(机器虚拟器)作为PC(Personal Computer,个人计算机)系统仿真器使用可提供各种外围设备。通过QEMU可以实现对标准外围设备包括硬件VGA(Video Graphics Array,视频图形阵列)仿真器、PS/2鼠标和键盘、集成开发环境(IDE)硬盘和CD-ROM(光盘只读存储器)接口,以及软盘等的仿真。另外,QEMU还可实现对包括NE2000PCI(Peripheral Controller Interconnect,外设组件互连标准)网络适配器、串行端口、大量的声卡和带虚拟USB(Universal Serial Bus,通用串行总线)集线器等的仿真。除了仿真标准PC或ISA(Industrial Standard Architecture,工业标准结构总线)PC外,QEMU还可以仿真其他非PC硬件,如通用ARM(Advanced RISC Machine)基线板和MIPS(Million Instructions Per Second)板。因此,上述机器虚拟器所模拟的所有需要保存状态的设备仅为举例,其他现有的或今后可能出现的机器虚拟器所模拟的设备如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
优选地,所述第二装置可以包括第三单元(图中未示出)。所述第三单元在暂停所述虚拟机运行之后及保存所述虚拟机的相关信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
例如,接上例,QEMU进程申请的这些不带有更新QEMU进程时不被释放标志的内存,因为在更新机器虚拟器时,除虚拟机内存、虚拟机显存和带标记的指定内存以外的其余内存均会被释放。及时存储这些内存中未写入磁盘的内容,例如将所述未写入磁盘的内容写入磁盘或其他存储设备,可以避免QEMU进程更新完成后丢失这些内存中存储的内容。
当然,本领域技术人员应能理解上述将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘的方式仅为举例,其他现有的或今后可能出现的可存储未写入内容的存储设备如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
所述第三装置13对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中。
具体地,所述第三装置13可以包括第四单元(图中未示出)。所述第三单元用于利 用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
例如,接上例,所述执行模块可以是exec函数族,exec函数族的作用是根据指定的文件名找到可执行文件,并用它来取代调用进程的内容,换句话说,就是在调用进程内部执行一个可执行文件,通过调用exec函数族可以更新QEMU进程。所述参数可以是QEMU进程启动时传入的参数,并增加一个保存了所述虚拟机相关信息的指定内存的地址参数。本领域技术人员应能理解上述更新机器虚拟器的执行模块和参数仅为举例,其他现有的或今后可能出现的更新机器虚拟器的执行模块和参数如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
所述第四装置14恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
在具体的实施例中,从所述第二装置12暂停虚拟机运行,至所述第四装置14恢复所述虚拟机的状态信息,并恢复所述虚拟机运行,只需要100ms到200ms,机器虚拟器热升级(即在不关闭虚拟机的情况下在线升级)时间短,可以做到用户无感知,极大地提高了用户体验。
具体地,所述第四装置14可以包括第六单元(图中未示出)。所述第四单元用于从所述指定内存中恢复所述虚拟机的状态信息。
图3示出根据本申请一个方面的一个优选实施例的一种在线升级机器虚拟器的设备1’,其中,所述设备1’包括第一装置11’、第二装置12’、第三装置13’、第四装置14’和第五装置15’。
在此,所述第一装置11’、第二装置12’、第三装置13’、第四装置14’与图1中第一装置11、第二装置12、第三装置13、第四装置14的内容相同或基本相同,为简明起见,在此不再赘述。
所述第五装置15’用于在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
具体地,所述第五装置包括:第五单元(图中未示出),用于对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用指定内存中保存的虚拟机内存地址。
例如,接上例,exec函数族就是一簇函数,它把当前进程映像替换成新的程序文件,而且该程序从main(主)函数开始执行。所述第三装置13将原来QEMU进程的所有参数,以及新增参数指定内存的地址,传入QEMU(机器虚拟器)。新的QEMU可执行程 序重新从main函数处开始运行,进行各项初始化操作,如果参数中有指定内存的地址传入,那么在给虚拟机申请内存时,使用指定内存中存储的虚拟机内存地址,并不需要重新申请,而虚拟机内存在调用exec函数初始化并重新运行升级后的所述机器虚拟器的可执行程序过程中不会被释放,这也正是本申请可以不需要拷贝内存而实现QEMU升级的原因。与现有的热迁移技术需要拷贝内存,在内存压力很大时容易失败相比,本申请不需拷贝内存的技术方案极大地提高了升级成功率。在各项初始化操作完成后,根据指定内存中存储的虚拟机的状态信息恢复虚拟机状态。本领域技术人员应能理解上述运行升级后的所述机器虚拟器的可执行程序的方法仅为举例,其他现有的或今后可能出现的运行升级后的所述机器虚拟器的可执行程序的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
此外,基于以上实施例,设备1还可以包括第六装置(图中未示出)。所述第六装置用于在恢复所述虚拟机运行之后,释放所述指定内存。
在此,虚拟机中机器虚拟器的在线升级完成后,及时释放已经发挥完作用的指定内存,可以节约内存存储空间,提高系统运行效率。
图4示出根据本申请另一个方面的一种在线升级机器虚拟器的方法流程图。
该方法包括步骤S41、步骤S42、步骤S43和步骤S44。具体地,在步骤S41中,设备1申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;在步骤S42中,设备1暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;在步骤S43中,设备1对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;在步骤S44中,设备1恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
在此,所述设备1包括但不限于用户设备、网络设备、或用户设备与网络设备通过网络相集成所构成的设备。所述用户设备其包括但不限于任何一种可与用户通过触摸板进行人机交互的移动电子产品,例如智能手机、PDA等,所述移动电子产品可以采用任意操作系统,如android操作系统、iOS操作系统等。其中,所述网络设备包括一种能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述网络设备其包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云;在此,云由基于云计算(Cloud Computing)的大量计算机或网络服务器构成,其中,云计算是分布式计算的一种,由一群松散耦合的 计算机集组成的一个虚拟超级计算机。所述网络包括但不限于互联网、广域网、城域网、局域网、VPN网络、无线自组织网络(Ad Hoc网络)等。优选地,设备1还可以是运行于所述用户设备、网络设备、或用户设备与网络设备、网络设备、触摸终端或网络设备与触摸终端通过网络相集成所构成的设备上的脚本程序。当然,本领域技术人员应能理解上述设备1仅为举例,其他现有的或今后可能出现的设备1如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
设备1的各个步骤之间是持续不断工作的。具体地,在步骤S41中,设备1持续申请一指定内存,所述指定内存在更新机器虚拟器时不被释放,在步骤S42中,设备1持续暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中,在步骤S43中,设备1持续对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中,在步骤S44中,设备1持续恢复所述虚拟机的状态信息,并恢复所述虚拟机运行,直至所述设备1停止工作。
首先,在步骤S41中,设备1申请一指定内存,所述指定内存在更新机器虚拟器时不被释放。
在此,所述指定内存指的是能够在在更新机器虚拟器时,虚拟机内存、虚拟机显存以外指定不被释放的内存。该指定内存用于在后续更新机器虚拟器时保存虚拟机的内存地址和状态信息。在此,指定内存为能够在更新机器虚拟器时不被释放的内存。
在优选的实施例中,采用不被释放标记以标示指定内存的方法只需修改内核的内存申请系统调用,对带有更新机器虚拟器时不被释放标记的申请在分配的指定内存的描述结构中增加一不被释放标记。(在调用exec函数时识别出这些内存从而不释放它们的)修改方式简单不增加设备处理压力。当然本领域技术人员应该能够理解,其他能够指定一个内存使该内存能够在更新机器虚拟器时不被释放的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
具体的,在步骤S41中,设备1对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;以及将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
在此,在启动虚拟机时,主机还会为所述虚拟机申请一个在更新机器虚拟器时不释放的内存和显存。
例如,以采用KVM/QEMU的虚拟化方案为例,每个虚拟机对应一个QEMU进程,当QEMU进程在启动时,相当于创建了一台新的虚拟机。内核维护QEMU进程申请的 每个内存区域带有vm_flags参数,约定这个参数的某位标志表示该内存在更新机器虚拟器时是否被释放。通过匿名mmap申请内存时传入更新机器虚拟器时不被释放的标志,内核在分配内存时就将这块内存对应描述结构的vm_flags成员的标志位设为1。
当然,本领域技术人员应能理解上述机器虚拟器和对指定内存增加标记的方法仅为举例,其他现有的或今后可能出现的机器虚拟器或对指定内存增加标记的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
然后,在步骤S42中,设备1暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中。
具体地,所述虚拟机的相关信息包括:所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
在此,将所述虚拟机的状态信息保存至所述指定内存中,而非将虚拟机的状态信息保存至磁盘,可以在机器虚拟器升级后快速从指定内存中恢复虚拟机状态,提高了速度,节约了时间。
具体地,所述虚拟机的状态信息包括所述机器虚拟器所模拟的所有需要保存状态的设备的当前的状态信息。
具体地,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
本领域技术人员应能理解,将QEMU(机器虚拟器)作为PC(Personal Computer,个人计算机)系统仿真器使用可提供各种外围设备。通过QEMU可以实现对标准外围设备包括硬件VGA(Video Graphics Array,视频图形阵列)仿真器、PS/2鼠标和键盘、集成开发环境(IDE)硬盘和CD-ROM(光盘只读存储器)接口,以及软盘等的仿真。另外,QEMU还可实现对包括NE2000PCI(Peripheral Controller Interconnect,外设组件互连标准)网络适配器、串行端口、大量的声卡和带虚拟USB(Universal Serial Bus,通用串行总线)集线器等的仿真。除了仿真标准PC或ISA(Industrial Standard Architecture,工业标准结构总线)PC外,QEMU还可以仿真其他非PC硬件,如通用ARM(Advanced RISC Machine)基线板和MIPS(Million Instructions Per Second)板。因此,上述机器虚拟器所模拟的所有需要保存状态的设备仅为举例,其他现有的或今后可能出现的机器虚拟器所模拟的设备如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
优选地,在步骤S42中,设备1在暂停所述虚拟机运行之后及保存所述虚拟机的相 关信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
例如,接上例,QEMU进程申请的这些不带有更新QEMU进程时不被释放标志的内存,因为在更新机器虚拟器时,除虚拟机内存、虚拟机显存和带标记的指定内存以外的其余内存均会被释放。及时存储这些内存中未写入磁盘的内容,例如将所述未写入磁盘的内容写入磁盘或其他存储设备,可以避免QEMU进程更新完成后丢失这些内存中存储的内容。
当然,本领域技术人员应能理解上述将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘的方式仅为举例,其他现有的或今后可能出现的可存储未写入内容的存储设备如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
在步骤S43中,设备1对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中。
具体地,在步骤S43中,设备1利用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
例如,接上例,所述执行模块可以是exec函数族,exec函数族的作用是根据指定的文件名找到可执行文件,并用它来取代调用进程的内容,换句话说,就是在调用进程内部执行一个可执行文件,通过调用exec函数族可以更新QEMU进程。所述参数可以是QEMU进程启动时传入的参数,并增加一个保存了所述虚拟机相关信息的指定内存的地址参数。本领域技术人员应能理解上述更新机器虚拟器的执行模块和参数仅为举例,其他现有的或今后可能出现的更新机器虚拟器的执行模块和参数如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
在步骤S44中,设备1恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
在具体的实施例中,从步骤S42设备1暂停虚拟机运行,至步骤S44设备1恢复所述虚拟机的状态信息,并恢复所述虚拟机运行,只需要100ms到200ms,机器虚拟器热升级(即在不关闭虚拟机的情况下在线升级)时间短,可以做到用户无感知,极大地提高了用户体验。
具体地,在步骤S44中,设备1从所述指定内存中恢复所述虚拟机的状态信息。
图5示出根据本申请一个方面的一个优选实施例的一种在线升级机器虚拟器的方法流程图。
该方法包括步骤S41’、步骤S42’、步骤S43’、步骤S45’和步骤S44’,其中, 步骤S41’、步骤S42’、步骤S43’、步骤S44’与图4中步骤S41、步骤S42、步骤S43、步骤S44的内容相同或基本相同,为简明起见,在此不再赘述。
在步骤S45’中,设备1在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
具体地,所述运行升级后的机器虚拟器包括:对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用指定内存中保存的虚拟机内存地址。
例如,接上例,exec函数族就是一簇函数,它把当前进程映像替换成新的程序文件,而且该程序从main(主)函数开始执行。在步骤S43’中,设备1将原来QEMU进程的所有参数,以及新增参数指定内存的地址,传入QEMU(机器虚拟器)。新的QEMU可执行程序重新从main函数处开始运行,进行各项初始化操作,如果参数中有指定内存的地址传入,那么在给虚拟机申请内存时,使用指定内存中存储的虚拟机内存地址,并不需要重新申请,而虚拟机内存在调用exec函数初始化并重新运行升级后的所述机器虚拟器的可执行程序过程中不会被释放,这也正是本申请可以不需要拷贝内存而实现QEMU升级的原因。与现有的热迁移技术需要拷贝内存,在内存压力很大时容易失败相比,本申请不需拷贝内存的技术方案极大地提高了升级成功率。在各项初始化操作完成后,根据指定内存中存储的虚拟机的状态信息恢复虚拟机状态。本领域技术人员应能理解上述运行升级后的所述机器虚拟器的可执行程序的方法仅为举例,其他现有的或今后可能出现的运行升级后的所述机器虚拟器的可执行程序的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
具体地,所述方法还可以包括:设备1在恢复所述虚拟机运行之后,释放所述指定内存。
在此,虚拟机中机器虚拟器的在线升级完成后,及时释放已经发挥完作用的指定内存,可以节约内存存储空间,提高系统运行效率。
图6示出根据本申请另一个方面的一个实施例的一种在线升级机器虚拟器的方法流程图。应用本申请提供的方法对KVM虚拟化下的机器虚拟器进行在线升级可采用如下的处理流程:
步骤S61,申请一指定内存,所述指定内存在更新机器虚拟器时不被释放。在此,通过对主机的内核进行修改,为所述指定内存增加以一标记,该标记使所述指定内存在更新机器虚拟器时不被释放。
步骤S62,暂停虚拟机运行。
步骤S63,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
步骤S64,将所述虚拟机的相关信息保存至所述指定内存中。在此,所述虚拟机的相关信息包括:所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
步骤S65,对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中。在此,利用执行模块更新所述机器虚拟器可执行程序和所有参数来达到升级机器虚拟器的目的。
步骤S66,从指定内存中恢复所述虚拟机的状态信息。在此,运行升级后的所述机器虚拟器,对所述升级后的机器虚拟器进行初始化,并在为所述虚拟机申请内存时,用所述指定内存中保存的虚拟机内存地址。
步骤S67,恢复所述虚拟机运行。
步骤S68,释放步骤S51中所申请的指定内存。
综上所述,与现有技术相比,本申请的一个实施例通过申请一指定内存,该指定内存用于保存虚拟机的内存地址和状态信息,且该指定内存在更新机器虚拟器中不被释放,则在机器虚拟器升级之后,所述虚拟机的状态信息可以直接从该指定内存中恢复,从而加快了恢复速度、缩短了升级时间,并且将所述指定内存的地址作为新增参数传入所述机器虚拟器可以提高升级成功率,减轻开发者负担。
此外,通过在机器虚拟器更新过程中,利用执行模块更新机器虚拟器的可执行文件来实现机器虚拟器的进程ID不变,可以使升级过程不被用户感知,进而提升用户体验。
此外,在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁 带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
需要注意的是,本申请可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本申请的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本申请的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本申请的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。
另外,本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法和/或技术方案。而调用本申请的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本申请的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本申请的多个实施例的方法和/或技术方案。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。

Claims (22)

  1. 一种在线升级机器虚拟器的方法,其中,所述方法包括:
    申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;
    暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;
    对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;以及
    恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
  2. 根据权利要求1所述的方法,其中,所述虚拟机的相关信息包括:
    所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
  3. 根据权利要求1或2所述的方法,其中,申请一指定内存,所述指定内存在更新机器虚拟器时不被释放包括:
    对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;以及
    将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
  4. 根据权利要求1至3中任一项所述的方法,其中,所述方法还包括:
    在暂停所述虚拟机运行之后及保存所述虚拟机的相关信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
  5. 根据权利要求1至4中任一项所述的方法,其中,所述虚拟机的状态信息包括:
    所述机器虚拟器所模拟的所有需要保存状态的设备的当前的状态信息。
  6. 根据权利要求5所述的方法,其中,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
  7. 根据权利要求1至6中任一项所述的方法,其中,对机器虚拟器进行升级包括:
    利用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
  8. 根据权利要求1至7中任一项所述的方法,其中,所述方法还包括:
    在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
  9. 根据权利要求1至8中任一项所述的方法,其中,所述运行升级后的所述机器虚拟器包括:
    对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用所述指定内存中保存的虚拟机内存地址。
  10. 根据权利要求1至9中任一项所述的方法,其中,恢复所述虚拟机的状态信息包括:
    从所述指定内存中恢复所述虚拟机的状态信息。
  11. 根据权利要求1至10中任一项所述的方法,其中,所述方法还包括:
    在恢复所述虚拟机运行之后,释放所述指定内存。
  12. 一种在线升级机器虚拟器的设备,其中,所述设备包括:
    第一装置,用于申请一指定内存,所述指定内存在更新机器虚拟器时不被释放;
    第二装置,用于暂停虚拟机运行,并将所述虚拟机的相关信息保存至所述指定内存中;
    第三装置,用于对机器虚拟器进行升级,并将所述指定内存的地址作为新增参数传入所述机器虚拟器中;以及
    第四装置,用于恢复所述虚拟机的状态信息,并恢复所述虚拟机运行。
  13. 根据权利要求12所述的设备,其中,所述虚拟机的相关信息包括:
    所述虚拟机的状态信息、所述虚拟机内存地址信息以及所述虚拟机显存地址信息。
  14. 根据权利要求12或13所述的设备,其中,所述第一装置包括:
    第一单元,用于对主机的内核进行修改,使之支持在更新机器虚拟机时不释放内存的功能;以及
    第二单元,用于将要更新机器虚拟器时,申请一块指定内存,所述指定内存在更新机器虚拟器时不被释放。
  15. 根据权利要求12至14中任一项所述的设备,其中,所述第二装置包括:
    第三单元,用于在暂停所述虚拟机运行之后及保存所述虚拟机的状态信息之前,将当前机器虚拟器模拟的块设备中未写入磁盘的内容写入磁盘。
  16. 根据权利要求12至15中任一项所述的设备,其中,所述虚拟机的状态信息包括:
    所述机器虚拟器所模拟的所有需要保存状态的设备的当前的状态信息。
  17. 根据权利要求16所述的设备,其中,需要保存状态的设备包括鼠标、键盘、cpu、串口及磁盘设备中的任一种或任其组合。
  18. 根据权利要求12至17中任一项所述的设备,其中,所述第三装置包括:
    第四单元,用于利用执行模块更新所述机器虚拟器可执行程序和所有参数,并增加一个所述指定内存的地址参数。
  19. 根据权利要求12至18中任一项所述的设备,其中,所述设备还包括:
    第五装置,用于在对所述机器虚拟器升级之后,运行升级后的所述机器虚拟器。
  20. 根据权利要求12至19中任一项所述的设备,其中,所述第五装置包括:
    第五单元,用于对所述升级后的机器虚拟器进行初始化,以及为所述虚拟机申请内存时,用所述指定内存中保存的虚拟机内存地址。
  21. 根据权利要求12至20中任一项所述的设备,其中,所述第四装置包括:
    第六单元,用于从所述指定内存中恢复所述虚拟机的状态信息。
  22. 根据权利要求12至21中任一项所述的设备,其中,所述设备还包括:
    第六装置,用于在恢复所述虚拟机运行之后,释放所述指定内存。
PCT/CN2016/081253 2015-05-15 2016-05-06 在线升级机器虚拟器的方法与设备 Ceased WO2016184320A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/813,039 US11487523B2 (en) 2015-05-15 2017-11-14 Updating machine emulator

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510249389.8A CN106293781B (zh) 2015-05-15 2015-05-15 在线升级机器虚拟器的方法与设备
CN201510249389.8 2015-05-15

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/813,039 Continuation US11487523B2 (en) 2015-05-15 2017-11-14 Updating machine emulator

Publications (1)

Publication Number Publication Date
WO2016184320A1 true WO2016184320A1 (zh) 2016-11-24

Family

ID=57319480

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/081253 Ceased WO2016184320A1 (zh) 2015-05-15 2016-05-06 在线升级机器虚拟器的方法与设备

Country Status (3)

Country Link
US (1) US11487523B2 (zh)
CN (1) CN106293781B (zh)
WO (1) WO2016184320A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450676A (zh) * 2018-10-29 2019-03-08 锐捷网络股份有限公司 一种交换机升级方法及装置、电子设备、计算机可读介质
CN110968392A (zh) * 2018-09-30 2020-04-07 华为技术有限公司 一种升级虚拟化模拟器的方法和装置
CN112333471A (zh) * 2020-11-05 2021-02-05 上海网达软件股份有限公司 音视频在线转码器的热升级方法、装置、设备及存储介质
CN114416148A (zh) * 2021-12-07 2022-04-29 深信服科技股份有限公司 一种虚拟机管理程序热升级方法、装置及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10671376B2 (en) * 2016-03-15 2020-06-02 Shenzhen Skyworth-Rgb Electronic Co., Ltd. Server program hot upgrading method and device
CN109697102A (zh) * 2017-10-23 2019-04-30 阿里巴巴集团控股有限公司 一种实现虚拟机桌面访问的方法及装置
CN109861930A (zh) * 2018-12-07 2019-06-07 北京金山云网络技术有限公司 虚拟交换机与虚拟机的连接方法、装置及宿主机
CN109976790B (zh) * 2019-03-29 2022-07-22 珠海豹好玩科技有限公司 应用更新方法、装置、终端及存储介质
CN110489150A (zh) * 2019-08-26 2019-11-22 深信服科技股份有限公司 一种虚拟机热升级方法、装置及其相关设备
CN111078248A (zh) * 2019-10-30 2020-04-28 烽火通信科技股份有限公司 一种云平台的升级方法、装置及存储介质
CN113296802B (zh) * 2020-07-22 2022-05-06 阿里巴巴集团控股有限公司 虚拟机热升级方法、主机设备及存储介质
CN115390876A (zh) * 2022-08-30 2022-11-25 新华三技术有限公司 虚拟机qemu程序热升级方法、装置和设备
CN116088916B (zh) * 2023-02-21 2026-01-13 上海云轴科技股份有限公司 一种用于kvm虚拟化软件的热升级方法与设备
CN119645444A (zh) * 2023-09-18 2025-03-18 杭州阿里云飞天信息技术有限公司 虚拟化管理器的升级方法、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999369A (zh) * 2012-12-25 2013-03-27 杭州华三通信技术有限公司 虚拟机升级的方法及装置
CN103095834A (zh) * 2013-01-16 2013-05-08 中国科学院计算技术研究所 一种跨虚拟化数据中心的虚拟机在线迁移方法
CN103136030A (zh) * 2011-11-24 2013-06-05 鸿富锦精密工业(深圳)有限公司 虚拟机管理系统及方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917724B2 (en) * 2007-12-28 2011-03-29 Intel Corporation Protection of user-level applications based on page table information
US8239863B2 (en) * 2010-06-29 2012-08-07 Hewlett-Packard Development Company, L.P. Method and system for migrating a virtual machine
CN103107905B (zh) * 2011-11-14 2017-08-04 华为技术有限公司 异常处理方法、装置和客户端
CN102436410B (zh) * 2011-12-12 2013-09-18 华中科技大学 虚拟机检查点的在线保存方法
WO2013149343A1 (en) * 2012-04-03 2013-10-10 Gridcentric Inc. Method and system for memory oversubscription for virtual machines
US8745276B2 (en) * 2012-09-27 2014-06-03 Mellanox Technologies Ltd. Use of free pages in handling of page faults
CN102917055B (zh) * 2012-10-18 2015-11-25 华为技术有限公司 虚拟机在线迁移的方法、装置和终端设备
US9609086B2 (en) * 2013-03-15 2017-03-28 International Business Machines Corporation Virtual machine mobility using OpenFlow
CN103744725B (zh) * 2013-12-24 2017-01-25 杭州华为数字技术有限公司 一种虚拟机管理方法及装置
JP6303857B2 (ja) * 2014-06-20 2018-04-04 富士通株式会社 出力プログラム,出力装置,及び出力方法
US9292332B1 (en) * 2014-12-11 2016-03-22 Amazon Technologies, Inc. Live updates for virtual machine monitor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136030A (zh) * 2011-11-24 2013-06-05 鸿富锦精密工业(深圳)有限公司 虚拟机管理系统及方法
CN102999369A (zh) * 2012-12-25 2013-03-27 杭州华三通信技术有限公司 虚拟机升级的方法及装置
CN103095834A (zh) * 2013-01-16 2013-05-08 中国科学院计算技术研究所 一种跨虚拟化数据中心的虚拟机在线迁移方法

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968392A (zh) * 2018-09-30 2020-04-07 华为技术有限公司 一种升级虚拟化模拟器的方法和装置
US11875174B2 (en) 2018-09-30 2024-01-16 Huawei Technologies Co., Ltd. Method and apparatus for virtual machine emulator upgrading virtualization emulator
CN110968392B (zh) * 2018-09-30 2024-04-12 华为技术有限公司 一种升级虚拟化模拟器的方法和装置
CN109450676A (zh) * 2018-10-29 2019-03-08 锐捷网络股份有限公司 一种交换机升级方法及装置、电子设备、计算机可读介质
CN109450676B (zh) * 2018-10-29 2022-04-26 锐捷网络股份有限公司 一种交换机升级方法及装置、电子设备、计算机可读介质
CN112333471A (zh) * 2020-11-05 2021-02-05 上海网达软件股份有限公司 音视频在线转码器的热升级方法、装置、设备及存储介质
CN114416148A (zh) * 2021-12-07 2022-04-29 深信服科技股份有限公司 一种虚拟机管理程序热升级方法、装置及存储介质

Also Published As

Publication number Publication date
US20180081674A1 (en) 2018-03-22
US11487523B2 (en) 2022-11-01
CN106293781B (zh) 2019-10-18
CN106293781A (zh) 2017-01-04

Similar Documents

Publication Publication Date Title
CN106293781B (zh) 在线升级机器虚拟器的方法与设备
EP3762826B1 (en) Live migration of virtual machines in distributed computing systems
US10846145B2 (en) Enabling live migration of virtual machines with passthrough PCI devices
US9619223B2 (en) Live operating system update mechanisms
JP5657121B2 (ja) 仮想マシンのオンデマンド型イメージ・ストリーミング
Graziano A performance analysis of Xen and KVM hypervisors for hosting the Xen Worlds Project
US12498988B2 (en) Migrating stateful workloads between container clusters with different storage backends
US9052949B2 (en) Scheduling a processor to support efficient migration of a virtual machine
CN107368353B (zh) 一种实现虚拟机内存热添加的方法和装置
US11875145B2 (en) Virtual machine update while keeping devices attached to the virtual machine
CN114691300A (zh) 一种虚拟机实例的热迁移方法
CN106648827A (zh) 一种在线添加虚拟机资源的方法
US20210055946A1 (en) Minimizing downtime when importing virtual machines from other platforms
US20170090964A1 (en) Post-copy virtual machine migration with assigned devices
CN106095528A (zh) 一种检测虚拟机盘符的方法
US20200174814A1 (en) Systems and methods for upgrading hypervisor locally
CN112328365A (zh) 一种虚拟机迁移方法、装置、设备及存储介质
US10503659B2 (en) Post-copy VM migration speedup using free page hinting
CN114237814A (zh) 跨虚拟化平台的虚拟机迁移方法、装置和计算机设备
CN108196945A (zh) 一种核间通信方法、装置和虚拟化设备
WO2024021480A1 (zh) 一种虚拟机动态迁移的方法、装置及电子设备
US9684529B2 (en) Firmware and metadata migration across hypervisors based on supported capabilities
CN106201564A (zh) 在线升级基于内核虚拟机模块的设备和方法
US11513825B2 (en) System and method for implementing trusted execution environment on PCI device
CN111190693B (zh) 一种基于鲲鹏平台搭建云平台的方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16795807

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16795807

Country of ref document: EP

Kind code of ref document: A1