WO2023179388A1 - Hot migration method for virtual machine instance - Google Patents

Hot migration method for virtual machine instance Download PDF

Info

Publication number
WO2023179388A1
WO2023179388A1 PCT/CN2023/080978 CN2023080978W WO2023179388A1 WO 2023179388 A1 WO2023179388 A1 WO 2023179388A1 CN 2023080978 W CN2023080978 W CN 2023080978W WO 2023179388 A1 WO2023179388 A1 WO 2023179388A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
cloud service
machine instance
data
service device
Prior art date
Application number
PCT/CN2023/080978
Other languages
French (fr)
Chinese (zh)
Inventor
刘派
Original Assignee
阿里巴巴(中国)有限公司
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 阿里巴巴(中国)有限公司 filed Critical 阿里巴巴(中国)有限公司
Publication of WO2023179388A1 publication Critical patent/WO2023179388A1/en

Links

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

Definitions

  • the embodiments of this specification relate to the field of computer technology, and more specifically, the embodiments of this specification relate to a method for live migration of virtual machine instances.
  • Cloud servers usually include virtual machine instances implemented through virtualization technology on cloud server devices. Through virtual machine instances, various services of cloud servers can be implemented. These businesses usually need to remain online in real time, so when the virtual machine instances need to be migrated from the current cloud service equipment, these businesses cannot be interrupted.
  • a method of live migration of virtual machine instances is provided, which is applied to cloud service equipment.
  • the cloud service equipment is equipped with microservice hardware.
  • the virtual machine instances to be migrated include those running on the microservices.
  • the virtual machine driver In response to the virtual machine instance to be migrated meeting the hot migration conditions, the virtual machine driver obtains the first running data of the virtual machine instance in the operating system kernel mounted on the cloud service device, and transfers the first The running data is written into the preset memory space;
  • the virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
  • the virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
  • a live migration device for virtual machine instances is provided, which is applied to cloud service equipment.
  • the cloud service equipment is equipped with microservice hardware.
  • the virtual machine instances to be migrated include those running on microservices.
  • a first acquisition unit configured to, in response to the virtual machine instance to be migrated satisfy the live migration condition, the virtual machine driver acquire the first running data of the virtual machine instance in the operating system kernel mounted on the cloud service device , and write the first operating data into the preset memory space;
  • a second acquisition unit configured to acquire, through the virtual machine simulator process, the second running data of the virtual machine instance on the microservice hardware and the memory space of the virtual machine instance in the cloud service device. third operating data, and reading the first operating data from the preset memory space;
  • a data sending unit configured to send the acquired first running data, the second running data and the third running data to a target cloud service device by the virtual machine simulator process, so as to send the virtual machine simulator to the target cloud service device. Migrate the machine instance to the target cloud service device.
  • a system in a third aspect of the implementation of this specification, includes: a source cloud service device and a destination cloud service device;
  • the source cloud service device is equipped with source microservice hardware.
  • the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine running in the operating system kernel installed on the source cloud service device. drive;
  • the source cloud service device is configured to: in response to the virtual machine instance to be migrated meeting the hot migration condition, the operating system kernel obtains the virtual machine instance in the operating system kernel installed on the source cloud service device. a running data, and writes the first running data into a preset memory space; the virtual machine simulator process obtains the second running data of the virtual machine instance on the source microservice hardware and the virtual The third running data of the machine instance in the memory space of the source cloud service device, and reads the first running data from the preset memory space; the virtual machine simulator process will obtain all the The first operating data, the second operating data and the third operating data are sent to the target cloud service device to migrate the virtual machine instance to the target cloud service device;
  • the target cloud service device is equipped with target microservice hardware
  • the target cloud service device is configured to: in response to the virtual machine instance to be migrated satisfying the live migration condition, accept the first operating data sent by the source cloud service device, the second operating data and the The third operating data; create a virtual machine instance according to the received operating data.
  • the virtual machine instance includes a virtual machine simulator process running on the target microservice hardware and an operating system running on the target cloud service device. Virtual machine driver in the kernel to complete the migration of virtual machine instances from the source cloud service device to the target cloud service device.
  • a storage medium is provided; a computer program is stored on the storage medium, and when the computer program is executed, the steps of the following method are implemented:
  • the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the first The running data is written into the preset memory space;
  • the virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
  • the virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
  • a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program Implement the following methods:
  • the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the first The running data is written into the preset memory space;
  • the virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
  • the virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
  • the running data of the virtual machine instance to be migrated on the cloud service equipment and microservice hardware is obtained in real time, and the virtual machine simulator process is used to migrate the virtual machine instance to be migrated.
  • the running data of the virtual machine instance is sent to the target service device. Since all running data of the virtual machine instance to be migrated is transferred to the target service device, the migrated virtual machine instance can continue to run on the target service device without causing business interruption.
  • Figure 1 schematically shows a schematic diagram of a virtual machine instance according to an embodiment of this specification
  • Figure 2 schematically shows an architectural diagram of a live migration system for a virtual machine instance according to an embodiment of this specification
  • Figure 3 schematically shows a flow chart of a method for live migration of a virtual machine instance according to an embodiment of this specification
  • Figure 4 schematically shows a block diagram of a live migration device for a virtual machine instance according to an embodiment of this specification
  • Figure 5 schematically shows an architectural diagram of a live migration system for a virtual machine instance according to an embodiment of this specification
  • FIG. 6 schematically shows a hardware structure diagram of a computer device where a live migration method of a virtual machine instance is implemented according to an embodiment of this specification.
  • Cloud servers are implemented through virtualization technology and cloud computing technology, and are deployed on cloud service platforms.
  • the cloud server of microservice architecture is an implementation architecture of cloud server.
  • FIG. 1 schematically shows a schematic structural diagram of a virtual machine instance according to an embodiment of this specification.
  • the cloud server with microservice architecture introduces a microservice hardware on the physical server and independently runs an operating system on the microservice hardware.
  • the microservice hardware can be a microservice card connected to the physical server through a bus, and provides services such as virtualization of input and output IO devices, processing and forwarding of IO requests to the physical server, so that the physical server can become like a virtual machine. flexible.
  • the virtual machine instance When the virtual machine instance is deployed on the cloud server of the above microservice architecture, the virtual machine instance can adopt a separated architecture, and the virtual machine simulator process of the virtual machine can be run on the microservice hardware, and the virtual machine simulator process and the physical
  • the server operating system kernel implements virtualization of hardware devices such as CPU, memory, and input and output devices to implement virtual machine instances.
  • multiple virtual machine embodiments can be deployed on the above-mentioned physical server at the same time, and the above-mentioned multiple virtual machine instances can share the above-mentioned physical server operating system kernel.
  • the virtual machine instances on a certain cloud service device may need to be migrated to a new cloud service device in some cases.
  • this application proposes a method to obtain the running data of the virtual machine instance to be migrated on cloud service equipment and microservice hardware in real time when the virtual machine instance to be migrated meets the conditions for live migration, and use the virtual machine simulator to process A live migration method that sends the running data of the virtual machine instance to be migrated to the virtual machine instance of the target service device.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • methods may include more or fewer steps than described in this specification.
  • a single step described in this specification may be broken down into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. describe.
  • FIG 2 is a schematic architectural diagram of a live migration system for virtual machine instances provided in an exemplary embodiment.
  • the system may include a network 20, a server 21, and several electronic devices, such as mobile phones 22, 23, and 24.
  • the server 21 may be a physical server including an independent host, or the server 21 may be a virtual server, cloud server, etc. hosted by a host cluster.
  • Cell phones 22-24 are just one type of electronic device available to users. In fact, users can obviously also use the following types of electronic devices: tablets, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc. One or more of this manual Various embodiments are not limited in this regard.
  • Network 20 may include various types of wired or wireless networks.
  • the server 21 can cooperate with the mobile phones 22-24; wherein the mobile phones 22-24 can accept user operations and upload the received commands and files to the server 21 through the network 20, and then the server 21 can The file is processed according to the program in the instructions.
  • the mobile phone 22-24 can independently implement the text processing solution of this description; wherein the mobile phone 22-24 accepts user operations and processes the accepted commands and files based on the solution of this description to realize virtualization. Live migration of machine instances.
  • Figure 3 is a flow chart of a method for live migration of a virtual machine instance provided by an exemplary embodiment. The method is applied to a processing device.
  • the processing device can be, for example, the server 21 or a mobile phone shown in Figure 2. 22-24 etc.
  • the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and an operating system kernel running on the cloud service equipment.
  • the virtual machine instance on the cloud server includes a virtual machine simulator process running on the microservice hardware and an operating system kernel driver installed on the cloud server device.
  • the above virtual machine simulator process and kernel driver jointly implement the CPU, memory, input and output devices, etc. Hardware virtualization.
  • the above-mentioned virtual machine simulator process realizes the virtualization of hardware such as input and output devices
  • the above-mentioned kernel driver jointly realizes the virtualization of hardware such as CPU and memory.
  • the above-mentioned microservice hardware includes a microservice card.
  • Microservice card such as MOC (microserver on card) card
  • MOC microserver on card
  • MOC microservice on card
  • PCIe system bus
  • This manual does not limit the specific type of operating system installed on the cloud service device.
  • it can be Linux, MacOS, or Windows, etc.
  • This manual does not limit the specific type of virtual machine instance.
  • it can be a KVM (Kernel-based Virtual Machine, kernel-based virtual machine) virtual machine instance, a Xen virtual machine instance, or a vbox virtual machine instance, etc.
  • KVM Kernel-based Virtual Machine, kernel-based virtual machine
  • this description does not limit the specific type of the virtual machine emulator process.
  • it can be a QEMU process, a VMware process, etc.
  • the virtual machine instance includes a KVM virtual machine instance; the virtual machine emulator process includes a QEMU process.
  • the operating system installed on the above cloud service device may be Linux, and the virtual machine instance may be a KVM virtual machine instance.
  • KVM virtual machine instances include virtual machine drivers integrated into the Linux operating system kernel in the form of modules, and the above-mentioned QEMU process.
  • Step 302 In response to the virtual machine instance to be migrated meeting the hot migration conditions, the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the The first operating data is written into the preset memory space;
  • virtual machine instances on cloud service devices may need to be live migrated.
  • This application does not specifically limit the specific form and content of the live migration conditions that the virtual machine instances to be migrated need to meet.
  • the live migration condition of a virtual machine instance may be that the value corresponding to the running indicator of the virtual machine instance reaches a preset threshold. It should be understood that when the values corresponding to the above-mentioned operating indicators reach the preset threshold, one or more operating indicators may be lower than the preset threshold, one or more operating indicators may be higher than the preset threshold, or one or more operating indicators may be higher than the preset threshold. Multiple operating indicators are equal to or not equal to the preset threshold, or a logical combination of the above situations. This specification does not specifically limit this.
  • the hot migration condition may be that the operating index A>100, and the operating index B is within the interval (1,10].
  • migration of relevant operating data of the virtual machine instance to be migrated begins.
  • the running data of the above-mentioned virtual machine instance includes: the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, the second running data of the virtual machine instance on the microservice hardware, and, the virtual machine The third running data of the instance in the memory space of the cloud service device.
  • the above-mentioned first operating data includes the virtual machine instance in the above-mentioned Virtual CPU status data and virtual device status data on the cloud service device.
  • the above virtual CPU status data may include vcpu_regs (general register data), vcpu_sregs (segment register data), fpu (floating point unit data) and other virtual CPU statuses.
  • the above-mentioned virtual device status data may include clock (clock data), ioapic (input and output advanced programmable interrupt controller data), rtc (real-time clock data) and other device status data.
  • first operating data can be organized in the form of a structure, or other data types can be used.
  • the first operating data in the operating system kernel installed on the cloud service device can be obtained through the operating system kernel and written into the preset memory space.
  • This specification does not specifically limit how the operating system kernel obtains the above-mentioned first operating data or writes it into the memory space.
  • it can be implemented directly through the virtual machine driver in the operating system kernel, or through other programs in the operating system kernel.
  • a service program for obtaining and storing the first operating data may be implemented in the operating system kernel mounted on the cloud service device.
  • Callback functions can be registered in the operating system kernel installed on the above-mentioned cloud service devices.
  • the above callback function can be triggered to initiate a call to the above service program.
  • the above service program can be run in the operating system kernel of the cloud service device to obtain the first running data of the virtual machine instance on the cloud service device, and write the first running data into the preset memory space.
  • 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 includes virtual machine drivers integrated into the Linux operating system kernel in the form of modules.
  • the virtual machine driver can manage virtual hardware resources and complete the allocation of virtual machine memory, the reading and writing of virtual machine registers, and the operation of the virtual machine CPU.
  • the service program kvm_save for obtaining and storing the first operating data can be implemented in the Linux operating system kernel installed on the cloud service device.
  • a callback function can be created and registered on the Linux kernel operating system, where the triggering condition of the callback function can be set to the above live migration conditions.
  • the callback function can be triggered, and the service program kvm_save obtains the first running data on the above-mentioned cloud service device, including virtual CPU status data and virtual device status data, and saves it to the above-mentioned preset memory. space.
  • this specification does not limit the manner in which the above-mentioned service program obtains the above-mentioned first operating data.
  • 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 will create a corresponding struct_kvm structure for the virtual machine instance to store the virtual CPU state, and synchronize the address of the struct_kvm to the service program kvm_save.
  • the virtual CPU status will be saved into the struct_kvm structure in the data structure of vmcs (Virtual Machine Control Structure, virtual machine control structure).
  • the service program kvm_save can call the virtual CPU
  • the status reading function vmcs_read obtains the corresponding virtual CPU status data from the vmcs data structure saved in the struct_kvm structure.
  • the preset memory area includes a preset memory area applied from the memory space of the cloud service device corresponding to the virtual machine instance when the virtual machine instance is created. Leave memory space.
  • the reserved memory space is in the memory of the cloud service device rather than the memory of the virtual machine instance, the reserved memory space can still be easily read after the virtual machine instance stops running.
  • This application does not limit the specific method of applying for reserved memory.
  • it can be implemented through the above-mentioned virtual machine simulator process, or through the operating system kernel installed on the above-mentioned cloud service device.
  • the virtual machine instance is a KVM virtual machine instance and the operating system installed on the cloud service device is Linux.
  • the above reserved memory can be that the virtual machine simulator process applies for memory in the above service program kvm_save through the input and output control function IOCTL, and allocates and obtains the physical address of this memory space through the memory allocation function kzalloc. This allows the service program kvm_save to write the obtained first operation data into the reserved memory space after obtaining the first operation data.
  • Step 304 The virtual machine simulator process obtains the second running data of the virtual machine instance on the microservice hardware, and reads the first running data from the preset memory space;
  • the virtual machine simulator process can obtain the first operating data of the reserved memory space.
  • live migration of the virtual machine instance also requires migrating the second running data of the above virtual machine instance on the microservice hardware. Therefore, the virtual machine simulator process can obtain the second running data of the virtual machine instance on the microservice hardware.
  • the second running data includes: virtual device status data of the virtual machine instance on the microservice hardware.
  • the running data of the virtual machine instance includes the device status data on the above-mentioned microservice hardware.
  • this manual does not specifically limit the way in which the virtual machine simulator process obtains the device status data on the above-mentioned microservice hardware.
  • this part of the device status data can usually be saved by the virtual machine simulator process on the microservice hardware, and therefore can be directly obtained by the above-mentioned virtual machine simulator process.
  • the third running data includes: data written by the virtual machine instance into the memory space corresponding to the virtual machine instance.
  • the running data of a virtual machine instance includes the memory data of the virtual machine instance, that is, the data written into the memory space corresponding to the virtual machine instance.
  • the memory space corresponding to the above-mentioned virtual machine instance is virtualized memory, which can be obtained by virtualizing the memory of the above-mentioned cloud server device.
  • the virtual machine simulator process can manage the data in the memory space corresponding to the virtual machine instance. Therefore, the virtual machine emulator process can obtain the memory data of the virtual machine instance.
  • the memory space corresponding to the virtual machine instance can be managed in MemoryRegion mode.
  • MemoryRegion MemoryRegion
  • an MR is used to represent a memory address.
  • MR includes many categories, such as RAM, MMIO, container, alias, etc.
  • the QUMU process can create a data structure named RamBlock for each of the above MRs, and all RamBlocks are strung together in the form of a linked list.
  • the QEMU process can read the above RamBlock linked list to obtain the customer physical address (gpa) of various types of memory.
  • the customer physical addresses of some MRs are stored in the form of variables in the QEMU process and can be obtained directly; some special MRs have blank memory reserved between them, and a structure can be used to record the size of the blank memory in advance. Based on the read value and the size of the blank memory, the customer's physical address of the actual memory data can be calculated.
  • the customer physical address of various types of memory can be converted into the physical address of the memory on the cloud service device.
  • the QEMU process can pass the DMA of the virtual machine instance. Channel to obtain the data of the memory space corresponding to the virtual machine instance.
  • Step 306 The virtual machine simulator process sends the obtained first running data, the second running data and the third running data to the target cloud service device to migrate the virtual machine instance to The target cloud service device.
  • the virtual machine simulator process can send the running data of these virtual machine instances to the target cloud server device.
  • this manual does not specifically limit the selection of target cloud service equipment.
  • an available cloud service device can be randomly selected as the target cloud server, or the user can specify a specific cloud service device as the target cloud server, etc.
  • cloud service devices that are currently in a normal state can be obtained; and from the cloud service devices in a normal state, a target cloud service device as the migrated party is allocated.
  • the target cloud service device may be any of the cloud service devices in the above normal state.
  • This application does not specifically limit the manner in which the virtual machine simulator process sends the above running data to the target cloud server device.
  • Figure 4 is a block diagram of a live migration device for a virtual machine instance according to an embodiment of this specification.
  • the device is applied to cloud service equipment.
  • the cloud service equipment is equipped with microservice hardware.
  • the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and an operating system running on the cloud service equipment.
  • Virtual machine driver in the kernel; the device includes:
  • the first acquisition unit 410 is configured to, in response to the virtual machine instance to be migrated satisfy the hot migration condition, the operating system kernel obtain the first operation status of the virtual machine instance in the operating system kernel installed on the cloud service device. row data, and write the first running data into the preset memory space;
  • the second acquisition unit 420 is used to acquire, from the virtual machine simulator process, the second running data of the virtual machine instance on the microservice hardware and the memory space of the virtual machine instance in the cloud service device.
  • the third operating data and reads the first operating data from the preset memory space;
  • the data sending unit 440 is configured to send the obtained first running data, the second running data and the third running data to the target cloud service device by the virtual machine simulator process, so as to send the obtained The virtual machine instance is migrated to the target cloud service device.
  • the live migration conditions include any of the following: the value corresponding to the running indicator of the virtual machine instance reaches a preset threshold; a live migration instruction for the virtual machine instance is received.
  • a service program for obtaining and storing the first operating data is implemented in the operating system kernel installed on the cloud service device; a callback function is registered in the operating system kernel installed on the cloud service device; so The callback function is automatically triggered when the virtual machine instance meets the live migration conditions and is used to initiate a call to the service program;
  • the first acquisition unit 410 is specifically configured to respond to the virtual machine instance meeting the live migration conditions, trigger the callback function, and initiate a call to the service program to run the operating system kernel installed on the cloud service device.
  • the service program obtains the first running data of the virtual machine instance on the cloud service device, and writes the first running data into a preset memory space.
  • the preset memory area includes reserved memory space applied from the memory space of the cloud server device corresponding to the virtual machine instance when the virtual machine instance is created.
  • the first running data includes: virtual CPU status data and virtual device status data of the virtual machine instance on the cloud service device; the second running data includes: the virtual machine instance on the cloud service device.
  • the third operating data includes: data written by the virtual machine instance into the memory space corresponding to the virtual machine instance.
  • the apparatus further includes: a target selection unit 430, configured to obtain the cloud service equipment currently in a normal state; and allocate the target cloud service equipment as the migrated party from the cloud service equipment in the normal state.
  • a target selection unit 430 configured to obtain the cloud service equipment currently in a normal state; and allocate the target cloud service equipment as the migrated party from the cloud service equipment in the normal state.
  • the microservice hardware includes a microservice card.
  • the virtual machine instance includes a KVM virtual machine instance; the virtual machine emulator process includes a QEMU process.
  • the device embodiment since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution in this specification. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
  • Figure 5 is a schematic architectural diagram of a live migration system for virtual machine instances according to an embodiment of this specification.
  • the system includes: source cloud service equipment and destination cloud service equipment;
  • the source cloud service device is equipped with source microservice hardware.
  • the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine running in the operating system kernel installed on the source cloud service device. drive;
  • the source cloud service device is configured to: in response to the virtual machine instance to be migrated meeting the hot migration condition, the operating system kernel obtains the virtual machine instance in the operating system kernel installed on the source cloud service device. a running data, and writes the first running data into a preset memory space; the virtual machine simulator process obtains the second running data of the virtual machine instance on the source microservice hardware and the virtual The third running data of the machine instance in the memory space of the source cloud service device, and reads the first running data from the preset memory space; the virtual machine simulator process will obtain all the The first operating data, the second operating data and the third operating data are sent to the target cloud service device to migrate the virtual machine instance to the target cloud service device;
  • the target cloud service device is equipped with target microservice hardware
  • the target cloud service device is configured to: in response to the virtual machine instance to be migrated satisfying the live migration condition, accept the first operating data sent by the source cloud service device, the second operating data and the The third operating data; create a virtual machine instance according to the received operating data.
  • the virtual machine instance includes a virtual machine simulator process running on the target microservice hardware and an operating system running on the target cloud service device. Virtual machine driver in the kernel to complete the migration of virtual machine instances from the source cloud service device to the target cloud service device.
  • the embodiments of the live migration device for virtual machine instances in this specification can be applied to computer equipment, such as servers or terminal equipment.
  • the device embodiments may be implemented by software, or may be implemented by hardware or a combination of software and hardware.
  • Taking software implementation as an example as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running it through its processor. From the hardware level, as shown in Figure 6, it is a hardware structure diagram of the computer device 60 where the live migration device of a virtual machine instance is located in the embodiment of this specification.
  • the server or electronic equipment where the device is located in the embodiment may also include other hardware according to the actual functions of the computer equipment, which will not be described again.
  • a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored.
  • various aspects of this specification can also be implemented in the form of a program product, which includes program code.
  • the program product is run on a terminal device, the program code is used to cause the The terminal device performs the steps according to various exemplary embodiments of this specification described in the above-mentioned "Exemplary Method" section of this specification.
  • the program product used to implement the above method according to the embodiment of the present specification can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer.
  • CD-ROM compact disk read-only memory
  • the program product of this specification is not limited thereto.
  • the readable storage medium may be any containing or A tangible medium that stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the program product may take the form of 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a readable signal medium may also be any readable medium other than a readable storage medium that can send, propagate, or transport the 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 suitable medium, including but not limited to wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.
  • Program code for performing the operations of this specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedures programming language - such as "C" or a similar programming language.
  • 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 execute on.
  • 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, such as provided by an Internet service. (business comes via Internet connection).
  • LAN local area network
  • WAN wide area network

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

