CN114691300A - Hot migration method of virtual machine instance - Google Patents

Hot migration method of virtual machine instance Download PDF

Info

Publication number
CN114691300A
CN114691300A CN202210307611.5A CN202210307611A CN114691300A CN 114691300 A CN114691300 A CN 114691300A CN 202210307611 A CN202210307611 A CN 202210307611A CN 114691300 A CN114691300 A CN 114691300A
Authority
CN
China
Prior art keywords
virtual machine
cloud service
machine instance
data
service equipment
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.)
Pending
Application number
CN202210307611.5A
Other languages
Chinese (zh)
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 China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210307611.5A priority Critical patent/CN114691300A/en
Publication of CN114691300A publication Critical patent/CN114691300A/en
Priority to PCT/CN2023/080978 priority patent/WO2023179388A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The specification provides a live migration method of a virtual machine instance, which is applied to cloud service equipment. The cloud service equipment is loaded with micro service hardware, and the virtual machine instance comprises a virtual machine simulator process on the micro service hardware and a virtual machine driver in an operating system kernel loaded by the cloud service equipment. The method comprises the following steps: responding to the fact that the virtual machine instance to be migrated meets the live migration condition, the operating system kernel obtains first operating data of the virtual machine instance in the operating system kernel carried by the cloud service equipment, and writes the first operating data into a preset memory space. The virtual machine simulator process obtains second operation data of the virtual machine instance on the micro service hardware and third operation data of the virtual machine instance in a memory space of the cloud service equipment, and reads the first operation data from a preset memory space. And the virtual machine simulator process sends the acquired running data to the target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment.

Description

