CN113886019A - Virtual machine creation method, device, system, medium and equipment - Google Patents

Virtual machine creation method, device, system, medium and equipment Download PDF

Info

Publication number
CN113886019A
CN113886019A CN202111222030.3A CN202111222030A CN113886019A CN 113886019 A CN113886019 A CN 113886019A CN 202111222030 A CN202111222030 A CN 202111222030A CN 113886019 A CN113886019 A CN 113886019A
Authority
CN
China
Prior art keywords
virtual machine
virtualization component
virtual
user
kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111222030.3A
Other languages
Chinese (zh)
Other versions
CN113886019B (en
Inventor
邓良
谢永吉
厉航靖
段熊春
柴稳
张宇
王剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202111222030.3A priority Critical patent/CN113886019B/en
Publication of CN113886019A publication Critical patent/CN113886019A/en
Application granted granted Critical
Publication of CN113886019B publication Critical patent/CN113886019B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/45562Creating, deleting, cloning virtual machine instances
    • 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/45575Starting, stopping, suspending or resuming virtual machine instances
    • 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/45587Isolation or security of virtual machine instances

Landscapes

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

Abstract

The present disclosure relates to a virtual machine creation method, apparatus, system, medium, and device, the method comprising: a user mode virtualization component of a virtual machine monitor stores an image file of a target virtual machine to a virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained through memory virtualization of a remote server; the user-mode virtualization component loads the context information of the CPU register to a virtual CPU of a target virtual machine through a kernel-mode virtualization component of a virtual machine monitor, and the virtual CPU of the target virtual machine is obtained through CPU virtualization of a remote server, wherein the user-mode virtualization component operates in a local server, and the kernel-mode virtualization component operates in the remote server; and the user state virtualization component sends a virtual machine starting command to the kernel state virtualization component, and the kernel state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.

Description

Virtual machine creation method, device, system, medium and equipment
Technical Field
The present disclosure relates to the field of virtual machines, and in particular, to a method, an apparatus, a system, a medium, and a device for creating a virtual machine.
Background
As computer technology has evolved, the need for virtualization has also grown. In the related art, a Virtual Machine (VM) may be created in a physical Machine, so that operations on a plurality of complete computer systems are implemented in one physical Machine, and the security of the physical Machine system is guaranteed.
In the current virtualization technology, when a virtual machine is created in a physical machine, a virtual machine monitor can only provide virtual resources (including virtual CPU, virtual memory, and virtual IO device) for the virtual machine based on hardware resources (including CPU, memory, and IO device) of a local server. If too many virtual machines are created, the performance of the physical machine is also greatly affected.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a virtual machine creation method, where the method includes:
a user mode virtualization component of a virtual machine monitor stores an image file of a target virtual machine to a virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained through memory virtualization of a remote server;
the user-state virtualization component loads CPU register context information to a virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, wherein the user-state virtualization component runs on a local server, and the kernel-state virtualization component runs on the remote server;
and the user state virtualization component sends a virtual machine starting command to the kernel state virtualization component, and the kernel state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
In a second aspect, the present disclosure provides a virtual machine creation apparatus, the apparatus comprising:
the storage module is used for storing an image file of a target virtual machine to a virtual memory of the target virtual machine by a user mode virtualization component of a virtual machine monitor, wherein the virtual memory of the target virtual machine is obtained by memory virtualization of a remote server;
a loading module, configured to load, by the user-mode virtualization component, CPU register context information to a virtual CPU of the target virtual machine through a kernel-mode virtualization component of the virtual machine monitor, where the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, where the user-mode virtualization component operates in a local server, and the kernel-mode virtualization component operates in the remote server;
a first sending module, configured to send, by the user-state virtualization component, a virtual machine start command to the kernel-state virtualization component, so that the kernel-state virtualization component executes the image file in the virtual memory based on the virtual CPU and starts the target virtual machine.
In a third aspect, the present disclosure provides a virtual machine creation system, including:
a local server, on which a user-mode virtualization component runs, for executing the virtual machine creation method of the first aspect;
the remote server is communicated with the local server, a kernel-state virtualization component runs on the remote server, and the kernel-state virtualization component is used for allocating a virtual memory and a virtual CPU (central processing unit) for a virtual machine, so that the virtual memory executes the image file of the virtual machine based on the virtual CPU, and the virtual machine is started.
In a fourth aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the first aspect.
In a fifth aspect, the present disclosure provides an electronic device comprising:
a storage device having one or more computer programs stored thereon;
one or more processing devices for executing the one or more computer programs in the storage device to implement the steps of the method of the first aspect.
In the above technical solution, the image file of the target virtual machine is stored in the virtual memory of the target virtual machine by the user-mode virtualization component, and the CPU register context information is loaded to the virtual CPU of the target virtual machine by the kernel-mode virtualization component of the virtual machine monitor, so that when the virtual machine is started, the user-mode virtualization component sends a virtual machine start command to the kernel-mode virtualization component, and the kernel-mode virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine. Therefore, according to the technical scheme, the user mode virtualization component and the kernel mode virtualization component of the virtual machine monitor are separately deployed across servers, so that the user mode virtualization component runs on the local server, and the kernel mode virtualization component runs on the remote server, and therefore when the virtual machine is created, resources can be provided for the virtual machine by using the remote server, namely the virtual CPU and the virtual memory are provided for the virtual machine by using the remote server, and therefore occupation of the CPU performance and the memory of the local server and requirements of the virtual machine on the hardware performance are effectively reduced, the running stability and reliability of the virtual machine are improved to a certain extent, the flexibility of a virtual machine creating method is improved, and the use experience of a user is improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow chart of a virtual machine creation method provided in accordance with one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a virtual machine creation system provided in accordance with one embodiment of the present disclosure;
FIG. 3 is a block diagram of a virtual machine creation apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 4 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart illustrating a virtual machine creation method according to an embodiment of the present disclosure, where as shown in fig. 1, the method may include:
in step 11, the user-mode virtualization component of the virtual machine monitor stores the image file of the target virtual machine to the virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained by virtualizing the memory of the remote server, so that the target virtual machine can utilize the memory of the remote server, thereby reducing the occupation of the memory of the local server. The user-state virtualization component may be a user-state QEMU (Quick EMUlator) component, which may perform virtualization of hardware.
In step 12, the user-mode virtualization component loads the CPU register context information to the virtual CPU of the target virtual machine through the kernel-mode virtualization component of the virtual machine monitor, where the virtual CPU of the target virtual machine is obtained by the CPU virtualization of the remote server, where the user-mode virtualization component runs on the local server, and the kernel-mode virtualization component runs on the remote server.
Thus, the target virtual machine can utilize the CPU of the remote server, thereby reducing occupation of the local server CPU performance. The Kernel-based virtualization component may be a KVM (Kernel-based Virtual Machine) component. In this embodiment, the user-mode virtualization component and the kernel-mode virtualization component of the virtual machine monitor are separately deployed across servers, so that the user-mode virtualization component runs on a local server and the kernel-mode virtualization component runs on a remote server, thereby realizing high-performance allocation of virtual machine resources.
In step 13, the user-mode virtualization component sends a virtual machine start command to the kernel-mode virtualization component, and the kernel-mode virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
In this embodiment, since the image file of the target virtual machine is in the memory of the remote server, when the target virtual machine is started, the user-state virtualization component needs to send a virtual machine start command to the kernel-state virtualization component, so as to execute the image file in the remote server, and realize the start of the target virtual machine.
In the above technical solution, the image file of the target virtual machine is stored in the virtual memory of the target virtual machine by the user-mode virtualization component, and the CPU register context information is loaded to the virtual CPU of the target virtual machine by the kernel-mode virtualization component of the virtual machine monitor, so that when the virtual machine is started, the user-mode virtualization component sends a virtual machine start command to the kernel-mode virtualization component, and the kernel-mode virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine. Therefore, according to the technical scheme, the user mode virtualization component and the kernel mode virtualization component of the virtual machine monitor are separately deployed across servers, so that the user mode virtualization component runs on the local server, and the kernel mode virtualization component runs on the remote server, and therefore when the virtual machine is created, resources can be provided for the virtual machine by using the remote server, namely the virtual CPU and the virtual memory are provided for the virtual machine by using the remote server, and therefore occupation of the CPU performance and the memory of the local server and requirements of the virtual machine on the hardware performance are effectively reduced, the running stability and reliability of the virtual machine are improved to a certain extent, the flexibility of a virtual machine creating method is improved, and the use experience of a user is improved.
In one possible embodiment, before the step of the user-state virtualization component of the virtual machine monitor storing the image file of the target virtual machine to the virtual memory of the target virtual machine, the method may further include:
the user mode virtualization component sends virtual memory configuration information of a target virtual machine to the kernel mode virtualization component so that the kernel mode virtualization component virtualizes the memory of the remote server, and allocates the virtual memory to the target virtual machine based on the virtual memory configuration information;
the user state virtualization component sends virtual CPU configuration information of a target virtual machine to the kernel state virtualization component so that the kernel state virtualization component virtualizes a CPU of the remote server, and allocates the virtual CPU to the target virtual machine based on the virtual CPU configuration information.
The virtual memory configuration information may include the size of the virtual memory, memory mode information, and the like, and the virtual CPU configuration information may include information such as the number of processors and the number of cores of each processor. In the remote server, the kernel-state virtualization component may perform virtualization processing on the memory and the CPU of the remote server, so as to allocate the memory and the CPU in the remote server for the target virtual machine based on the virtual memory configuration information and the virtual CPU configuration information. The virtualization processing for the memory and the CPU may be implemented by an existing virtualization technology, for example, based on a virtualization technology provided in a KVM, which is not limited in this disclosure.
Therefore, according to the technical scheme, the memory and the CPU of the remote server can be virtualized through the kernel-state virtualization component running in the remote server, so that the target virtual machine can utilize the memory and the CPU in the remote server through communicating with the user-state virtualization component in the local server, the influence of virtual machine creation on the performance of the local server is effectively reduced, and meanwhile, the resource utilization efficiency of the remote server can be improved.
In the related art, the QEMU and the KVM run on the same server, so that the two can communicate through local system calls. While in the present disclosure the user-state virtualization component and the kernel-state virtualization component run on different servers, the present disclosure also provides the following embodiments to enable cross-server communication between the two.
In one possible embodiment, the user-state virtualization component and the kernel-state virtualization component communicate via a remote system call implemented by:
if the user state virtualization component executes system call to the kernel state virtualization component, a user thread of the user state virtualization component packages a call function and parameter information corresponding to the system call to obtain a remote call request;
and sending the remote call request to a proxy thread of a remote server, so that the proxy thread sends the remote call request to the kernel-state virtualization component, wherein the user threads in the local server correspond to the proxy kernel threads in the remote server one to one.
Illustratively, as shown in fig. 2, data transmission is performed between the local server and the remote server through a high-speed dma (Direct Memory access)/rdma (remote Direct Memory access) channel. When the user thread of the user-mode virtualization component executes the system call to the kernel-mode virtualization component, the call function and the parameter information of the system call can be obtained, so that the system call is packaged to obtain a remote call request, and the remote call request containing the call function and the parameter information is transmitted to a remote server through a DMA/RDMA channel to be received by a corresponding proxy thread in the remote server.
In this embodiment, each thread of the user-state virtualization component on the local server correspondingly starts a proxy thread on the remote server, so that the functions performed by the user-state virtualization component in the local server can be executed in the remote server through the proxy thread. Then, the proxy thread may further send the remote call request to the kernel-mode virtualization component, so that the kernel-mode virtualization component obtains corresponding call function and parameter information, thereby implementing communication between the user-mode virtualization component and the kernel-mode virtualization component, and completing the remote system call.
Therefore, by the technical scheme, the user state virtualization component in the local server can communicate with the kernel state virtualization component in the remote server, so that the user state virtualization component can call the remote system of the kernel state virtualization component, the running stability and safety of the target virtual machine are ensured, and the user state virtualization component and the kernel state virtualization component can communicate safely under the condition of cross-server deployment.
In the related virtualization technology, when a virtual machine is created, a block of memory can be allocated locally for the virtual machine, so as to virtualize the memory required by the virtual machine for the virtual machine. The Virtual machine operating system itself has a Virtual address space, denoted gva (guest Virtual address). The virtual machine considers itself to monopolize the whole memory space, and is represented by GPA (guest Physical address). The host operating system has a Virtual machine address space, which is represented by HVA (host Virtual address). The host itself has Physical memory space, denoted by hpa (host Physical address).
Wherein, the GVA to GPA conversion is realized by page table mapping of the virtual machine operating system. The translation of the HVA to HPA is accomplished by page table mapping of the host operating system. For example, when the virtual machine operating system creates a page table mapping from GVA to GPA, the KVM may obtain HPA corresponding to GVA and record the mapping relationship between GVA and HPA. When GVA-to-GPA mapping is needed subsequently, HPA can be queried directly according to the mapping relation. As another example, address translation for GVA- > GPA- > HPA may be implemented in hardware by way of EPT (enhanced Page Table).
In the related technology, the QEMU allocates an HVA space in the host virtual address space, the HVA space corresponds to the GPA space of the virtual machine, the physical address considered by the virtual machine is also a logical address, i.e. the HVA space corresponding to the QEMU and the GPA space of the virtual machine are mapped to the same physical space, and the QEMU can read and write the GPA space of the virtual machine by reading and writing the HVA space.
However, in the present disclosure, since the user-state virtualization component and the kernel-state virtualization component run on different servers, the present disclosure further provides the following embodiments to ensure data synchronization and consistency.
In one possible embodiment, the first virtual address space corresponding to the user-state virtualization component and the second virtual address space corresponding to the agent thread are synchronized through a DMA/RDMA channel, for example, when the user-state virtualization component performs a data operation in the first virtual address space, the user-state virtualization component may simultaneously send the data operation to the agent thread through the DMA/RDMA channel, so as to perform data synchronization in the second virtual address space by the agent thread based on the data operation.
Accordingly, an exemplary implementation manner of the user-state virtualization component of the virtual machine monitor storing the image file of the target virtual machine to the virtual memory of the target virtual machine is as follows, and the step may include:
in response to the user-state virtualization component storing the image file to the first virtual address space, sending the image file to the proxy thread over a DMA/RDMA channel to cause the proxy thread to write the image file to the second virtual address space, wherein the second virtual address space and a guest physical address space of the target virtual machine map to a physical address space corresponding to the virtual memory in the remote server.
In this embodiment, the user-state virtualization component may obtain the image file of the target virtual machine from the file system of the local server, so as to write the image file into the first virtual address space, i.e., the HVA space, corresponding to the user-state virtualization component. Accordingly, the image file may be further sent to the proxy thread via a DMA/RDMA channel due to address space synchronization.
As can be seen from the foregoing, the proxy thread performs the same function in the remote server as the user-state virtualization component in the local server, so that the proxy thread can write the image file to the second virtual address space. Similarly, the second virtual address space and the client physical address space of the target virtual machine are mapped to a physical address space corresponding to the virtual memory in the remote server, that is, the physical address space is a memory allocated to the target virtual machine in the remote server, so that when the proxy thread writes the image file into the second virtual address space in the remote server, the image file is written into the client physical address space of the target virtual machine, and the image file is mapped from the physical memory of the local server to the physical memory of the remote server, so that the image file is stored in the target virtual machine, and the target virtual machine is further started.
Therefore, according to the technical scheme, address space synchronization of the first virtual address space corresponding to the user-state virtualization component and the second virtual address space corresponding to the agent thread is achieved through the DMA/RDMA channel, so that when the user-state virtualization component writes data in the corresponding address space, the write operation can be synchronized into the virtual memory corresponding to the target virtual machine in the remote server, stable operation of the target virtual machine is guaranteed, consistency of data operation in the local server and virtual memory operation in the remote server is achieved, and usability and effectiveness of the created virtual machine are guaranteed.
In one possible embodiment, an exemplary implementation manner of the user-state virtualization component loading, by the kernel-state virtualization component of the virtual machine monitor, the CPU register context information to the virtual CPU of the target virtual machine is as follows, and the step may include:
the user state virtualization component initializes the CPU register context information of the target virtual machine;
and the user state virtualization component sends the CPU register context information to the kernel state virtualization component so that the kernel state virtualization component loads the CPU register context information to the virtual CPU.
In the related art, when the target virtualization is initialized, various registers may be set to help the KVM to find an entry (main function) of an instruction that needs to be loaded, so that after the thread calls the KVM interface, the control right of the physical CPU is given to the target virtual machine.
Therefore, in the embodiment of the present disclosure, the CPU register context information during initialization of the target virtual machine may be sent to the remote kernel-state virtualization component, and the kernel-state virtualization component loads the CPU register context information in the virtual CPU. Thus, when the target virtual machine executes a special instruction later, the CPU saves the context of the target virtual machine to the register, and then the execution right is switched to the virtual machine monitor. The virtual machine monitor acquires a target virtual machine to process the instruction.
Therefore, by the technical scheme, the kernel-mode virtualization component can load the CPU register context information in the virtual CPU, so that the setting of configuration required by virtual machine starting in a remote server is ensured, and the stability and the usability of virtual machine creation are ensured.
In a possible embodiment, after starting the target virtual machine, the method may further include:
the user state virtualization component receives an IO request sent by the kernel state virtualization component, and sends the IO request to an equipment simulation module of the user state virtualization component, so that the equipment simulation module responds to the IO request to perform control plane operation;
the IO request is sent to the kernel-state virtualization component by the target virtual machine through a control surface interface of the virtual device for forwarding, and the device simulation module is configured to perform device simulation to obtain the virtual device.
Illustratively, a user-mode virtualization component in the local server may virtualize a local device, such as the virtualization process of an I/O device, from the perspective of the processor, the external device being accessed through a set of I/O resources, such as: external memory devices, network devices, display devices, and input devices, among others. The virtual device can be virtualized through the logic of the device virtual module in the QEMU, such as obtaining VirtIO device.
As an example, when the target virtual machine is created, virtualization processing of the IO device may be performed by the user-state virtualization component, so as to obtain each virtual device. When the target virtual machine needs to utilize the virtual device in the running process, the running virtual machine image can perform application of the virtual device through an IO request.
In this embodiment, the virtual VirtIO device may include two parts, a control plane and a data plane, and the control plane and the data plane of the virtual VirtIO device may be decoupled based on the VDPA framework. Correspondingly, the running target virtual machine, that is, the application program in the target virtual machine sends the IO request to the kernel-mode virtualization component through the control surface interface of the virtual device, and then the kernel-mode virtualization component sends the IO request to the user-mode virtualization component and further sends the IO request to the device simulation module therein, so that the device simulation module responds to the IO request.
Therefore, in the technical scheme, the data plane and the control plane of the virtual device are decoupled, so that when an application program in the running virtual machine issues an IO request to the control plane interface of the virtual device, the IO request can be processed by the kernel-state virtualization component based on the device simulation module of the remote system call and sent to the user-state virtualization component, the call of the target virtual machine in the remote server to the virtual device in the local server is realized, the application scene of the target virtual machine is fitted, and the user use experience is improved.
In a possible embodiment, after starting the target virtual machine, the method may further include:
the local server responds to the received IO request, accesses IO equipment corresponding to the IO request, and sends IO data to a data plane so as to send the IO data to the target virtual machine, wherein the IO request is sent to the local server by the target virtual machine through a data plane interface of the virtual equipment.
As described above, in the technical solution of the present disclosure, the data plane and the control plane of the virtual device are decoupled, and then, for an IO request sent by the target virtual machine to the local server through the data plane interface of the virtual device, the local server may directly access the IO device corresponding to the IO request to obtain IO data, the IO data may be directly transmitted based on the high-speed DMA/RDMA channel between the remote server and the local server without passing through forwarding communication between the kernel-state virtualization component and the user-state virtualization component, so as to improve the processing efficiency of the IO data, simplify the response flow of the IO request issued through the data plane interface, further improve the application performance of the created target virtual machine, and improve the user experience.
The present disclosure also provides a virtual machine creating apparatus, as shown in fig. 3, the apparatus 10 includes:
the storage module 100 is configured to store, by a user-mode virtualization component of a virtual machine monitor, an image file of a target virtual machine to a virtual memory of the target virtual machine, where the virtual memory of the target virtual machine is obtained by virtualizing a memory of a remote server;
a loading module 200, configured to load, by the user-mode virtualization component, CPU register context information to a virtual CPU of the target virtual machine through a kernel-mode virtualization component of the virtual machine monitor, where the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, where the user-mode virtualization component runs on a local server, and the kernel-mode virtualization component runs on the remote server;
a first sending module 300, configured to send a virtual machine start command to the kernel-state virtualization component by the user-state virtualization component, so that the kernel-state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
Optionally, the user-state virtualization component and the kernel-state virtualization component communicate through a remote system call, where the remote system call is implemented by:
if the user state virtualization component executes system call to the kernel state virtualization component, a user thread of the user state virtualization component packages a call function and parameter information corresponding to the system call to obtain a remote call request;
and sending the remote call request to a proxy thread of a remote server, so that the proxy thread sends the remote call request to the kernel-state virtualization component, wherein the user threads in the local server correspond to the proxy kernel threads in the remote server one to one.
Optionally, a first virtual address space corresponding to the user-state virtualization component and a second virtual address space corresponding to the agent thread are synchronized through a DMA/RDMA channel;
the memory module includes:
and the first sending submodule is used for responding to the user-state virtualization component to store the image file into the first virtual address space, sending the image file to the proxy thread through a DMA/RDMA channel, and enabling the proxy thread to write the image file into the second virtual address space, wherein the second virtual address space and the client physical address space of the target virtual machine are mapped to the physical address space corresponding to the virtual memory in the remote server.
Optionally, the loading module comprises:
the determining submodule is used for initializing the CPU register context information of the target virtual machine by the user-state virtualization component;
and the second sending submodule is used for sending the CPU register context information to the kernel-mode virtualization component by the user-mode virtualization component so as to load the CPU register context information on the virtual CPU by the kernel-mode virtualization component.
Optionally, the apparatus further comprises:
a second sending module, configured to send, by a user-state virtualization component of the virtual machine monitor in the first sending module, virtual memory configuration information of a target virtual machine to the kernel-state virtualization component before the user-state virtualization component stores an image file of the target virtual machine in a virtual memory of the target virtual machine, so that the kernel-state virtualization component virtualizes a memory of the remote server, and allocates the virtual memory to the target virtual machine based on the virtual memory configuration information;
a third sending module, configured to send, by a user-state virtualization component of the virtual machine monitor in the first sending module, virtual CPU configuration information of a target virtual machine to the kernel-state virtualization component before the user-state virtualization component stores an image file of the target virtual machine in a virtual memory of the target virtual machine, so that the kernel-state virtualization component virtualizes a CPU of the remote server, and allocates the virtual CPU to the target virtual machine based on the virtual CPU configuration information.
Optionally, the apparatus further comprises:
after the target virtual machine is started, the user-state virtualization component receives an IO request sent by the kernel-state virtualization component, and sends the IO request to an equipment simulation module of the user-state virtualization component, so that the equipment simulation module performs control plane operation in response to the IO request;
the IO request is sent to the kernel-state virtualization component by the target virtual machine through a control surface interface of the virtual device for forwarding, and the device simulation module is configured to perform device simulation to obtain the virtual device.
Optionally, the apparatus further comprises:
and the fifth sending module is used for responding to the received IO request by the local server after the target virtual machine is started, accessing the IO equipment corresponding to the IO request, and sending IO data to a data plane so as to send the IO data to the target virtual machine, wherein the IO request is sent to the local server by the target virtual machine through a data plane interface of the virtual equipment.
The present disclosure also provides a virtual machine creation system, the system including:
the local server runs a user mode virtualization component and is used for executing any virtual machine creation method;
the remote server is communicated with the local server, a kernel-state virtualization component runs on the remote server, and the kernel-state virtualization component is used for allocating a virtual memory and a virtual CPU (central processing unit) for a virtual machine, so that the virtual memory executes the image file of the virtual machine based on the virtual CPU, and the virtual machine is started.
Referring now to FIG. 4, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: a user mode virtualization component of a virtual machine monitor stores an image file of a target virtual machine to a virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained through memory virtualization of a remote server; the user-state virtualization component loads CPU register context information to a virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, wherein the user-state virtualization component runs on a local server, and the kernel-state virtualization component runs on the remote server; and the user state virtualization component sends a virtual machine starting command to the kernel state virtualization component, and the kernel state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of a module does not in some cases form a limitation on the module itself, for example, the storage module may also be described as a "module in which the user-state virtualization component of the virtual machine monitor stores the image file of the target virtual machine to the virtual memory of the target virtual machine".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a virtual machine creation method according to one or more embodiments of the present disclosure, wherein the method includes:
a user mode virtualization component of a virtual machine monitor stores an image file of a target virtual machine to a virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained through memory virtualization of a remote server;
the user-state virtualization component loads CPU register context information to a virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, wherein the user-state virtualization component runs on a local server, and the kernel-state virtualization component runs on the remote server;
and the user state virtualization component sends a virtual machine starting command to the kernel state virtualization component, and the kernel state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
Example 2 provides the method of example 1, wherein the user-state virtualization component and the kernel-state virtualization component communicate via a remote system call implemented by:
if the user state virtualization component executes system call to the kernel state virtualization component, a user thread of the user state virtualization component packages a call function and parameter information corresponding to the system call to obtain a remote call request;
and sending the remote call request to a proxy thread of a remote server, so that the proxy thread sends the remote call request to the kernel-state virtualization component, wherein the user threads in the local server correspond to the proxy kernel threads in the remote server one to one.
Example 3 provides the method of example 2, wherein the first virtual address space corresponding to the user-state virtualization component and the second virtual address space corresponding to the proxy thread are synchronized via a DMA/RDMA channel;
the method for storing the image file of the target virtual machine to the virtual memory of the target virtual machine by the user mode virtualization component of the virtual machine monitor comprises the following steps:
in response to the user-state virtualization component storing the image file to the first virtual address space, sending the image file to the proxy thread over a DMA/RDMA channel to cause the proxy thread to write the image file to the second virtual address space, wherein the second virtual address space and a guest physical address space of the target virtual machine map to a physical address space corresponding to the virtual memory in the remote server.
Example 4 provides the method of example 2, wherein the user-state virtualization component loads CPU register context information to the virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, comprising:
the user state virtualization component initializes the CPU register context information of the target virtual machine;
and the user state virtualization component sends the CPU register context information to the kernel state virtualization component so that the kernel state virtualization component loads the CPU register context information to the virtual CPU.
Example 5 provides the method of example 1, wherein, prior to the step of the user-state virtualization component of the virtual machine monitor storing the image file of the target virtual machine to the virtual memory of the target virtual machine, the method further comprises:
the user mode virtualization component sends virtual memory configuration information of a target virtual machine to the kernel mode virtualization component so that the kernel mode virtualization component virtualizes the memory of the remote server, and allocates the virtual memory to the target virtual machine based on the virtual memory configuration information;
the user state virtualization component sends virtual CPU configuration information of a target virtual machine to the kernel state virtualization component so that the kernel state virtualization component virtualizes a CPU of the remote server, and allocates the virtual CPU to the target virtual machine based on the virtual CPU configuration information.
Example 6 provides the method of example 1, wherein after starting the target virtual machine, the method further comprises:
the user state virtualization component receives an IO request sent by the kernel state virtualization component, and sends the IO request to an equipment simulation module of the user state virtualization component, so that the equipment simulation module responds to the IO request to perform control plane operation;
the IO request is sent to the kernel-state virtualization component by the target virtual machine through a control surface interface of the virtual device for forwarding, and the device simulation module is configured to perform device simulation to obtain the virtual device.
Example 7 provides the method of example 1, wherein after starting the target virtual machine, the method further comprises:
the local server responds to the received IO request, accesses IO equipment corresponding to the IO request, and sends IO data to a data plane so as to send the IO data to the target virtual machine, wherein the IO request is sent to the local server by the target virtual machine through a data plane interface of the virtual equipment.
Example 8 provides, in accordance with one or more embodiments of the present disclosure, a virtual machine creation apparatus, wherein the apparatus comprises:
the storage module is used for storing an image file of a target virtual machine to a virtual memory of the target virtual machine by a user mode virtualization component of a virtual machine monitor, wherein the virtual memory of the target virtual machine is obtained by memory virtualization of a remote server;
a loading module, configured to load, by the user-mode virtualization component, CPU register context information to a virtual CPU of the target virtual machine through a kernel-mode virtualization component of the virtual machine monitor, where the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, where the user-mode virtualization component operates in a local server, and the kernel-mode virtualization component operates in the remote server;
a first sending module, configured to send, by the user-state virtualization component, a virtual machine start command to the kernel-state virtualization component, so that the kernel-state virtualization component executes the image file in the virtual memory based on the virtual CPU and starts the target virtual machine.
Example 9 provides, in accordance with one or more embodiments of the present disclosure, a virtual machine creation system, wherein the system comprises:
a local server having a user-state virtualization component running thereon for executing the virtual machine creation method of any one of examples 1-7;
the remote server is communicated with the local server, a kernel-state virtualization component runs on the remote server, and the kernel-state virtualization component is used for allocating a virtual memory and a virtual CPU (central processing unit) for a virtual machine, so that the virtual memory executes the image file of the virtual machine based on the virtual CPU, and the virtual machine is started.
Example 10 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, performs the steps of the method of any of examples 1-7, in accordance with one or more embodiments of the present disclosure.
Example 11 provides, in accordance with one or more embodiments of the present disclosure, an electronic device, comprising:
a storage device having one or more computer programs stored thereon;
one or more processing devices for executing the one or more computer programs in the storage device to implement the steps of the method of any of examples 1-7.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (11)

1. A virtual machine creation method, the method comprising:
a user mode virtualization component of a virtual machine monitor stores an image file of a target virtual machine to a virtual memory of the target virtual machine, wherein the virtual memory of the target virtual machine is obtained through memory virtualization of a remote server;
the user-state virtualization component loads CPU register context information to a virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, wherein the user-state virtualization component runs on a local server, and the kernel-state virtualization component runs on the remote server;
and the user state virtualization component sends a virtual machine starting command to the kernel state virtualization component, and the kernel state virtualization component executes the image file in the virtual memory based on the virtual CPU to start the target virtual machine.
2. The method of claim 1, wherein the user-state virtualization component and the kernel-state virtualization component communicate via a remote system call implemented by:
if the user state virtualization component executes system call to the kernel state virtualization component, a user thread of the user state virtualization component packages a call function and parameter information corresponding to the system call to obtain a remote call request;
and sending the remote call request to a proxy thread of a remote server, so that the proxy thread sends the remote call request to the kernel-state virtualization component, wherein the user threads in the local server correspond to the proxy kernel threads in the remote server one to one.
3. The method of claim 2, wherein a first virtual address space corresponding to the user-state virtualization component and a second virtual address space corresponding to the proxy thread are synchronized via a DMA/RDMA channel;
the method for storing the image file of the target virtual machine to the virtual memory of the target virtual machine by the user mode virtualization component of the virtual machine monitor comprises the following steps:
in response to the user-state virtualization component storing the image file to the first virtual address space, sending the image file to the proxy thread over a DMA/RDMA channel to cause the proxy thread to write the image file to the second virtual address space, wherein the second virtual address space and a guest physical address space of the target virtual machine map to a physical address space corresponding to the virtual memory in the remote server.
4. The method of claim 2, wherein the user-state virtualization component loads CPU register context information to a virtual CPU of the target virtual machine through a kernel-state virtualization component of the virtual machine monitor, comprising:
the user state virtualization component initializes the CPU register context information of the target virtual machine;
and the user state virtualization component sends the CPU register context information to the kernel state virtualization component so that the kernel state virtualization component loads the CPU register context information to the virtual CPU.
5. The method of claim 1, wherein prior to the step of the user-state virtualization component of the virtual machine monitor storing the image file of the target virtual machine to the virtual memory of the target virtual machine, the method further comprises:
the user mode virtualization component sends virtual memory configuration information of a target virtual machine to the kernel mode virtualization component so that the kernel mode virtualization component virtualizes the memory of the remote server, and allocates the virtual memory to the target virtual machine based on the virtual memory configuration information;
the user state virtualization component sends virtual CPU configuration information of a target virtual machine to the kernel state virtualization component so that the kernel state virtualization component virtualizes a CPU of the remote server, and allocates the virtual CPU to the target virtual machine based on the virtual CPU configuration information.
6. The method of claim 1, wherein after starting the target virtual machine, the method further comprises:
the user state virtualization component receives an IO request sent by the kernel state virtualization component, and sends the IO request to an equipment simulation module of the user state virtualization component, so that the equipment simulation module responds to the IO request to perform control plane operation;
the IO request is sent to the kernel-state virtualization component by the target virtual machine through a control surface interface of the virtual device for forwarding, and the device simulation module is configured to perform device simulation to obtain the virtual device.
7. The method of claim 1, wherein after starting the target virtual machine, the method further comprises:
the local server responds to the received IO request, accesses IO equipment corresponding to the IO request, and sends IO data to a data plane so as to send the IO data to the target virtual machine, wherein the IO request is sent to the local server by the target virtual machine through a data plane interface of the virtual equipment.
8. An apparatus for creating a virtual machine, the apparatus comprising:
the storage module is used for storing an image file of a target virtual machine to a virtual memory of the target virtual machine by a user mode virtualization component of a virtual machine monitor, wherein the virtual memory of the target virtual machine is obtained by memory virtualization of a remote server;
a loading module, configured to load, by the user-mode virtualization component, CPU register context information to a virtual CPU of the target virtual machine through a kernel-mode virtualization component of the virtual machine monitor, where the virtual CPU of the target virtual machine is obtained through CPU virtualization of the remote server, where the user-mode virtualization component operates in a local server, and the kernel-mode virtualization component operates in the remote server;
a first sending module, configured to send, by the user-state virtualization component, a virtual machine start command to the kernel-state virtualization component, so that the kernel-state virtualization component executes the image file in the virtual memory based on the virtual CPU and starts the target virtual machine.
9. A virtual machine creation system, the system comprising:
a local server having a user-state virtualization component running thereon for executing the virtual machine creation method of any one of claims 1-7;
the remote server is communicated with the local server, a kernel-state virtualization component runs on the remote server, and the kernel-state virtualization component is used for allocating a virtual memory and a virtual CPU (central processing unit) for a virtual machine, so that the virtual memory executes the image file of the virtual machine based on the virtual CPU, and the virtual machine is started.
10. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1 to 7.
11. An electronic device, comprising:
a storage device having one or more computer programs stored thereon;
one or more processing devices for executing the one or more computer programs in the storage device to implement the steps of the method of any one of claims 1-7.
CN202111222030.3A 2021-10-20 2021-10-20 Virtual machine creation method, device, system, medium and equipment Active CN113886019B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111222030.3A CN113886019B (en) 2021-10-20 2021-10-20 Virtual machine creation method, device, system, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111222030.3A CN113886019B (en) 2021-10-20 2021-10-20 Virtual machine creation method, device, system, medium and equipment

Publications (2)

Publication Number Publication Date
CN113886019A true CN113886019A (en) 2022-01-04
CN113886019B CN113886019B (en) 2024-04-30

Family

ID=79003745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111222030.3A Active CN113886019B (en) 2021-10-20 2021-10-20 Virtual machine creation method, device, system, medium and equipment

Country Status (1)

Country Link
CN (1) CN113886019B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625487A (en) * 2022-05-16 2022-06-14 浙江毫微米科技有限公司 Method, system, device and storage medium for running application program in meta universe
CN116991544A (en) * 2023-09-26 2023-11-03 苏州元脑智能科技有限公司 Simulation method and device of CXL (control information and automation) equipment, electronic equipment and client

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282540A1 (en) * 2013-03-13 2014-09-18 Arnaud Bonnet Performant host selection for virtualization centers
CN104503863A (en) * 2014-11-07 2015-04-08 清华大学 Kernel mode and user mode data exchange method used for virtual container system disaster recovery
US20170075711A1 (en) * 2015-09-16 2017-03-16 Red Hat, Inc. Identifying application usage roles for devices provided to virtual machines
US20200183795A1 (en) * 2018-12-07 2020-06-11 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for processing information
CN113162836A (en) * 2021-04-25 2021-07-23 北京字节跳动网络技术有限公司 Virtual local area network communication method and device, cloud server, medium and electronic equipment
CN113296890A (en) * 2021-05-21 2021-08-24 南京大学 Android virtualization method and system based on system call agent
CN113296884A (en) * 2021-02-26 2021-08-24 阿里巴巴集团控股有限公司 Virtualization method, virtualization device, electronic equipment, virtualization medium and resource virtualization system
CN113391879A (en) * 2021-06-16 2021-09-14 锐捷网络(苏州)有限公司 Virtual system switching method and host machine

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282540A1 (en) * 2013-03-13 2014-09-18 Arnaud Bonnet Performant host selection for virtualization centers
CN104503863A (en) * 2014-11-07 2015-04-08 清华大学 Kernel mode and user mode data exchange method used for virtual container system disaster recovery
US20170075711A1 (en) * 2015-09-16 2017-03-16 Red Hat, Inc. Identifying application usage roles for devices provided to virtual machines
US20200183795A1 (en) * 2018-12-07 2020-06-11 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for processing information
CN113296884A (en) * 2021-02-26 2021-08-24 阿里巴巴集团控股有限公司 Virtualization method, virtualization device, electronic equipment, virtualization medium and resource virtualization system
CN113162836A (en) * 2021-04-25 2021-07-23 北京字节跳动网络技术有限公司 Virtual local area network communication method and device, cloud server, medium and electronic equipment
CN113296890A (en) * 2021-05-21 2021-08-24 南京大学 Android virtualization method and system based on system call agent
CN113391879A (en) * 2021-06-16 2021-09-14 锐捷网络(苏州)有限公司 Virtual system switching method and host machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李鼎基;糜泽羽;吴保东;陈逊;赵永望;丁佐华;陈海波;: "基于跨虚拟机零下陷通信的加速器虚拟化框架", 软件学报, no. 10, 14 October 2020 (2020-10-14) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625487A (en) * 2022-05-16 2022-06-14 浙江毫微米科技有限公司 Method, system, device and storage medium for running application program in meta universe
CN116991544A (en) * 2023-09-26 2023-11-03 苏州元脑智能科技有限公司 Simulation method and device of CXL (control information and automation) equipment, electronic equipment and client
CN116991544B (en) * 2023-09-26 2024-01-26 苏州元脑智能科技有限公司 Simulation method and device of CXL (control information and automation) equipment, electronic equipment and client

Also Published As

Publication number Publication date
CN113886019B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
US11386519B2 (en) Container access to graphics processing unit resources
US10387182B2 (en) Direct memory access (DMA) based synchronized access to remote device
US8629878B2 (en) Extension to a hypervisor that utilizes graphics hardware on a host
CN111475235B (en) Acceleration method, device, equipment and storage medium for function calculation cold start
US10120705B2 (en) Method for implementing GPU virtualization and related apparatus, and system
CN111314799A (en) Terminal system architecture, communication system, communication method, and storage medium
CN113886019B (en) Virtual machine creation method, device, system, medium and equipment
US20120236012A1 (en) Method and Device for Displaying Application Image
CN114625481B (en) Data processing method and device, readable medium and electronic equipment
CN116257320B (en) DPU-based virtualization configuration management method, device, equipment and medium
CN114089920A (en) Data storage method and device, readable medium and electronic equipment
CN116774933A (en) Virtualization processing method of storage device, bridging device, system and medium
WO2023174013A1 (en) Video memory allocation method and apparatus, and medium and electronic device
WO2023179388A1 (en) Hot migration method for virtual machine instance
CN115904761A (en) System on chip, vehicle and video processing unit virtualization method
CN111324376A (en) Function configuration method and device, electronic equipment and computer readable medium
US9058239B2 (en) Hypervisor subpartition as concurrent upgrade
CN115237589A (en) SR-IOV-based virtualization method, device and equipment
US20190317716A1 (en) Video display method, electronic device and computer program product thereof
CN114625480A (en) Data processing method, device, readable medium and computing equipment
CN113886018A (en) Virtual machine resource allocation method, device, medium and equipment
CN117608757A (en) Storage device control method and device, electronic device and storage medium
CN109240602B (en) Data access method
US11481255B2 (en) Management of memory pages for a set of non-consecutive work elements in work queue designated by a sliding window for execution on a coherent accelerator
CN117215730B (en) Data transmission method, device, equipment and storage medium

Legal Events

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