Provided in the present description is a hot migration method for a virtual machine instance, which method is applied to a cloud service device. The cloud service device carries micro-service hardware, and a virtual machine instance comprises a virtual machine simulator process on the micro-service hardware and a virtual machine driver in an operating system kernel which is carried by the cloud service device. The method comprises: in response to a virtual machine instance to be migrated meeting a hot migration condition, an operating system kernel acquiring first running data of the virtual machine instance in the operating system kernel which is carried by a cloud service device, and writing the first running data into a preset memory space; a virtual machine simulator process acquiring second running data of the virtual machine instance on micro-service hardware and third running data of the virtual machine instance in a memory space of the cloud service device, and reading the first running data from the preset memory space; and the virtual machine simulator process sending the acquired running data to a target cloud service device, so as to migrate the virtual machine instance to the target cloud service device.

Description

一种虚拟机实例的热迁移方法A method of live migration of virtual machine instances
本申请要求于2022年03月25日提交中国专利局、申请号为202210307611.5、申请名称为“一种虚拟机实例的热迁移方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on March 25, 2022, with the application number 202210307611.5 and the application name "A method for live migration of virtual machine instances", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本说明书的实施方式涉及计算机技术领域,更具体地,本说明书的实施方式涉及一种虚拟机实例的热迁移方法。The embodiments of this specification relate to the field of computer technology, and more specifically, the embodiments of this specification relate to a method for live migration of virtual machine instances.
背景技术Background technique
本部分旨在为权利要求书中陈述的本说明书的实施方式提供背景或上下文。此处的描述不因为包括在本部分中就承认是现有技术。This section is intended to provide background or context for the implementation of this specification as set forth in the claims. The description herein is not admitted to be prior art by inclusion in this section.
云服务器通常包括在云服务器设备上通过虚拟化技术实现的虚拟机实例。通过虚拟机实例,可以实现云服务器的各种业务。这些业务通常需要保持实时在线,因此当虚拟机实例需要从当前云服务设备进行迁移时,不能使这些业务发生中断。Cloud servers usually include virtual machine instances implemented through virtualization technology on cloud server devices. Through virtual machine instances, various services of cloud servers can be implemented. These businesses usually need to remain online in real time, so when the virtual machine instances need to be migrated from the current cloud service equipment, these businesses cannot be interrupted.
发明内容Contents of the invention
为克服相关技术中存在的问题,本说明书提供了以下方法及装置。In order to overcome the problems existing in related technologies, this specification provides the following methods and devices.
在本说明书实施方式的第一方面中,提供了一种虚拟机实例的热迁移方法,应用于云服务设备,所述云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;所述方法包括:In the first aspect of the implementation of this specification, a method of live migration of virtual machine instances is provided, which is applied to cloud service equipment. The cloud service equipment is equipped with microservice hardware. The virtual machine instances to be migrated include those running on the microservices. The virtual machine simulator process on the service hardware and the virtual machine driver running in the operating system kernel carried by the cloud service device; the method includes:
响应于所述待迁移的虚拟机实例满足热迁移条件,所述虚拟机驱动获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;In response to the virtual machine instance to be migrated meeting the hot migration conditions, the virtual machine driver obtains the first running data of the virtual machine instance in the operating system kernel mounted on the cloud service device, and transfers the first The running data is written into the preset memory space;
所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;The virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。 The virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
在本说明书实施方式的第二方面中,提供了一种虚拟机实例的热迁移装置,应用于云服务设备,所述云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;所述装置包括:In the second aspect of the implementation of this specification, a live migration device for virtual machine instances is provided, which is applied to cloud service equipment. The cloud service equipment is equipped with microservice hardware. The virtual machine instances to be migrated include those running on microservices. The virtual machine simulator process on the service hardware and the virtual machine driver running in the operating system kernel carried by the cloud service equipment; the device includes:
第一获取单元,用于响应于所述待迁移的虚拟机实例满足热迁移条件,所述虚拟机驱动获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;A first acquisition unit configured to, in response to the virtual machine instance to be migrated satisfy the live migration condition, the virtual machine driver acquire the first running data of the virtual machine instance in the operating system kernel mounted on the cloud service device , and write the first operating data into the preset memory space;
第二获取单元,用于由所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;A second acquisition unit configured to acquire, through the virtual machine simulator process, the second running data of the virtual machine instance on the microservice hardware and the memory space of the virtual machine instance in the cloud service device. third operating data, and reading the first operating data from the preset memory space;
数据发送单元,用于由所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。A data sending unit, configured to send the acquired first running data, the second running data and the third running data to a target cloud service device by the virtual machine simulator process, so as to send the virtual machine simulator to the target cloud service device. Migrate the machine instance to the target cloud service device.
在本说明书实施方式的第三方面,提供了一种系统;所述系统包括:源云服务设备和目的云服务设备;In a third aspect of the implementation of this specification, a system is provided; the system includes: a source cloud service device and a destination cloud service device;
所述源云服务设备搭载了源微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述源云服务设备搭载的操作系统内核中的虚拟机驱动;The source cloud service device is equipped with source microservice hardware. The virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine running in the operating system kernel installed on the source cloud service device. drive;
所述源云服务设备用于:响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述源云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;所述虚拟机模拟器进程获取所述虚拟机实例在所述源微服务硬件上的第二运行数据和所述虚拟机实例在所述源云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备;The source cloud service device is configured to: in response to the virtual machine instance to be migrated meeting the hot migration condition, the operating system kernel obtains the virtual machine instance in the operating system kernel installed on the source cloud service device. a running data, and writes the first running data into a preset memory space; the virtual machine simulator process obtains the second running data of the virtual machine instance on the source microservice hardware and the virtual The third running data of the machine instance in the memory space of the source cloud service device, and reads the first running data from the preset memory space; the virtual machine simulator process will obtain all the The first operating data, the second operating data and the third operating data are sent to the target cloud service device to migrate the virtual machine instance to the target cloud service device;
所述目标云服务设备搭载了目标微服务硬件;The target cloud service device is equipped with target microservice hardware;
所述目标云服务设备用于:响应于所述待迁移的虚拟机实例满足所述热迁移条件,接受所述源云服务设备发送的所述第一运行数据,所述第二运行数据和所述第三运行数据;根据接收到的运行数据,创建虚拟机实例,所述虚拟机实例包括运行在目标微服务硬件上的虚拟机模拟器进程和运行在所述目标云服务设备搭载的操作系统内核中的虚拟机驱动,以完成虚拟机实例从源云服务设备到目标云服务设备的迁移。The target cloud service device is configured to: in response to the virtual machine instance to be migrated satisfying the live migration condition, accept the first operating data sent by the source cloud service device, the second operating data and the The third operating data; create a virtual machine instance according to the received operating data. The virtual machine instance includes a virtual machine simulator process running on the target microservice hardware and an operating system running on the target cloud service device. Virtual machine driver in the kernel to complete the migration of virtual machine instances from the source cloud service device to the target cloud service device.
在本说明书实施方式的第四方面中,提供了一种存储介质;所述存储介质上存储有计算机程序,该计算机程序执行时实现如下所述方法的步骤:In a fourth aspect of the implementation of this specification, a storage medium is provided; a computer program is stored on the storage medium, and when the computer program is executed, the steps of the following method are implemented:
响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间; In response to the virtual machine instance to be migrated meeting the hot migration conditions, the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the first The running data is written into the preset memory space;
所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;The virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。The virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
在本说明书实施方式的第五方面中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如下方法:In a fifth aspect of the embodiment of this specification, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program Implement the following methods:
响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;In response to the virtual machine instance to be migrated meeting the hot migration conditions, the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the first The running data is written into the preset memory space;
所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;The virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。The virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
在本说明书以上的实施方式,至少具有如下的有益效果:The above embodiments in this specification have at least the following beneficial effects:
在以上技术方案中,通过在待迁移的虚拟机实例满足热迁移条件时,实时获取待迁移虚拟机实例在云服务设备和微服务硬件上的运行数据,并通过虚拟机模拟器进程将待迁移虚拟机实例的运行数据发送到目标服务设备。由于待迁移虚拟机实例的一切运行数据都转移到了目标服务设备,使得迁移后的虚拟机实例可以在目标服务设备上继续运行,而不会导致业务的中断。In the above technical solution, when the virtual machine instance to be migrated meets the live migration conditions, the running data of the virtual machine instance to be migrated on the cloud service equipment and microservice hardware is obtained in real time, and the virtual machine simulator process is used to migrate the virtual machine instance to be migrated. The running data of the virtual machine instance is sent to the target service device. Since all running data of the virtual machine instance to be migrated is transferred to the target service device, the migrated virtual machine instance can continue to run on the target service device without causing business interruption.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of this specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
图1示意性地示出了根据本说明书实施方式的一种虚拟机实例的示意图;Figure 1 schematically shows a schematic diagram of a virtual machine instance according to an embodiment of this specification;
图2示意性地示出了根据本说明书实施方式的一种虚拟机实例的热迁移系统的架构示意图;Figure 2 schematically shows an architectural diagram of a live migration system for a virtual machine instance according to an embodiment of this specification;
图3示意性地示出了根据本说明书实施方式的一种虚拟机实例的热迁移方法的流程图; Figure 3 schematically shows a flow chart of a method for live migration of a virtual machine instance according to an embodiment of this specification;
图4示意性地示出了根据本说明书实施方式的一种虚拟机实例的热迁移装置的框图;Figure 4 schematically shows a block diagram of a live migration device for a virtual machine instance according to an embodiment of this specification;
图5示意性地示出了根据本说明书实施方式的一种虚拟机实例的热迁移系统的架构示意图;Figure 5 schematically shows an architectural diagram of a live migration system for a virtual machine instance according to an embodiment of this specification;
图6示意性地示出了根据本说明书实施方式的一种虚拟机实例的热迁移方法所在计算机设备的一种硬件结构图。FIG. 6 schematically shows a hardware structure diagram of a computer device where a live migration method of a virtual machine instance is implemented according to an embodiment of this specification.
在附图中,相同或对应的标号表示相同或对应的部分。In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
具体实施方式Detailed ways
下面将参考若干示例性实施方式来描述本说明书的原理和精神。应当理解,给出这些实施方式仅仅是为了使本领域技术人员能够更好地理解进而实现本说明书,而并非以任何方式限制本说明书的范围。相反,提供这些实施方式是为了使本说明书更加透彻和完整,并且能够将本说明书的范围完整地传达给本领域的技术人员。The principles and spirit of the present specification will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present specification, and are not intended to limit the scope of the present specification 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 disclosure to those skilled in the art.
本领域技术人员知道,本说明书的实施方式可以实现为一种系统、装置、设备、方法或计算机程序产品。因此,本说明书可以具体实现为以下形式,即:完全的硬件、完全的软件(包括固件、驻留软件、微代码等),或者硬件和软件结合的形式。Those skilled in the art know that the embodiments of this specification can be implemented as a system, device, equipment, method or computer program product. Therefore, this specification can be implemented in the following form, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
云服务器是通过虚拟化技术和云计算技术实现的,部署在云端的服务平台。微服务架构的云服务器是云服务器的一种实现架构。Cloud servers are implemented through virtualization technology and cloud computing technology, and are deployed on cloud service platforms. The cloud server of microservice architecture is an implementation architecture of cloud server.
例如,请参见图1,图1示意性地示出了根据本说明书实施方式的一种虚拟机实例的结构示意图。For example, please refer to FIG. 1 , which schematically shows a schematic structural diagram of a virtual machine instance according to an embodiment of this specification.
微服务架构的云服务器在物理服务器上引入一个微服务硬件,并在该微服务硬件上独立运行一个操作系统。该微服务硬件可以是通过总线连接到物理服务器的微服务卡,并面向该物理服务器提供输入输出IO设备的虚拟、IO请求的处理和转发等服务,使得该物理服务器可以变得像虚拟机一样灵活。The cloud server with microservice architecture introduces a microservice hardware on the physical server and independently runs an operating system on the microservice hardware. The microservice hardware can be a microservice card connected to the physical server through a bus, and provides services such as virtualization of input and output IO devices, processing and forwarding of IO requests to the physical server, so that the physical server can become like a virtual machine. flexible.
当虚拟机实例部署在上述微服务架构的云服务器上时,虚拟机实例可以采用分离架构,可以在微服务硬件上运行虚拟机的虚拟机模拟器进程,并通过该虚拟机模拟器进程以及物理服务器操作系统内核实现CPU、内存、输入输出设备等硬件设备的虚拟化,来实现虚拟机实例。When the virtual machine instance is deployed on the cloud server of the above microservice architecture, the virtual machine instance can adopt a separated architecture, and the virtual machine simulator process of the virtual machine can be run on the microservice hardware, and the virtual machine simulator process and the physical The server operating system kernel implements virtualization of hardware devices such as CPU, memory, and input and output devices to implement virtual machine instances.
其中,上述物理服务器上,可以同时部署多个虚拟机实施例,上述多个虚拟机实例可以共用上述物理服务器操作系统内核。Wherein, multiple virtual machine embodiments can be deployed on the above-mentioned physical server at the same time, and the above-mentioned multiple virtual machine instances can share the above-mentioned physical server operating system kernel.
在使用上述微服务架构的云服务器的场景下,某一云服务设备上的虚拟机实例在某些情况下可能需要迁移到新的云服务设备上。In the scenario of using the cloud server with the above microservice architecture, the virtual machine instances on a certain cloud service device may need to be migrated to a new cloud service device in some cases.
由于云服务器上的各种业务。这些业务通常需要保持实时在线,因此当虚拟机实例需要从当前云服务设备进行迁移时,不能使这些业务发生中断。Due to various businesses on cloud servers. These businesses usually need to remain online in real time, so when the virtual machine instances need to be migrated from the current cloud service equipment, these businesses cannot be interrupted.
有鉴于此,本申请提出了一种通过在待迁移的虚拟机实例满足热迁移条件时,实时获取待迁移虚拟机实例在云服务设备和微服务硬件上的运行数据,并通过虚拟机模拟器进程 将待迁移虚拟机实例的运行数据发送到目标服务设备的虚拟机实例的热迁移方法。In view of this, this application proposes a method to obtain the running data of the virtual machine instance to be migrated on cloud service equipment and microservice hardware in real time when the virtual machine instance to be migrated meets the conditions for live migration, and use the virtual machine simulator to process A live migration method that sends the running data of the virtual machine instance to be migrated to the virtual machine instance of the target service device.
以下将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail below, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to 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 this specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, methods may include more or fewer steps than described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. describe.
图2是一示例性实施例提供的一种虚拟机实例的热迁移系统的架构示意图。如图1所示,该系统可以包括网络20、服务器21、若干电子设备,如手机22、手机23和手机24等。Figure 2 is a schematic architectural diagram of a live migration system for virtual machine instances provided in an exemplary embodiment. As shown in Figure 1, the system may include a network 20, a server 21, and several electronic devices, such as mobile phones 22, 23, and 24.
服务器21可以为包含一独立主机的物理服务器,或者该服务器21可以为主机集群承载的虚拟服务器、云服务器等。手机22-24只是用户可以使用的一种类型的电子设备。实际上,用户显然还可以使用诸如下述类型的电子设备:平板设备、笔记本电脑、掌上电脑(PDAs,Personal Digital Assistants)、可穿戴设备(如智能眼镜、智能手表等)等,本说明书一个或多个实施例并不对此进行限制。网络20可以包括多种类型的有线或无线网络。The server 21 may be a physical server including an independent host, or the server 21 may be a virtual server, cloud server, etc. hosted by a host cluster. Cell phones 22-24 are just one type of electronic device available to users. In fact, users can obviously also use the following types of electronic devices: tablets, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc. One or more of this manual Various embodiments are not limited in this regard. Network 20 may include various types of wired or wireless networks.
在一实施例中,服务器21可以与手机22-24进行配合;其中,可由手机22-24接受用户操作,并将接受到的命令和文件通过网络20上传至服务器21,然后由服务器21基于本说明书的方案对文件进行处理。在另一实施例中,手机22-24可以独立实现本说明书的文本处理方案;其中,由手机22-24接受用户操作,并基于本说明书的方案对接受的命令和文件进行处理,以实现虚拟机实例的热迁移。In one embodiment, the server 21 can cooperate with the mobile phones 22-24; wherein the mobile phones 22-24 can accept user operations and upload the received commands and files to the server 21 through the network 20, and then the server 21 can The file is processed according to the program in the instructions. In another embodiment, the mobile phone 22-24 can independently implement the text processing solution of this description; wherein the mobile phone 22-24 accepts user operations and processes the accepted commands and files based on the solution of this description to realize virtualization. Live migration of machine instances.
下面结合附图对本说明书的方案进行详细说明。The solutions of this specification will be described in detail below with reference to the accompanying drawings.
请参见图3,图3是一示例性实施例提供的一种虚拟机实例的热迁移方法的流程图,该方法应用于处理设备,该处理设备例如可以为图2所示的服务器21或手机22-24等。Please refer to Figure 3. Figure 3 is a flow chart of a method for live migration of a virtual machine instance provided by an exemplary embodiment. The method is applied to a processing device. The processing device can be, for example, the server 21 or a mobile phone shown in Figure 2. 22-24 etc.
该方法应用于云服务设备,该云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;This method is applied to cloud service equipment, which is equipped with microservice hardware. The virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and an operating system kernel running on the cloud service equipment. Virtual machine driver in;
云服务器上的虚拟机实例包括微服务硬件上运行了虚拟机模拟器进程和云服务器设备搭载的操作系统内核驱动,上述虚拟机模拟器进程和内核驱动共同实现了CPU,内存,输入输出设备等硬件的虚拟化。The virtual machine instance on the cloud server includes a virtual machine simulator process running on the microservice hardware and an operating system kernel driver installed on the cloud server device. The above virtual machine simulator process and kernel driver jointly implement the CPU, memory, input and output devices, etc. Hardware virtualization.
在本说明书示出的一个实施例中,上述虚拟机模拟器进程实现了输入输出设备等硬件的虚拟化,上述内核驱动共同实现了CPU,内存等硬件的虚拟化。 In one embodiment shown in this specification, the above-mentioned virtual machine simulator process realizes the virtualization of hardware such as input and output devices, and the above-mentioned kernel driver jointly realizes the virtualization of hardware such as CPU and memory.
在本说明书示出的一个实施例中,上述微服务硬件包括微服务卡。In one embodiment shown in this specification, the above-mentioned microservice hardware includes a microservice card.
微服务卡,例如MOC(microserver on card)卡,是一种微服务硬件,是一种自带CPU和ROM/RAM的物理板卡设备,能够运行独立的操作系统,同时可以通过系统总线(例如PCIe)连入到物理服务器上,对该服务器提供输入输出设备的虚拟、输入输出请求的处理和转发等服务。Microservice card, such as MOC (microserver on card) card, is a kind of microservice hardware. It is a physical board device with its own CPU and ROM/RAM. It can run an independent operating system and can be connected through the system bus (such as PCIe) is connected to a physical server and provides services such as virtualization of input and output devices, processing and forwarding of input and output requests to the server.
本说明书不对云服务设备搭载的操作系统的具体类型进行限定,例如,可以是Linux,MacOS,或Windows等。This manual does not limit the specific type of operating system installed on the cloud service device. For example, it can be Linux, MacOS, or Windows, etc.
本说明书不对虚拟机实例的具体类型进行限定,例如,可以是KVM(Kernel-based Virtual Machine,基于内核的虚拟机)虚拟机实例,Xen虚拟机实例,或vbox虚拟机实例等。This manual does not limit the specific type of virtual machine instance. For example, it can be a KVM (Kernel-based Virtual Machine, kernel-based virtual machine) virtual machine instance, a Xen virtual machine instance, or a vbox virtual machine instance, etc.
同样的,本说明不对虚拟机模拟器进程的具体类型进行限定,例如,可以是QEMU进程,VMware进程等。Similarly, this description does not limit the specific type of the virtual machine emulator process. For example, it can be a QEMU process, a VMware process, etc.
在本说明书示出的一个实施例中,所述虚拟机实例包括KVM虚拟机实例;所述虚拟机模拟器进程包括QEMU进程。In one embodiment shown in this specification, the virtual machine instance includes a KVM virtual machine instance; the virtual machine emulator process includes a QEMU process.
上述云服务设备搭载的操作系统可以是Linux,虚拟机实例可以是KVM虚拟机实例。KVM虚拟机实例包括以模块形式集成到Linux操作系统内核中的虚拟机驱动,以及上述QEMU进程。The operating system installed on the above cloud service device may be Linux, and the virtual machine instance may be a KVM virtual machine instance. KVM virtual machine instances include virtual machine drivers integrated into the Linux operating system kernel in the form of modules, and the above-mentioned QEMU process.
上述方法执行以下步骤:The above method performs the following steps:
步骤302,响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;Step 302: In response to the virtual machine instance to be migrated meeting the hot migration conditions, the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the The first operating data is written into the preset memory space;
在某些情况下,云服务设备上的虚拟机实例可能需要进行热迁移。对于待迁移的虚拟机实例需要满足的热迁移条件的具体形式和内容,本申请不进行具体限定。In some cases, virtual machine instances on cloud service devices may need to be live migrated. This application does not specifically limit the specific form and content of the live migration conditions that the virtual machine instances to be migrated need to meet.
在本申请示出的一个示例性的实施例中,虚拟机实例的热迁移条件可能是该虚拟机实例的运行指标对应的数值到达预设的阈值。应当理解的是,上述运行指标对应的数值到达预设的阈值,可以是某一个或多个运行指标低于预设的阈值,某一个或多个运行指标高于预设的阈值,某一个或多个运行指标等于或不等于预设的阈值,或上述多种情况的逻辑组合,本说明书不对此进行具体限定。In an exemplary embodiment shown in this application, the live migration condition of a virtual machine instance may be that the value corresponding to the running indicator of the virtual machine instance reaches a preset threshold. It should be understood that when the values corresponding to the above-mentioned operating indicators reach the preset threshold, one or more operating indicators may be lower than the preset threshold, one or more operating indicators may be higher than the preset threshold, or one or more operating indicators may be higher than the preset threshold. Multiple operating indicators are equal to or not equal to the preset threshold, or a logical combination of the above situations. This specification does not specifically limit this.
例如,热迁移条件可以是运行指标A>100,且运行指标B处于区间(1,10]之内。For example, the hot migration condition may be that the operating index A>100, and the operating index B is within the interval (1,10].
响应于待迁移的虚拟机实例满足上述热迁移条件,开始对待迁移的虚拟机实例的相关运行数据进行迁移。In response to the virtual machine instance to be migrated meeting the above hot migration conditions, migration of relevant operating data of the virtual machine instance to be migrated begins.
其中,上述虚拟机实例的运行数据包括:虚拟机实例在云服务设备搭载的操作系统内核中的第一运行数据,虚拟机实例在所述微服务硬件上的第二运行数据,以及,虚拟机实例在云服务设备内存空间中的第三运行数据。Wherein, the running data of the above-mentioned virtual machine instance includes: the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, the second running data of the virtual machine instance on the microservice hardware, and, the virtual machine The third running data of the instance in the memory space of the cloud service device.
在本说明书示出的一个示意性的实施例中,上述第一运行数据包括虚拟机实例在上述 云服务设备上的虚拟CPU状态数据和虚拟设备状态数据。In an illustrative embodiment shown in this specification, the above-mentioned first operating data includes the virtual machine instance in the above-mentioned Virtual CPU status data and virtual device status data on the cloud service device.
其中,上述虚拟CPU状态数据可以包括vcpu_regs(通用寄存器数据),vcpu_sregs(段寄存器数据),fpu(浮点运算器数据)等虚拟CPU状态。The above virtual CPU status data may include vcpu_regs (general register data), vcpu_sregs (segment register data), fpu (floating point unit data) and other virtual CPU statuses.
上述虚拟设备状态数据可以包括clock(时钟数据),ioapic(输入输出高级可编程中断控制器数据),rtc(实时时钟数据)等设备状态数据。The above-mentioned virtual device status data may include clock (clock data), ioapic (input and output advanced programmable interrupt controller data), rtc (real-time clock data) and other device status data.
本说明书不对上述第一运行数据的组织形式具体限定。例如,可以通过结构体的形式对上述第一运行数据进行组织,也可以采用其他数据类型。This specification does not specifically limit the organizational form of the above-mentioned first operating data. For example, the above first operating data can be organized in the form of a structure, or other data types can be used.
对于上述云服务设备搭载的操作系统内核中的第一运行数据,可以通过上述操作系统内核获取,并写入预设的内存空间。The first operating data in the operating system kernel installed on the cloud service device can be obtained through the operating system kernel and written into the preset memory space.
对于操作系统内核如何获取上述第一运行数据或写入内存空间的实现方式,本说明书不进行具体限定。例如,可以通过操作系统内核中的虚拟机驱动直接实现,也可以通过操作系统内核中的其他程序实现。This specification does not specifically limit how the operating system kernel obtains the above-mentioned first operating data or writes it into the memory space. For example, it can be implemented directly through the virtual machine driver in the operating system kernel, or through other programs in the operating system kernel.
在本说明书示出的一个示意性的实施例中,在上述云服务设备搭载的操作系统内核中可以实现用于获取并存储所述第一运行数据的服务程序。上述云服务设备搭载的操作系统内核中可以注册回调函数。In an illustrative embodiment shown in this specification, a service program for obtaining and storing the first operating data may be implemented in the operating system kernel mounted on the cloud service device. Callback functions can be registered in the operating system kernel installed on the above-mentioned cloud service devices.
当虚拟机实例满足热迁移条件时,可以触发上述回调函数,发起针对上述服务程序的调用。云服务设备搭载的操作系统内核中可以运行上述服务程序,以获取虚拟机实例在云服务设备上的第一运行数据,并将第一运行数据写入预设的内存空间。When the virtual machine instance meets the live migration conditions, the above callback function can be triggered to initiate a call to the above service program. The above service program can be run in the operating system kernel of the cloud service device to obtain the first running data of the virtual machine instance on the cloud service device, and write the first running data into the preset memory space.
例如,以虚拟机实例为KVM虚拟机实例,以及云服务设备搭载的操作系统为Linux为例。For example, assume that the virtual machine instance is a KVM virtual machine instance and the operating system installed on the cloud service device is Linux.
KVM模块包括以模块形式集成到Linux操作系统内核中的虚拟机驱动。虚拟机驱动可以管理虚拟硬件资源,并完成虚拟机内存的分配、虚拟机寄存器的读写以及虚拟机CPU的运行等。The KVM module includes virtual machine drivers integrated into the Linux operating system kernel in the form of modules. The virtual machine driver can manage virtual hardware resources and complete the allocation of virtual machine memory, the reading and writing of virtual machine registers, and the operation of the virtual machine CPU.
在云服务设备搭载的Linux操作系统内核中可以实现用于获取并存储所述第一运行数据的服务程序kvm_save。可以创建回调函数,注册到Linux内核操作系统上,其中,该回调函数的触发条件可以设置为上述热迁移条件。The service program kvm_save for obtaining and storing the first operating data can be implemented in the Linux operating system kernel installed on the cloud service device. A callback function can be created and registered on the Linux kernel operating system, where the triggering condition of the callback function can be set to the above live migration conditions.
当虚拟机实例满足热迁移条件时,回调函数可以被触发,服务程序kvm_save获取上述云服务设备上的第一运行数据,包括虚拟CPU状态数据和虚拟设备状态数据,并保存到上述预设的内存空间。When the virtual machine instance meets the live migration conditions, the callback function can be triggered, and the service program kvm_save obtains the first running data on the above-mentioned cloud service device, including virtual CPU status data and virtual device status data, and saves it to the above-mentioned preset memory. space.
其中,本说明书不对上述服务程序获取上述第一运行数据的方式进行限定。Among them, this specification does not limit the manner in which the above-mentioned service program obtains the above-mentioned first operating data.
例如,仍以虚拟机实例为KVM虚拟机实例,以及云服务设备搭载的操作系统为Linux为例。在虚拟机实例创建时,KVM模块会为该虚拟机实例创建对应的用于存储虚拟CPU状态的struct_kvm结构体,并将该struct_kvm的地址同步到服务程序kvm_save。其中,虚拟CPU状态会以vmcs(Virtual Machine Control Structure,虚拟机控制结构)的数据结构保存到struct_kvm结构体中。满足热迁移条件时,服务程序kvm_save可以调用虚拟CPU 状态读取函数vmcs_read,从struct_kvm结构体中保存的vmcs的数据结构中获取对应的虚拟CPU状态数据。For example, assume that the virtual machine instance is a KVM virtual machine instance and the operating system installed on the cloud service device is Linux. When a virtual machine instance is created, the KVM module will create a corresponding struct_kvm structure for the virtual machine instance to store the virtual CPU state, and synchronize the address of the struct_kvm to the service program kvm_save. Among them, the virtual CPU status will be saved into the struct_kvm structure in the data structure of vmcs (Virtual Machine Control Structure, virtual machine control structure). When the live migration conditions are met, the service program kvm_save can call the virtual CPU The status reading function vmcs_read obtains the corresponding virtual CPU status data from the vmcs data structure saved in the struct_kvm structure.
在本说明书示出的一个示意性的实施例中,所述预设的内存区域,包括在创建所述虚拟机实例时,从所述虚拟机实例对应的云服务设备的内存空间中申请的预留内存空间。In an exemplary embodiment shown in this specification, the preset memory area includes a preset memory area applied from the memory space of the cloud service device corresponding to the virtual machine instance when the virtual machine instance is created. Leave memory space.
可以在创建虚拟机实例时,在该虚拟机实例对应的云服务设备的内存空间中申请的预留内存,用于在满足热迁移条件时,将上述第一运行数据写入该预留内存。When creating a virtual machine instance, you can apply for reserved memory in the memory space of the cloud service device corresponding to the virtual machine instance, and use it to write the above-mentioned first operating data into the reserved memory when the live migration conditions are met.
由于该预留内存空间处于上述云服务设备的内存,而非该虚拟机实例的内存中,因此当该虚拟机实例停止运行后,仍可以较为方便的对该预留内存空间进行读取。Since the reserved memory space is in the memory of the cloud service device rather than the memory of the virtual machine instance, the reserved memory space can still be easily read after the virtual machine instance stops running.
对于申请预留内存的具体方式,本申请不对此进行限定,例如可以通过上述虚拟机模拟器进程实现,也可以通过上述云服务设备搭载的操作系统内核来实现等。This application does not limit the specific method of applying for reserved memory. For example, it can be implemented through the above-mentioned virtual machine simulator process, or through the operating system kernel installed on the above-mentioned cloud service device.
例如,仍以虚拟机实例为KVM虚拟机实例,以及云服务设备搭载的操作系统为Linux为例。上述预留内存可以是虚拟机模拟器进程通过输入输出控制函数IOCTL,在上述服务程序kvm_save中申请内存,通过内存分配函数kzalloc分配并获得这块内存空间的物理地址。以使满足服务程序kvm_save可以在获取到第一运行数据后可以将获取到的第一运行数据写入到该预留的内存空间。For example, assume that the virtual machine instance is a KVM virtual machine instance and the operating system installed on the cloud service device is Linux. The above reserved memory can be that the virtual machine simulator process applies for memory in the above service program kvm_save through the input and output control function IOCTL, and allocates and obtains the physical address of this memory space through the memory allocation function kzalloc. This allows the service program kvm_save to write the obtained first operation data into the reserved memory space after obtaining the first operation data.
步骤304,所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据,并从所述预设的内存空间中读取所述第一运行数据;Step 304: The virtual machine simulator process obtains the second running data of the virtual machine instance on the microservice hardware, and reads the first running data from the preset memory space;
上述第一运行数据写入到上述预留的内存空间后,虚拟机模拟器进程可以获取该预留的内存空间的第一运行数据。After the first operating data is written into the reserved memory space, the virtual machine simulator process can obtain the first operating data of the reserved memory space.
除上述第一运行数据外,虚拟机实例的热迁移还需要对上述虚拟机实例在所述微服务硬件上的第二运行数据进行迁移。因此,虚拟机模拟器进程可以获取上述虚拟机实例在所述微服务硬件上的第二运行数据。In addition to the above first running data, live migration of the virtual machine instance also requires migrating the second running data of the above virtual machine instance on the microservice hardware. Therefore, the virtual machine simulator process can obtain the second running data of the virtual machine instance on the microservice hardware.
在本说明书示出的一个示意性的实施例中,所述第二运行数据包括:所述虚拟机实例在所述微服务硬件上的虚拟设备状态数据。In an illustrative embodiment shown in this specification, the second running data includes: virtual device status data of the virtual machine instance on the microservice hardware.
虚拟机实例的运行数据包括上述微服务硬件上的设备状态数据。The running data of the virtual machine instance includes the device status data on the above-mentioned microservice hardware.
其中,本说明书不对虚拟机模拟器进程获取上述微服务硬件上的设备状态数据的方式进行具体限定。Among them, this manual does not specifically limit the way in which the virtual machine simulator process obtains the device status data on the above-mentioned microservice hardware.
例如,在示出的一个示意性的实施例中,这部分设备状态数据通常可以由微服务硬件上的虚拟机模拟器进程进行保存,因此可以由上述虚拟机模拟器进程直接获得。For example, in an illustrative embodiment shown, this part of the device status data can usually be saved by the virtual machine simulator process on the microservice hardware, and therefore can be directly obtained by the above-mentioned virtual machine simulator process.
在本说明书示出的一个示意性的实施例中,所述第三运行数据包括:所述虚拟机实例写入与所述虚拟机实例对应的内存空间的数据。In an illustrative embodiment shown in this specification, the third running data includes: data written by the virtual machine instance into the memory space corresponding to the virtual machine instance.
虚拟机实例的运行数据包括该虚拟机实例的内存数据,即写入与该虚拟机实例对应的内存空间的数据。The running data of a virtual machine instance includes the memory data of the virtual machine instance, that is, the data written into the memory space corresponding to the virtual machine instance.
上述该虚拟机实例对应的内存空间是虚拟化的内存,可以由上述云服务器设备的内存虚拟化得到。 The memory space corresponding to the above-mentioned virtual machine instance is virtualized memory, which can be obtained by virtualizing the memory of the above-mentioned cloud server device.
虚拟机模拟器进程可以对虚拟机实例对应的内存空间的数据进行管理。因此虚拟机模拟器进程可以获取该虚拟机实例的内存数据。The virtual machine simulator process can manage the data in the memory space corresponding to the virtual machine instance. Therefore, the virtual machine emulator process can obtain the memory data of the virtual machine instance.
例如,虚拟机模拟器进程为QEMU进程时,可以以MemoryRegion方式对虚拟机实例对应的内存空间进行管理。其中,以MR(MemoryRegion)方式对虚拟机实例对应的内存空间进行管理时,用一个MR表示一段内存地址。其中,MR包括多类,例如RAM、MMIO、container和alias等。QUMU进程可以对上述每一个MR创建一个名为RamBlock的数据结构,所有的RamBlock以链表的形式串起来。For example, when the virtual machine emulator process is a QEMU process, the memory space corresponding to the virtual machine instance can be managed in MemoryRegion mode. Among them, when the memory space corresponding to the virtual machine instance is managed in MR (MemoryRegion) mode, an MR is used to represent a memory address. Among them, MR includes many categories, such as RAM, MMIO, container, alias, etc. The QUMU process can create a data structure named RamBlock for each of the above MRs, and all RamBlocks are strung together in the form of a linked list.
当满足热迁移条件时,QEMU进程可以读取上述RamBlock链表,以获得各类内存的客户物理地址(gpa)。其中,一些MR的客户物理地址在QEMU进程中以变量的形式进行存储,可以直接获取;一些特殊的MR之间有预留出的空白内存,可以提前用一个结构体记录下空白内存的大小,基于读取到的值和该空白内存的大小,可以换算出实际内存数据的客户物理地址。When the live migration conditions are met, the QEMU process can read the above RamBlock linked list to obtain the customer physical address (gpa) of various types of memory. Among them, the customer physical addresses of some MRs are stored in the form of variables in the QEMU process and can be obtained directly; some special MRs have blank memory reserved between them, and a structure can be used to record the size of the blank memory in advance. Based on the read value and the size of the blank memory, the customer's physical address of the actual memory data can be calculated.
通过虚拟机实例的输入输出内存管理单元IOMMU可以将各类内存的客户物理地址转化为云服务设备上内存的物理地址,根据云服务设备内存的物理地址,QEMU进程可以通过该虚拟机实例的DMA通道,获得虚拟机实例对应的内存空间的数据。Through the input and output memory management unit IOMMU of the virtual machine instance, the customer physical address of various types of memory can be converted into the physical address of the memory on the cloud service device. According to the physical address of the memory of the cloud service device, the QEMU process can pass the DMA of the virtual machine instance. Channel to obtain the data of the memory space corresponding to the virtual machine instance.
步骤306,所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。Step 306: The virtual machine simulator process sends the obtained first running data, the second running data and the third running data to the target cloud service device to migrate the virtual machine instance to The target cloud service device.
当获取到上述第一运行数据,第二运行数据和第三运行数据后,上述虚拟机模拟器进程可以将这些虚拟机实例的运行数据发送到目标云服务器设备。After obtaining the first running data, the second running data and the third running data, the virtual machine simulator process can send the running data of these virtual machine instances to the target cloud server device.
其中,本说明书不对目标云服务设备的选定进行具体限定。例如,可以随机选择一个可用的云服务设备作为目标云服务器,也可以由用户指定特定的云服务设备作为目标云服务器等。Among them, this manual does not specifically limit the selection of target cloud service equipment. For example, an available cloud service device can be randomly selected as the target cloud server, or the user can specify a specific cloud service device as the target cloud server, etc.
在本说明书示出的一个实施例中,可以获取当前处于正常状态的云服务设备;并从所述正常状态的云服务设备中,分配作为被迁移方的目标云服务设备。目标云服务设备可以是上述正常状态的云服务设备中的任意一个。In an embodiment shown in this specification, cloud service devices that are currently in a normal state can be obtained; and from the cloud service devices in a normal state, a target cloud service device as the migrated party is allocated. The target cloud service device may be any of the cloud service devices in the above normal state.
对于虚拟机模拟器进程将上述运行数据发送到目标云服务器设备的方式,本申请不进行具体限定。This application does not specifically limit the manner in which the virtual machine simulator process sends the above running data to the target cloud server device.
在本说明书的示例性实施例中,还提供了一种虚拟机实例的热迁移装置。请参见图4,图4是本说明书实施方式的一种虚拟机实例的热迁移装置的框图。In an exemplary embodiment of this specification, a device for live migration of virtual machine instances is also provided. Please refer to Figure 4. Figure 4 is a block diagram of a live migration device for a virtual machine instance according to an embodiment of this specification.
该装置应用于云服务设备,所述云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;所述装置包括:The device is applied to cloud service equipment. The cloud service equipment is equipped with microservice hardware. The virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and an operating system running on the cloud service equipment. Virtual machine driver in the kernel; the device includes:
第一获取单元410,用于响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运 行数据,并将所述第一运行数据写入预设的内存空间;The first acquisition unit 410 is configured to, in response to the virtual machine instance to be migrated satisfy the hot migration condition, the operating system kernel obtain the first operation status of the virtual machine instance in the operating system kernel installed on the cloud service device. row data, and write the first running data into the preset memory space;
第二获取单元420,用于由所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;The second acquisition unit 420 is used to acquire, from the virtual machine simulator process, the second running data of the virtual machine instance on the microservice hardware and the memory space of the virtual machine instance in the cloud service device. The third operating data, and reads the first operating data from the preset memory space;
数据发送单元440,用于由所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。The data sending unit 440 is configured to send the obtained first running data, the second running data and the third running data to the target cloud service device by the virtual machine simulator process, so as to send the obtained The virtual machine instance is migrated to the target cloud service device.
可选的,所述热迁移条件包括以下示出的任一:所述虚拟机实例的运行指标对应的数值达到预设的阈值;接收到针对所述虚拟机实例的热迁移指令。Optionally, the live migration conditions include any of the following: the value corresponding to the running indicator of the virtual machine instance reaches a preset threshold; a live migration instruction for the virtual machine instance is received.
可选的,在所述云服务设备搭载的操作系统内核中实现了用于获取并存储所述第一运行数据的服务程序;所述云服务设备搭载的操作系统内核中注册了回调函数;所述回调函数在所述虚拟机实例满足热迁移条件时自动触发,用于发起针对所述服务程序的调用;Optionally, a service program for obtaining and storing the first operating data is implemented in the operating system kernel installed on the cloud service device; a callback function is registered in the operating system kernel installed on the cloud service device; so The callback function is automatically triggered when the virtual machine instance meets the live migration conditions and is used to initiate a call to the service program;
第一获取单元410,具体用于响应所述虚拟机实例满足热迁移条件,触发所述回调函数,发起针对所述服务程序的调用,以在所述云服务设备搭载的操作系统内核中运行所述服务程序,由所述服务程序获取所述虚拟机实例在所述云服务设备上的第一运行数据,并将所述第一运行数据写入预设的内存空间。The first acquisition unit 410 is specifically configured to respond to the virtual machine instance meeting the live migration conditions, trigger the callback function, and initiate a call to the service program to run the operating system kernel installed on the cloud service device. The service program obtains the first running data of the virtual machine instance on the cloud service device, and writes the first running data into a preset memory space.
可选的,所述预设的内存区域,包括在创建所述虚拟机实例时,从所述虚拟机实例对应的云服务器设备的内存空间中申请的预留内存空间。Optionally, the preset memory area includes reserved memory space applied from the memory space of the cloud server device corresponding to the virtual machine instance when the virtual machine instance is created.
可选的,所述第一运行数据包括:所述虚拟机实例在所述云服务设备上的虚拟CPU状态数据和虚拟设备状态数据;所述第二运行数据包括:所述虚拟机实例在所述微服务硬件上的虚拟设备状态数据;所述第三运行数据包括:所述虚拟机实例写入与所述虚拟机实例对应的内存空间的数据。Optionally, the first running data includes: virtual CPU status data and virtual device status data of the virtual machine instance on the cloud service device; the second running data includes: the virtual machine instance on the cloud service device. The virtual device status data on the microservice hardware; the third operating data includes: data written by the virtual machine instance into the memory space corresponding to the virtual machine instance.
可选的,所述装置还包括:目标选择单元430,用于获取当前处于正常状态的云服务设备;从所述正常状态的云服务设备中,分配作为被迁移方的目标云服务设备。Optionally, the apparatus further includes: a target selection unit 430, configured to obtain the cloud service equipment currently in a normal state; and allocate the target cloud service equipment as the migrated party from the cloud service equipment in the normal state.
可选的,所述微服务硬件包括微服务卡。Optionally, the microservice hardware includes a microservice card.
可选的,所述虚拟机实例包括KVM虚拟机实例;所述虚拟机模拟器进程包括QEMU进程。Optionally, the virtual machine instance includes a KVM virtual machine instance; the virtual machine emulator process includes a QEMU process.
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For details on the implementation process of the functions and effects of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method, and will not be described again here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。 As for the device embodiment, since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution in this specification. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
在本说明书的示例性实施例中,还提供了一种系统实施例。请参见图5,图5是根据本说明书实施方式的一种虚拟机实例的热迁移系统的架构示意图。In the exemplary embodiment of this specification, a system embodiment is also provided. Please refer to Figure 5. Figure 5 is a schematic architectural diagram of a live migration system for virtual machine instances according to an embodiment of this specification.
所述系统包括:源云服务设备和目的云服务设备;The system includes: source cloud service equipment and destination cloud service equipment;
所述源云服务设备搭载了源微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述源云服务设备搭载的操作系统内核中的虚拟机驱动;The source cloud service device is equipped with source microservice hardware. The virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine running in the operating system kernel installed on the source cloud service device. drive;
所述源云服务设备用于:响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述源云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;所述虚拟机模拟器进程获取所述虚拟机实例在所述源微服务硬件上的第二运行数据和所述虚拟机实例在所述源云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备;The source cloud service device is configured to: in response to the virtual machine instance to be migrated meeting the hot migration condition, the operating system kernel obtains the virtual machine instance in the operating system kernel installed on the source cloud service device. a running data, and writes the first running data into a preset memory space; the virtual machine simulator process obtains the second running data of the virtual machine instance on the source microservice hardware and the virtual The third running data of the machine instance in the memory space of the source cloud service device, and reads the first running data from the preset memory space; the virtual machine simulator process will obtain all the The first operating data, the second operating data and the third operating data are sent to the target cloud service device to migrate the virtual machine instance to the target cloud service device;
所述目标云服务设备搭载了目标微服务硬件;The target cloud service device is equipped with target microservice hardware;
所述目标云服务设备用于:响应于所述待迁移的虚拟机实例满足所述热迁移条件,接受所述源云服务设备发送的所述第一运行数据,所述第二运行数据和所述第三运行数据;根据接收到的运行数据,创建虚拟机实例,所述虚拟机实例包括运行在目标微服务硬件上的虚拟机模拟器进程和运行在所述目标云服务设备搭载的操作系统内核中的虚拟机驱动,以完成虚拟机实例从源云服务设备到目标云服务设备的迁移。The target cloud service device is configured to: in response to the virtual machine instance to be migrated satisfying the live migration condition, accept the first operating data sent by the source cloud service device, the second operating data and the The third operating data; create a virtual machine instance according to the received operating data. The virtual machine instance includes a virtual machine simulator process running on the target microservice hardware and an operating system running on the target cloud service device. Virtual machine driver in the kernel to complete the migration of virtual machine instances from the source cloud service device to the target cloud service device.
在本说明书的示例性实施例中,还提供了一种装置及其所应用的终端的实施例。In the exemplary embodiments of this specification, embodiments of a device and a terminal to which it is applied are also provided.
本说明书虚拟机实例的热迁移装置的实施例可以应用在计算机设备上,例如服务器或终端设备。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图6所示,为本说明书实施方式的一种虚拟机实例的热迁移装置所在计算机设备60的一种硬件结构图,除了图6所示的处理器612、内存630、网络接口620、以及非易失性存储器540之外,实施例中装置所在的服务器或电子设备,通常根据该计算机设备的实际功能,还可以包括其他硬件,对此不再赘述。The embodiments of the live migration device for virtual machine instances in this specification can be applied to computer equipment, such as servers or terminal equipment. The device embodiments may be implemented by software, or may be implemented by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running it through its processor. From the hardware level, as shown in Figure 6, it is a hardware structure diagram of the computer device 60 where the live migration device of a virtual machine instance is located in the embodiment of this specification. In addition to the processor 612 and the memory 630 shown in Figure 6 In addition to the network interface 620 and the non-volatile memory 540, the server or electronic equipment where the device is located in the embodiment may also include other hardware according to the actual functions of the computer equipment, which will not be described again.
在本说明书的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施例中,本说明书的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本说明书各种示例性实施例的步骤。In an exemplary embodiment of this specification, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored. In some possible embodiments, various aspects of this specification can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the The terminal device performs the steps according to various exemplary embodiments of this specification described in the above-mentioned "Exemplary Method" section of this specification.
根据本说明书的实施例用于实现上述方法的程序产品,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本说明书的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或 存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The program product used to implement the above method according to the embodiment of the present specification can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of this specification is not limited thereto. In this document, the readable storage medium may be any containing or A tangible medium that stores a program for use by or in connection with an instruction execution system, apparatus, or device.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may take the form of 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium that can send, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本说明书操作的程序代码,所述程序设计语言包括面向对象的程序设计语言——诸如Java、C++等,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for performing the operations of this specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedures programming language - such as "C" or a similar programming language. 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 execute on. In situations involving remote computing devices, 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, such as provided by an Internet service. (business comes via Internet connection).
虽然本说明书包含许多具体实施细节,但是这些不应被解释为限制任何发明的范围或所要求保护的范围,而是主要用于描述特定发明的具体实施例的特征。本说明书内在多个实施例中描述的某些特征也可以在单个实施例中被组合实施。另一方面,在单个实施例中描述的各种特征也可以在多个实施例中分开实施或以任何合适的子组合来实施。此外,虽然特征可以如上所述在某些组合中起作用并且甚至最初如此要求保护,但是来自所要求保护的组合中的一个或多个特征在一些情况下可以从该组合中去除,并且所要求保护的组合可以指向子组合或子组合的变型。Although this specification contains many specific implementation details, these should not be construed to limit the scope of any invention or what is claimed, but rather serve primarily to describe features of specific embodiments of particular inventions. Certain features described in this specification as multiple embodiments can also be combined in a single embodiment. On the other hand, various features that are described in a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, while features may function in certain combinations as described above and may even be originally claimed as such, one or more features from a claimed combination may in some cases be removed from that combination, and as claimed A protected combination can point to a subcombination or a variant of a subcombination.
类似地,虽然在附图中以特定顺序描绘了操作,但是这不应被理解为要求这些操作以所示的特定顺序执行或顺次执行、或者要求所有例示的操作被执行,以实现期望的结果。在某些情况下,多任务和并行处理可能是有利的。此外,上述实施例中的各种系统单元和组件的分离不应被理解为在所有实施例中均需要这样的分离,并且应当理解,所描述的程 序组件和系统通常可以一起集成在单个软件产品中,或者封装成多个软件产品。Similarly, although operations are depicted in a specific order in the drawings, this should not be construed as requiring that the operations be performed in the specific order shown, or sequentially, or that all illustrated operations be performed to achieve desired results. result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system units and components in the above-described embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the processes described Program components and systems can often be integrated together in a single software product, or packaged into multiple software products.
由此,主题的特定实施例已被描述。其他实施例在所附权利要求书的范围以内。在某些情况下,权利要求书中记载的动作可以以不同的顺序执行并且仍实现期望的结果。此外,附图中描绘的处理并非必需所示的特定顺序或顺次顺序,以实现期望的结果。在某些实现中,多任务和并行处理可能是有利的。Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Furthermore, the processes depicted in the figures do not necessarily require the specific order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。 The above are only preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included in this specification. within the scope of protection.