Hot migration method of virtual machine instance
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a live migration method of a virtual machine instance.
Background
This section is intended to provide a background or context to the embodiments of the specification that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Cloud servers typically include virtual machine instances implemented through virtualization technology on a cloud server device. Various services of the cloud server can be realized through the virtual machine instance. These services are typically required to remain online in real time, and therefore cannot be interrupted when a virtual machine instance needs to be migrated from a current cloud service device.
Disclosure of Invention
To overcome the problems in the related art, the present specification provides the following methods and apparatuses.
In a first aspect of embodiments of the present specification, a live migration method of a virtual machine instance is provided, which is applied to a cloud service device, where the cloud service device is equipped with micro service hardware, and a virtual machine instance to be migrated includes a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service device; the method comprises the following steps:
responding to that the virtual machine instance to be migrated meets a live migration condition, and enabling the virtual machine driver to acquire first running data of the virtual machine instance in an operating system kernel carried by the cloud service equipment and write the first running data into a preset memory space;
the virtual machine simulator process acquires second operation data of the virtual machine instance on the micro-service hardware and third operation data of the virtual machine instance in a memory space of the cloud service equipment, and reads the first operation data from the preset memory space;
and the virtual machine simulator process sends the acquired first operation data, the acquired second operation data and the acquired third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment.
In a second aspect of the embodiments of the present specification, there is provided a live migration apparatus of a virtual machine instance, which is applied to a cloud service device, where the cloud service device is equipped with micro service hardware, and a virtual machine instance to be migrated includes a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service device; the device comprises:
a first obtaining unit, configured to, in response to that the virtual machine instance to be migrated meets a live migration condition, obtain, by the virtual machine driver, first operating data of the virtual machine instance in an operating system kernel carried by the cloud service device, and write the first operating data into a preset memory space;
a second obtaining unit, configured to obtain, by the virtual machine simulator process, second operation data of the virtual machine instance on the micro service hardware and third operation data of the virtual machine instance in a memory space of the cloud service device, and read the first operation data from the preset memory space;
and a data sending unit, configured to send, by the virtual machine simulator process, the obtained first operation data, the obtained second operation data, and the obtained third operation data to a target cloud service device, so as to migrate the virtual machine instance to the target cloud service device.
In a third aspect of embodiments herein, there is provided a system; the system comprises: the source cloud service equipment and the target cloud service equipment;
the source cloud service equipment carries source micro service hardware, and the virtual machine example to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the source cloud service equipment;
the source cloud service device is used for: responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the source cloud service equipment, and writes the first operating data into a preset memory space; the virtual machine simulator process acquires second operation data of the virtual machine instance on the source micro-service hardware and third operation data of the virtual machine instance in a memory space of the source cloud service equipment, and reads the first operation data from the preset memory space; the virtual machine simulator process sends the acquired first operation data, the second operation data and the third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment;
the target cloud service equipment carries target micro-service hardware;
the target cloud service device is configured to: receiving the first running data, the second running data and the third running data sent by the source cloud service equipment in response to the virtual machine instance to be migrated meeting the live migration condition; and creating a virtual machine instance according to the received operation data, wherein the virtual machine instance comprises a virtual machine simulator process running on target micro-service hardware and a virtual machine driver running in an operating system kernel carried by the target cloud service equipment, so that the migration of the virtual machine instance from the source cloud service equipment to the target cloud service equipment is completed.
In a fourth aspect of embodiments of the present specification, there is provided a storage medium; the storage medium has stored thereon a computer program which, when executed, performs the steps of the method as follows:
responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the cloud service equipment, and writes the first operating data into a preset memory space;
the virtual machine simulator process acquires second operation data of the virtual machine instance on the micro-service hardware and third operation data of the virtual machine instance in a memory space of the cloud service equipment, and reads the first operation data from the preset memory space;
and the virtual machine simulator process sends the acquired first operation data, the acquired second operation data and the acquired third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment.
In a fifth aspect of embodiments herein, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the following method when executing the program:
responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the cloud service equipment, and writes the first operating data into a preset memory space;
the virtual machine simulator process acquires second operation data of the virtual machine instance on the micro-service hardware and third operation data of the virtual machine instance in a memory space of the cloud service equipment, and reads the first operation data from the preset memory space;
and the virtual machine simulator process sends the acquired first operation data, the acquired second operation data and the acquired third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment.
The above embodiments of the present specification have at least the following advantageous effects:
in the technical scheme, when the virtual machine instance to be migrated meets the live migration condition, the running data of the virtual machine instance to be migrated on the cloud service equipment and the micro service hardware is obtained in real time, and the running data of the virtual machine instance to be migrated is sent to the target service equipment through the progress of the virtual machine simulator. All running data of the virtual machine instance to be migrated is transferred to the target service equipment, so that the migrated virtual machine instance can continue running on the target service equipment without causing service interruption.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 schematically illustrates a diagram of an example virtual machine in accordance with an embodiment of the present description;
FIG. 2 is a schematic diagram illustrating an architecture of a live migration system of a virtual machine instance according to an embodiment of the present specification;
FIG. 3 is a flow chart that schematically illustrates a method for live migration of a virtual machine instance, in accordance with an embodiment of the present specification;
FIG. 4 is a block diagram that schematically illustrates a live migration apparatus of an instance of a virtual machine, in accordance with an embodiment of the present specification;
FIG. 5 is a schematic diagram illustrating an architecture of a live migration system of a virtual machine instance according to an embodiment of the present specification;
fig. 6 schematically shows a hardware structure diagram of a computer device in which a live migration method of a virtual machine instance according to an embodiment of the present specification is located.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present description will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely to enable those skilled in the art to better understand and to implement the present description, and are not intended to limit the scope of the present description in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the description to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present description may be embodied as a system, apparatus, device, method, or computer program product. Thus, the present description may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
The cloud server is realized through a virtualization technology and a cloud computing technology and is deployed on a cloud service platform. The cloud server of the micro service architecture is an implementation architecture of the cloud server.
For example, referring to fig. 1, fig. 1 schematically shows a structural diagram of an example of a virtual machine according to an embodiment of the present specification.
The cloud server of the micro-service architecture introduces micro-service hardware on a physical server, and independently runs an operating system on the micro-service hardware. The micro service hardware can be a micro service card connected to a physical server through a bus, and provides services such as virtualization of input/output (IO) equipment, processing and forwarding of IO requests and the like for the physical server, so that the physical server can become flexible like a virtual machine.
When the virtual machine instance is deployed on the cloud server of the micro-service architecture, the virtual machine instance may adopt a separate architecture, a virtual machine simulator process of the virtual machine may be run on the micro-service hardware, and virtualization of hardware devices such as a CPU, a memory, an input/output device, and the like is achieved through the virtual machine simulator process and a physical server operating system kernel, so as to achieve the virtual machine instance.
The physical server may be configured to deploy a plurality of virtual machine embodiments simultaneously, and the plurality of virtual machine instances may share the physical server operating system kernel.
In the scenario of a cloud server using the above micro service architecture, a virtual machine instance on a certain cloud service device may need to be migrated to a new cloud service device in some cases.
Due to various traffic on the cloud server. These services typically need to remain online in real time, and therefore cannot be interrupted when a virtual machine instance needs to be migrated from the current cloud service device.
In view of this, the present application provides a live migration method for acquiring, in real time, running data of a virtual machine instance to be migrated on cloud service equipment and micro service hardware when the virtual machine instance to be migrated satisfies a live migration condition, and sending the running data of the virtual machine instance to be migrated to a virtual machine instance of a target service equipment through a virtual machine simulator process.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
FIG. 2 is an architectural diagram of a live migration system of a virtual machine instance according to an exemplary embodiment. As shown in fig. 1, the system may include a network 20, a server 21, a number of electronic devices, such as a cell phone 22, a cell phone 23, a cell phone 24, and so on.
The server 21 may be a physical server comprising an independent host, or the server 21 may be a virtual server, a cloud server, etc. hosted by a cluster of hosts. Handsets 22-24 are just one type of electronic device that a user may use. In fact, it is obvious that the user can also use electronic devices of the type such as: tablet devices, notebook computers, Personal Digital Assistants (PDAs), wearable devices (e.g., smart glasses, smart watches, etc.), etc., to which one or more embodiments of the present disclosure are not limited. The network 20 may include various types of wired or wireless networks.
In one embodiment, the server 21 may cooperate with handsets 22-24; wherein, the mobile phone 22-24 can receive user operation, and upload the received command and file to the server 21 through the network 20, and then the server 21 processes the file based on the scheme of the present specification. In another embodiment, the handsets 22-24 may independently implement the text processing scheme of the present specification; wherein, the mobile phones 22-24 accept user operations, and process the accepted commands and files based on the scheme of the present specification, so as to implement the live migration of the virtual machine instance.
The embodiments of the present description will be described in detail below with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a flowchart of a method for live migration of a virtual machine instance according to an exemplary embodiment, where the method is applied to a processing device, and the processing device may be, for example, the server 21 or the cell phones 22 to 24 shown in fig. 2.
The method is applied to cloud service equipment, the cloud service equipment is provided with micro service hardware, and a virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service equipment;
the virtual machine instance on the cloud server comprises an operating system kernel driver carried by a virtual machine simulator process and cloud server equipment which are run on micro-service hardware, and the virtual machine simulator process and the kernel driver jointly realize virtualization of hardware such as a CPU, a memory, input and output equipment and the like.
In an embodiment shown in this specification, the virtual machine simulator process implements virtualization of hardware such as input and output devices, and the kernel driver implements virtualization of hardware such as a CPU and a memory together.
In one embodiment illustrated in this specification, the microservice hardware described above includes a microservice card.
A microservice card, such as a moc (micro server on card), is microservice hardware, is a physical board device with a CPU and a ROM/RAM, can run an independent operating system, and can be connected to a physical server through a system bus (e.g., PCIe) to provide services such as virtualization of input/output devices, processing and forwarding of input/output requests, and the like to the server.
The specification does not limit the specific type of the operating system installed on the cloud service device, and may be Linux, MacOS, Windows, or the like.
The specification does not limit the specific type of the Virtual Machine instance, and for example, the Virtual Machine instance may be a KVM (Kernel-based Virtual Machine) Virtual Machine instance, a Xen Virtual Machine instance, or a vbox Virtual Machine instance.
Likewise, the present description does not limit the specific type of the virtual machine emulator process, and may be, for example, a QEMU process, a VMware process, or the like.
In one embodiment illustrated herein, the virtual machine instance comprises a KVM virtual machine instance; the virtual machine simulator process comprises a QEMU process.
The operating system carried by the cloud service device may be Linux, and the virtual machine instance may be a KVM virtual machine instance. The KVM virtual machine instance comprises a virtual machine driver integrated in a module form into the Linux operating system kernel, and the QEMU process described above.
The method comprises the following steps:
step 302, in response to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the cloud service device, and writes the first operating data into a preset memory space;
in some cases, a virtual machine instance on a cloud service device may need to be live migrated. The application is not particularly limited with respect to the specific form and content of the live migration condition that the virtual machine instance to be migrated needs to satisfy.
In an exemplary embodiment shown in the present application, the live migration condition of the virtual machine instance may be that a numerical value corresponding to the operation index of the virtual machine instance reaches a preset threshold. It should be understood that, when the value corresponding to the above operation index reaches the preset threshold, one or more operation indexes may be lower than the preset threshold, one or more operation indexes are higher than the preset threshold, one or more operation indexes are equal to or not equal to the preset threshold, or a logical combination of the above situations, which is not specifically limited in this specification.
For example, a thermomigration condition may be an operating index A > 100, and an operating index B within the interval (1, 10).
And responding to the condition that the virtual machine instance to be migrated meets the hot migration condition, and starting to migrate the relevant running data of the virtual machine instance to be migrated.
Wherein, the operation data of the virtual machine instance comprises: the method comprises the following steps of first operation data of a virtual machine instance in an operating system kernel carried by cloud service equipment, second operation data of the virtual machine instance on micro service hardware, and third operation data of the virtual machine instance in a memory space of the cloud service equipment.
In an exemplary embodiment shown in this specification, the first operation data includes virtual CPU state data and virtual device state data of the virtual machine instance on the cloud service device.
The virtual CPU state data may include virtual CPU states such as vcpu _ regs (general register data), vcpu _ sregs (segment register data), and fpu (floating point arithmetic unit data).
The virtual device status data may include clock (clock data), ioapic (input/output advanced programmable interrupt controller (ipec) data), rtc (real time clock data), and other device status data.
The present specification does not specifically limit the organization of the first operation data. For example, the first operation data may be organized in the form of a structure, or other data types may be used.
And for the first running data in the operating system kernel carried by the cloud service equipment, the first running data can be obtained through the operating system kernel and written into a preset memory space.
The present specification does not specifically limit how the operating system kernel obtains the first operating data or writes the first operating data into the memory space. For example, the virtual machine driver in the kernel of the operating system can be directly used for implementation, and the virtual machine driver can also be used for implementation by other programs in the kernel of the operating system.
In an exemplary embodiment shown in this specification, a service program for acquiring and storing the first operation data may be implemented in an operating system kernel carried by the cloud service device. The callback function may be registered in an operating system kernel carried by the cloud service device.
When the virtual machine instance meets the live migration condition, the callback function can be triggered to initiate the call of the service program. The service program can be operated in an operating system kernel carried by the cloud service equipment to obtain first operation data of the virtual machine instance on the cloud service equipment, and the first operation data is written into a preset memory space.
For example, the virtual machine instance is a KVM virtual machine instance, and the operating system installed on the cloud service device is Linux.
The KVM module comprises a virtual machine driver integrated in a modular form into the Linux operating system kernel. The virtual machine driver can manage virtual hardware resources, and complete allocation of a virtual machine memory, reading and writing of a virtual machine register, running of a virtual machine CPU and the like.
The service program kvm _ save for acquiring and storing the first running data can be implemented in a Linux operating system kernel carried by the cloud service device. A callback function may be created and registered on the Linux kernel operating system, wherein the trigger condition of the callback function may be set as the above-mentioned live migration condition.
When the virtual machine instance meets the live migration condition, the callback function can be triggered, and the service program kvm _ save acquires first running data on the cloud service device, including virtual CPU state data and virtual device state data, and stores the first running data in the preset memory space.
The present specification does not limit the manner in which the service program acquires the first operation data.
For example, the virtual machine instance is still taken as a KVM virtual machine instance, and the operating system carried by the cloud service device is taken as Linux. When a virtual machine instance is created, the KVM module creates a corresponding struct _ KVM structure for storing a virtual CPU state for the virtual machine instance, and synchronizes an address of the struct _ KVM to the service program KVM _ save. The Virtual CPU state is stored in the Structure _ kvm Structure in a data Structure of vmcs (Virtual Machine Control Structure). When the live migration condition is met, the service program kvm _ save can call the virtual CPU state reading function vmcs _ read, and corresponding virtual CPU state data is obtained from the data structure of vmcs stored in the struct _ kvm structure.
In an exemplary embodiment shown in this specification, the preset memory area includes a reserved memory space applied from a memory space of a cloud service device corresponding to the virtual machine instance when the virtual machine instance is created.
The reserved memory applied in the memory space of the cloud service device corresponding to the virtual machine instance may be used to write the first operation data into the reserved memory when a live migration condition is satisfied.
Because the reserved memory space is in the memory of the cloud service device, not in the memory of the virtual machine instance, the reserved memory space can still be conveniently read after the virtual machine instance stops running.
For a specific manner of applying for reserving the memory, the memory is not limited in this application, and may be implemented by, for example, the virtual machine simulator process, or an operating system kernel carried by the cloud service device.
For example, the virtual machine instance is still taken as a KVM virtual machine instance, and the operating system carried by the cloud service device is taken as Linux. The reserved memory may be a physical address of a memory space in the virtual machine simulator process, which is applied for the memory in the service program kvm _ save through an input/output control function IOCTL, and allocated and obtained through a memory allocation function kzalloc. So that the satisfied service program kvm _ save can write the acquired first operation data into the reserved memory space after acquiring the first operation data.
Step 304, the virtual machine simulator process acquires second operation data of the virtual machine instance on the microservice hardware, and reads the first operation data from the preset memory space;
after the first operation data is written into the reserved memory space, the virtual machine simulator process may obtain the first operation data of the reserved memory space.
In addition to the first operation data, the live migration of the virtual machine instance also requires the migration of second operation data of the virtual machine instance on the microservice hardware. Thus, the virtual machine emulator process may obtain second operational data of the virtual machine instance on the microservice hardware.
In one illustrative embodiment shown in the present specification, the second operation data includes: virtual device state data of the virtual machine instance on the microservice hardware.
The operating data of the virtual machine instance includes device state data on the microservice hardware described above.
The method for acquiring the device state data on the microservice hardware by the virtual machine simulator process is not specifically limited in the present specification.
For example, in one illustrative embodiment shown, this portion of the device state data may be generally saved by a virtual machine simulator process on the microservice hardware, and thus may be obtained directly by the virtual machine simulator process.
In one exemplary embodiment shown in the present specification, the third operation data includes: and the virtual machine instance writes the data of the memory space corresponding to the virtual machine instance.
The operation data of the virtual machine instance includes memory data of the virtual machine instance, that is, data written into a memory space corresponding to the virtual machine instance.
The memory space corresponding to the virtual machine instance is a virtualized memory, and can be obtained by virtualizing a memory of the cloud server device.
The virtual machine simulator process can manage data of a memory space corresponding to the virtual machine instance. The virtual machine emulator process can thus obtain the memory data of the virtual machine instance.
For example, when the virtual machine simulator process is a QEMU process, the memory space corresponding to the virtual machine instance may be managed in a MemoryRegion manner. When managing the memory space corresponding to the virtual machine instance in an MR (memoryregion) manner, one MR is used to represent a segment of memory address. The MR includes various classes, such as RAM, MMIO, contiainer, alias, etc. The QUMU process may create a data structure named RamBlock for each MR as described above, all RamBlock concatenated in a linked list.
When the live migration condition is met, the QEMU process can read the RamBlock linked list to obtain the client physical addresses (gpa) of various memories. Wherein, some MR customer physical address is stored in the form of variable in QEMU process, and can be directly obtained; some special MRs have reserved blank memories, the size of the blank memories can be recorded by a structural body in advance, and the client physical addresses of actual memory data can be converted based on the read values and the size of the blank memories.
The IOMMU can convert the client physical addresses of various memories into physical addresses of the memories on the cloud service equipment through the input and output memory management unit IOMMU of the virtual machine instance, and the QEMU process can obtain data of a memory space corresponding to the virtual machine instance through a DMA channel of the virtual machine instance according to the physical addresses of the memories on the cloud service equipment.
Step 306, the virtual machine simulator process sends the acquired first operation data, the second operation data and the third operation data to a target cloud service device, so as to migrate the virtual machine instance to the target cloud service device.
After the first operation data, the second operation data and the third operation data are obtained, the virtual machine simulator process may send the operation data of the virtual machine instances to the target cloud server device.
The specification does not specifically limit the selection of the target cloud service device. For example, an available cloud service device may be randomly selected as a target cloud server, or a specific cloud service device may be designated by a user as a target cloud server.
In one embodiment shown in this specification, a cloud service device that is currently in a normal state may be acquired; and distributing target cloud service equipment as a migrated party from the normal cloud service equipment. The target cloud service device may be any one of the above-described cloud service devices in a normal state.
The method for sending the operation data to the target cloud server device by the virtual machine simulator process is not specifically limited in the present application.
In an exemplary embodiment of the present specification, a live migration apparatus of a virtual machine instance is also provided. Referring to fig. 4, fig. 4 is a block diagram of a live migration apparatus of an example virtual machine according to an embodiment of the present disclosure.
The device is applied to cloud service equipment, the cloud service equipment is provided with micro service hardware, and a virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service equipment; the device comprises:
a first obtaining unit 410, configured to, in response to that the virtual machine instance to be migrated meets a live migration condition, obtain, by the operating system kernel, first operating data of the virtual machine instance in an operating system kernel carried by the cloud service device, and write the first operating data into a preset memory space;
a second obtaining unit 420, configured to obtain, by the virtual machine simulator process, second operation data of the virtual machine instance on the micro service hardware and third operation data of the virtual machine instance in a memory space of the cloud service device, and read the first operation data from the preset memory space;
a data sending unit 440, configured to send, by the virtual machine simulator process, the obtained first operation data, the obtained second operation data, and the obtained third operation data to a target cloud service device, so as to migrate the virtual machine instance to the target cloud service device.
Optionally, the thermomigration conditions include any one of the following: the numerical value corresponding to the operation index of the virtual machine instance reaches a preset threshold value; a live migration instruction is received for the virtual machine instance.
Optionally, a service program for acquiring and storing the first operating data is implemented in an operating system kernel carried by the cloud service device; a callback function is registered in an operating system kernel carried by the cloud service equipment; the callback function is automatically triggered when the virtual machine instance meets the live migration condition and is used for initiating the call of the service program;
the first obtaining unit 410 is specifically configured to, in response to that the virtual machine instance meets a live migration condition, trigger the callback function, initiate a call to the service program, so as to run the service program in an operating system kernel carried by the cloud service device, obtain, by the service program, first running data of the virtual machine instance on the cloud service device, and write the first running data into a preset memory space.
Optionally, the preset memory area includes a reserved memory space applied from a memory space of the cloud server device corresponding to the virtual machine instance when the virtual machine instance is created.
Optionally, the first operation data includes: virtual CPU state data and virtual device state data of the virtual machine instance on the cloud service device; the second operational data includes: virtual device state data of the virtual machine instance on the microservice hardware; the third operational data includes: and the virtual machine instance writes the data of the memory space corresponding to the virtual machine instance.
Optionally, the apparatus further comprises: a target selection unit 430, configured to acquire a cloud service device currently in a normal state; and allocating target cloud service equipment as a migrated party from the normal cloud service equipment.
Optionally, the microservice hardware includes a microservice card.
Optionally, the virtual machine instance includes a KVM virtual machine instance; the virtual machine simulator process comprises a QEMU process.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the elements can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
In an exemplary embodiment of the present description, a system embodiment is also provided. Referring to fig. 5, fig. 5 is a schematic diagram illustrating an architecture of a live migration system of a virtual machine instance according to an embodiment of the present disclosure.
The system comprises: the cloud service system comprises source cloud service equipment and target cloud service equipment;
the source cloud service equipment carries source micro service hardware, and the virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the source cloud service equipment;
the source cloud service device is configured to: responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the source cloud service equipment, and writes the first operating data into a preset memory space; the virtual machine simulator process acquires second operation data of the virtual machine instance on the source micro-service hardware and third operation data of the virtual machine instance in a memory space of the source cloud service equipment, and reads the first operation data from the preset memory space; the virtual machine simulator process sends the acquired first operation data, the second operation data and the third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment;
the target cloud service equipment carries target micro-service hardware;
the target cloud service device is configured to: receiving the first operating data, the second operating data and the third operating data sent by the source cloud service equipment in response to the virtual machine instance to be migrated meeting the live migration condition; and creating a virtual machine instance according to the received operation data, wherein the virtual machine instance comprises a virtual machine simulator process running on target micro-service hardware and a virtual machine driver running in an operating system kernel carried by the target cloud service equipment, so that the migration of the virtual machine instance from the source cloud service equipment to the target cloud service equipment is completed.
In exemplary embodiments of the present description, embodiments of an apparatus and a terminal applied thereto are also provided.
The embodiments of the live migration apparatus of the virtual machine example in the present specification can be applied to a computer device, such as a server or a terminal device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory through the processor where the device is located and running the computer program instructions. From a hardware aspect, as shown in fig. 6, it is a hardware structure diagram of a computer device 60 in which a live migration apparatus of a virtual machine example according to an embodiment of the present disclosure is located, except for the processor 612, the memory 630, the network interface 620, and the nonvolatile memory 540 shown in fig. 6, a server or an electronic device in which the apparatus is located in an embodiment may also include other hardware according to an actual function of the computer device, which is not described again.
In an exemplary embodiment of the present specification, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the present description may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present description described in the "exemplary methods" section above of the present description, when the program product is run on the terminal device.
A program product for implementing the above method according to an embodiment of the present specification may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present specification is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for this specification may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system elements and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (12)