Claims (12)

  1. 一种虚拟机实例的热迁移方法,应用于云服务设备,其特征在于,所述云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;所述方法包括:A method of live migration of virtual machine instances, applied to cloud service equipment, characterized in that the cloud service equipment is equipped with microservice hardware, and the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine driver running in the operating system kernel carried by the cloud service device; the method includes:
    响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;In response to the virtual machine instance to be migrated meeting the hot migration conditions, the operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel installed on the cloud service device, and transfers the first The running data is written into the preset memory space;
    所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;The virtual machine simulator process obtains the second operating data of the virtual machine instance on the microservice hardware and the third operating data of the virtual machine instance in the memory space of the cloud service device, and obtains the second operating data of the virtual machine instance on the microservice hardware and obtains the third operating data from the virtual machine instance. Read the first operating data from the preset memory space;
    所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。The virtual machine simulator process sends the obtained first operating data, the second operating data and the third operating data to the target cloud service device to migrate the virtual machine instance to the target. Cloud service equipment.
  2. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述热迁移条件包括以下示出的任一:The thermal migration conditions include any of the following:
    所述虚拟机实例的运行指标对应的数值达到预设的阈值;The value corresponding to the running indicator of the virtual machine instance reaches a preset threshold;
    接收到针对所述虚拟机实例的热迁移指令。A live migration instruction for the virtual machine instance is received.
  3. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    在所述云服务设备搭载的操作系统内核中实现了用于获取并存储所述第一运行数据的服务程序;所述云服务设备搭载的操作系统内核中注册了回调函数;所述回调函数在所述虚拟机实例满足热迁移条件时自动触发,用于发起针对所述服务程序的调用;A service program for obtaining and storing the first operating data is implemented in the operating system kernel of the cloud service device; a callback function is registered in the operating system kernel of the cloud service device; the callback function is Automatically triggered when the virtual machine instance meets the live migration conditions to initiate a call to the service program;
    所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间,包括:The operating system kernel obtains the first running data of the virtual machine instance in the operating system kernel mounted on the cloud service device, and writes the first running data into the preset memory space, including:
    响应于所述虚拟机实例满足热迁移条件,触发所述回调函数,发起针对所述服务程序的调用,以在所述云服务设备搭载的操作系统内核中运行所述服务程序,由所述服务程序获取所述虚拟机实例在所述云服务设备上的第一运行数据,并将所述第一运行数据写入预设的内存空间。In response to the virtual machine instance meeting the live migration conditions, the callback function is triggered to initiate a call to the service program to run the service program in the operating system kernel carried by the cloud service device. The program obtains the first running data of the virtual machine instance on the cloud service device, and writes the first running data into a preset memory space.
  4. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述预设的内存区域,包括在创建所述虚拟机实例时,从所述虚拟机实例对应的云服务器设备的内存空间中申请的预留内存空间。The preset memory area includes reserved memory space applied from the memory space of the cloud server device corresponding to the virtual machine instance when the virtual machine instance is created.
  5. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述第一运行数据包括:The first operating data includes:
    所述虚拟机实例在所述云服务设备上的虚拟CPU状态数据和虚拟设备状态数据;The virtual CPU status data and virtual device status data of the virtual machine instance on the cloud service device;
    所述第二运行数据包括:The second operating data includes:
    所述虚拟机实例在所述微服务硬件上的虚拟设备状态数据;The virtual device status data of the virtual machine instance on the microservice hardware;
    所述第三运行数据包括: The third operating data includes:
    所述虚拟机实例写入与所述虚拟机实例对应的内存空间的数据。The virtual machine instance writes data in the memory space corresponding to the virtual machine instance.
  6. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备之前,还包括:Before the virtual machine simulator process sends the obtained first operation data, the second operation data and the third operation data to the target cloud service device, it also includes:
    获取当前处于正常状态的云服务设备;Obtain the cloud service equipment currently in normal status;
    从所述正常状态的云服务设备中,分配作为被迁移方的目标云服务设备。A target cloud service device as the migrated party is allocated from the cloud service devices in the normal state.
  7. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述微服务硬件包括微服务卡。The microservice hardware includes microservice cards.
  8. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述虚拟机实例包括KVM虚拟机实例;The virtual machine instance includes a KVM virtual machine instance;
    所述虚拟机模拟器进程包括QEMU进程。The virtual machine emulator process includes a QEMU process.
  9. 一种虚拟机实例的热迁移装置,应用于云服务设备,其特征在于,所述云服务设备搭载了微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述云服务设备搭载的操作系统内核中的虚拟机驱动;所述装置包括:A device for hot migration of virtual machine instances, applied to cloud service equipment, characterized in that the cloud service equipment is equipped with microservice hardware, and the virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine driver running in the operating system kernel carried by the cloud service device; the device includes:
    第一获取单元,用于响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;A first acquisition unit configured to obtain, by the operating system kernel, the first operating data of the virtual machine instance in the operating system kernel installed on the cloud service device in response to the virtual machine instance to be migrated meeting the hot migration conditions. , and write the first operating data into the preset memory space;
    第二获取单元,用于由所述虚拟机模拟器进程获取所述虚拟机实例在所述微服务硬件上的第二运行数据和所述虚拟机实例在所述云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;A second acquisition unit configured to acquire, through the virtual machine simulator process, the second running data of the virtual machine instance on the microservice hardware and the memory space of the virtual machine instance in the cloud service device. third operating data, and reading the first operating data from the preset memory space;
    数据发送单元,用于由所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备。A data sending unit, configured to send the acquired first running data, the second running data and the third running data to a target cloud service device by the virtual machine simulator process, so as to send the virtual machine simulator to the target cloud service device. Migrate the machine instance to the target cloud service device.
  10. 一种系统,其特征在于,所述系统包括:源云服务设备和目标云服务设备;A system, characterized in that the system includes: a source cloud service device and a target cloud service device;
    所述源云服务设备搭载了源微服务硬件,待迁移的虚拟机实例包括运行在微服务硬件上的虚拟机模拟器进程和运行在所述源云服务设备搭载的操作系统内核中的虚拟机驱动;The source cloud service device is equipped with source microservice hardware. The virtual machine instance to be migrated includes a virtual machine simulator process running on the microservice hardware and a virtual machine running in the operating system kernel installed on the source cloud service device. drive;
    所述源云服务设备用于:响应于所述待迁移的虚拟机实例满足热迁移条件,所述操作系统内核获取所述虚拟机实例在所述源云服务设备搭载的操作系统内核中的第一运行数据,并将所述第一运行数据写入预设的内存空间;所述虚拟机模拟器进程获取所述虚拟机实例在所述源微服务硬件上的第二运行数据和所述虚拟机实例在所述源云服务设备的内存空间中的第三运行数据,并从所述预设的内存空间中读取所述第一运行数据;所述虚拟机模拟器进程将获取到的所述第一运行数据,所述第二运行数据和所述第三运行数据发送给目标云服务设备,以将所述虚拟机实例迁移到所述目标云服务设备;The source cloud service device is configured to: in response to the virtual machine instance to be migrated meeting the hot migration condition, the operating system kernel obtains the virtual machine instance in the operating system kernel installed on the source cloud service device. a running data, and writes the first running data into a preset memory space; the virtual machine simulator process obtains the second running data of the virtual machine instance on the source microservice hardware and the virtual The third running data of the machine instance in the memory space of the source cloud service device, and reads the first running data from the preset memory space; the virtual machine simulator process will obtain all the The first operating data, the second operating data and the third operating data are sent to the target cloud service device to migrate the virtual machine instance to the target cloud service device;
    所述目标云服务设备搭载了目标微服务硬件;The target cloud service device is equipped with target microservice hardware;
    所述目标云服务设备用于:响应于所述待迁移的虚拟机实例满足所述热迁移条件,接 受所述源云服务设备发送的所述第一运行数据,所述第二运行数据和所述第三运行数据;根据接收到的运行数据,创建虚拟机实例,所述虚拟机实例包括运行在目标微服务硬件上的虚拟机模拟器进程和运行在所述目标云服务设备搭载的操作系统内核中的虚拟机驱动,以完成虚拟机实例从源云服务设备到目标云服务设备的迁移。The target cloud service device is configured to: in response to the virtual machine instance to be migrated satisfying the live migration condition, Receive the first operating data, the second operating data and the third operating data sent by the source cloud service device; create a virtual machine instance according to the received operating data, the virtual machine instance includes running on The virtual machine simulator process on the target microservice hardware and the virtual machine driver running in the operating system kernel carried by the target cloud service device are used to complete the migration of the virtual machine instance from the source cloud service device to the target cloud service device.
  11. 一种存储介质,其特征在于,其上存储有计算机程序,该计算机程序执行时实现如权利要求1-8中任一项所述方法的步骤。A storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed, the steps of the method according to any one of claims 1-8 are implemented.
  12. 一种计算机设备,其特征在于,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如下方法:其中,所述处理器执行所述程序时实现如权利要求1-8中任一项所述的方法。 A computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following method when executing the program: wherein, the processing When the program is executed by a computer, the method according to any one of claims 1-8 is implemented.
PCT/CN2023/080978 2022-03-25 2023-03-13 Hot migration method for virtual machine instance WO2023179388A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2023179388A1 true WO2023179388A1 (en) 2023-09-28

Family

ID=82139046

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (3)

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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314345A1 (en) * 2010-06-18 2011-12-22 Richard Mark Stern Associating a monitoring manager with an executable service in a virtual machine migrated between physical machines
CN110874264A (en) * 2018-08-30 2020-03-10 阿里巴巴集团控股有限公司 Example hot migration 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
WO2021223744A1 (en) * 2020-05-07 2021-11-11 中科寒武纪科技股份有限公司 Method for realizing live migration, chip, board, and storage medium
CN114691300A (en) * 2022-03-25 2022-07-01 阿里巴巴(中国)有限公司 Hot migration method of virtual machine instance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314345A1 (en) * 2010-06-18 2011-12-22 Richard Mark Stern Associating a monitoring manager with an executable service in a virtual machine migrated between physical machines
CN110874264A (en) * 2018-08-30 2020-03-10 阿里巴巴集团控股有限公司 Example hot migration 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
WO2021223744A1 (en) * 2020-05-07 2021-11-11 中科寒武纪科技股份有限公司 Method for realizing live migration, chip, board, and storage medium
CN114691300A (en) * 2022-03-25 2022-07-01 阿里巴巴(中国)有限公司 Hot migration method of virtual machine instance