1. A hot migration method of a virtual machine instance is applied to cloud service equipment and is characterized in that the cloud service equipment is provided with micro service hardware, and the virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service equipment; the method comprises the following steps:
responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the cloud service equipment, and writes the first operating data into a preset memory space;
the virtual machine simulator process acquires second operation data of the virtual machine instance on the micro-service hardware and third operation data of the virtual machine instance in a memory space of the cloud service equipment, and reads the first operation data from the preset memory space;
and the virtual machine simulator process sends the acquired first operation data, the acquired second operation data and the acquired third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment.
2. The method of claim 1,
the thermomigration conditions include any one of the following:
the numerical value corresponding to the operation index of the virtual machine instance reaches a preset threshold value;
a live migration instruction is received for the virtual machine instance.
3. The method of claim 1,
a service program used for acquiring and storing the first running data is realized in an operating system kernel carried by the cloud service equipment; a callback function is registered in an operating system kernel carried by the cloud service equipment; the callback function is automatically triggered when the virtual machine instance meets the live migration condition and is used for initiating the call of the service program;
the method for the operating system kernel to obtain the first running data of the virtual machine instance in the operating system kernel carried by the cloud service equipment and write the first running data into a preset memory space includes:
responding to that the virtual machine instance meets a live migration condition, triggering the callback function, initiating a call for the service program to operate the service program in an operating system kernel carried by the cloud service equipment, acquiring first operation data of the virtual machine instance on the cloud service equipment by the service program, and writing the first operation data into a preset memory space.
4. The method of claim 1,
the preset memory area comprises a reserved memory space applied from a memory space of the cloud server device corresponding to the virtual machine instance when the virtual machine instance is created.
5. The method of claim 1,
the first operational data includes:
virtual CPU state data and virtual device state data of the virtual machine instance on the cloud service device;
the second operational data includes:
virtual device state data of the virtual machine instance on the microservice hardware;
the third operational data includes:
and the virtual machine instance writes data of the memory space corresponding to the virtual machine instance.
6. The method of claim 1,
before the virtual machine simulator process sends the acquired first operation data, the second operation data and the third operation data to the target cloud service device, the method further includes:
acquiring cloud service equipment in a normal state at present;
and allocating target cloud service equipment as a migrated party from the normal cloud service equipment.
7. The method of claim 1,
the microservice hardware includes a microservice card.
8. The method of claim 1,
the virtual machine instance comprises a KVM virtual machine instance;
the virtual machine simulator process comprises a QEMU process.
9. A hot migration device of a virtual machine instance is applied to cloud service equipment and is characterized in that the cloud service equipment is provided with micro service hardware, and the virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the cloud service equipment; the device comprises:
a first obtaining unit, configured to, in response to that the virtual machine instance to be migrated meets a live migration condition, obtain, by the operating system kernel, first operating data of the virtual machine instance in the operating system kernel carried by the cloud service device, and write the first operating data into a preset memory space;
a second obtaining unit, configured to obtain, by the virtual machine simulator process, second operation data of the virtual machine instance on the micro service hardware and third operation data of the virtual machine instance in a memory space of the cloud service device, and read the first operation data from the preset memory space;
and a data sending unit, configured to send, by the virtual machine simulator process, the obtained first operation data, the obtained second operation data, and the obtained third operation data to a target cloud service device, so as to migrate the virtual machine instance to the target cloud service device.
10. A system, characterized in that the system comprises: the cloud service system comprises source cloud service equipment and target cloud service equipment;
the source cloud service equipment carries source micro service hardware, and the virtual machine instance to be migrated comprises a virtual machine simulator process running on the micro service hardware and a virtual machine driver running in an operating system kernel carried by the source cloud service equipment;
the source cloud service device is configured to: responding to that the virtual machine instance to be migrated meets a live migration condition, the operating system kernel acquires first operating data of the virtual machine instance in the operating system kernel carried by the source cloud service equipment, and writes the first operating data into a preset memory space; the virtual machine simulator process acquires second operation data of the virtual machine instance on the source micro-service hardware and third operation data of the virtual machine instance in a memory space of the source cloud service equipment, and reads the first operation data from the preset memory space; the virtual machine simulator process sends the acquired first operation data, the second operation data and the third operation data to target cloud service equipment so as to migrate the virtual machine instance to the target cloud service equipment;
the target cloud service equipment carries target micro-service hardware;
the target cloud service device is configured to: receiving the first running data, the second running data and the third running data sent by the source cloud service equipment in response to the virtual machine instance to be migrated meeting the live migration condition; and creating a virtual machine instance according to the received operation data, wherein the virtual machine instance comprises a virtual machine simulator process running on target micro-service hardware and a virtual machine driver running in an operating system kernel carried by the target cloud service equipment, so that the migration of the virtual machine instance from the source cloud service equipment to the target cloud service equipment is completed.
11. A storage medium, characterized in that a computer program is stored thereon which, when executed, carries out the steps of a method according to any one of claims 1-8.
12. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method of: wherein the processor, when executing the program, implements the method of any one of claims 1-8.
CN202210307611.5A 2022-03-25 2022-03-25 Hot migration method of virtual machine instance Pending CN114691300A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210307611.5A CN114691300A (en) 2022-03-25 2022-03-25 Hot migration method of virtual machine instance
PCT/CN2023/080978 WO2023179388A1 (en) 2022-03-25 2023-03-13 Hot migration method for virtual machine instance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210307611.5A CN114691300A (en) 2022-03-25 2022-03-25 Hot migration method of virtual machine instance

Publications (1)

Publication Number Publication Date
CN114691300A true CN114691300A (en) 2022-07-01

Family

ID=82139046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210307611.5A Pending CN114691300A (en) 2022-03-25 2022-03-25 Hot migration method of virtual machine instance

Country Status (2)

Country Link
CN (1) CN114691300A (en)
WO (1) WO2023179388A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115904616A (en) * 2022-11-04 2023-04-04 北京天融信网络安全技术有限公司 Virtual machine live migration method, device, equipment and medium
WO2023179388A1 (en) * 2022-03-25 2023-09-28 阿里巴巴(中国)有限公司 Hot migration method for virtual machine instance
WO2024021480A1 (en) * 2022-07-25 2024-02-01 天翼云科技有限公司 Method and apparatus for dynamic migration of virtual machine, and electronic device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8171349B2 (en) * 2010-06-18 2012-05-01 Hewlett-Packard Development Company, L.P. Associating a monitoring manager with an executable service in a virtual machine migrated between physical machines
CN110874264B (en) * 2018-08-30 2023-05-02 阿里巴巴集团控股有限公司 Instance thermomigration method and device, storage medium and processor
CN111026510A (en) * 2019-12-12 2020-04-17 北京中电普华信息技术有限公司 Cross-storage thermal migration method for virtual machine in cloud environment
CN113626131B (en) * 2020-05-07 2023-03-28 中科寒武纪科技股份有限公司 Method, chip, board card and storage medium for realizing thermal migration
CN114691300A (en) * 2022-03-25 2022-07-01 阿里巴巴(中国)有限公司 Hot migration method of virtual machine instance

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179388A1 (en) * 2022-03-25 2023-09-28 阿里巴巴(中国)有限公司 Hot migration method for virtual machine instance
WO2024021480A1 (en) * 2022-07-25 2024-02-01 天翼云科技有限公司 Method and apparatus for dynamic migration of virtual machine, and electronic device
CN115904616A (en) * 2022-11-04 2023-04-04 北京天融信网络安全技术有限公司 Virtual machine live migration method, device, equipment and medium
CN115904616B (en) * 2022-11-04 2023-11-10 北京天融信网络安全技术有限公司 Virtual machine hot migration method, device, equipment and medium