Also Published As

Publication number Publication date
CN114691300A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US9619308B2 (en) Executing a kernel device driver as a user space process
WO2023179388A1 (en) Hot migration method for virtual machine instance
US9459922B2 (en) Assigning a first portion of physical computing resources to a first logical partition and a second portion of the physical computing resources to a second logical portion
US8132167B2 (en) Context based virtualization
US8881144B1 (en) Systems and methods for reclaiming storage space from virtual machine disk images
US9529616B2 (en) Migrating processes between source host and destination host using a shared virtual file system
US11194735B2 (en) Technologies for flexible virtual function queue assignment
US8813071B2 (en) Storage reclamation systems and methods
JP2013515983A (en) Method and apparatus for performing I / O processing in a virtual environment
US11188365B2 (en) Memory overcommit by speculative fault
US9841985B2 (en) Storage block deallocation in virtual environments
CN111209080A (en) Transparent transmission method for graphic processor
US9699093B2 (en) Migration of virtual machine based on proximity to peripheral device in NUMA environment
US10467078B2 (en) Crash dump extraction of guest failure
US9158554B2 (en) System and method for expediting virtual I/O server (VIOS) boot time in a virtual computing environment
US20180052700A1 (en) Facilitation of guest application display from host operating system
US10831684B1 (en) Kernal driver extension system and method
US20120054773A1 (en) Processor support for secure device driver architecture
CN116339903A (en) Multipath diagnostics for kernel crash analysis via intelligent network interface controller

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: 23773636

Country of ref document: EP

Kind code of ref document: A1