Also Published As

Publication number Publication date
WO2023179388A1 (en) 2023-09-28

Similar Documents

Publication Publication Date Title
US9619308B2 (en) Executing a kernel device driver as a user space process
KR102269452B1 (en) Supporting multiple operating system environments in computing device without contents conversion
CN107209683B (en) Backup image restore
CN114691300A (en) Hot migration method of virtual machine instance
CN105739961B (en) Starting method and device of embedded system
CN110083399B (en) Applet running method, computer device and storage medium
JP2015534184A (en) Flexible acceleration of code execution
US10572434B2 (en) Intelligent certificate discovery in physical and virtualized networks
US9448807B2 (en) Automatic creation, deployment, and upgrade of disk images
US9841985B2 (en) Storage block deallocation in virtual environments
CN111209080A (en) Transparent transmission method for graphic processor
CN115988217A (en) Virtualized video coding and decoding system, electronic equipment and storage medium
EP2466459A1 (en) Seamless application integration apparatus and method
US9898307B2 (en) Starting application processors of a virtual machine
US9699093B2 (en) Migration of virtual machine based on proximity to peripheral device in NUMA environment
US20190391835A1 (en) Systems and methods for migration of computing resources based on input/output device proximity
US10467078B2 (en) Crash dump extraction of guest failure
US20180203726A1 (en) Virtual machine migration method and apparatus
CN115309511A (en) Xen-based data interaction method and device, storage medium and electronic equipment
US9158554B2 (en) System and method for expediting virtual I/O server (VIOS) boot time in a virtual computing environment
CN113032088B (en) Dirty page recording method, device, electronic equipment and computer readable medium
US10379912B2 (en) Data storage allocation utilizing virtual machine resource allocation
US10719342B2 (en) Provisioning based on workload displacement
US10606681B2 (en) Incremental dump with fast reboot
CN113918284B (en) Method and device for cloud host batch migration, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination