WO2022143714A1 - Server system, and virtual machine creation method and apparatus - Google Patents

Server system, and virtual machine creation method and apparatus Download PDF

Info

Publication number
WO2022143714A1
WO2022143714A1 PCT/CN2021/142282 CN2021142282W WO2022143714A1 WO 2022143714 A1 WO2022143714 A1 WO 2022143714A1 CN 2021142282 W CN2021142282 W CN 2021142282W WO 2022143714 A1 WO2022143714 A1 WO 2022143714A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
module
server
virtual
management
Prior art date
Application number
PCT/CN2021/142282
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 WO2022143714A1 publication Critical patent/WO2022143714A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • 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]
    • 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/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

Definitions

  • the present application relates to the field of cloud computing technologies, and in particular, to a server system, a method and apparatus for creating a virtual machine.
  • virtualization technology shares the physical resources of a server to multiple users with virtual machines as the granularity, so that users can use the physical resources of the server conveniently and flexibly under the premise of security isolation, which can greatly Improve the utilization of physical resources of the server.
  • the present application provides a server system, a method and apparatus for creating a virtual machine, which can reduce the occupation of the physical resources of the server by the virtual machine simulator and ensure the service performance of the virtual machine.
  • the present application provides a server system.
  • the server system includes a server and an unloading card inserted in the server.
  • a connection channel is established between the server and the unloading card; a virtual machine is set in the server, and the virtual machine passes through a virtual machine simulator.
  • the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module; a virtual machine management agent sub-module is deployed on the server, and a virtual machine management sub-module is deployed on the uninstall card.
  • module wherein the virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
  • the virtual machine simulator is realized.
  • the functions that consume more server resources are deployed in the uninstall card, which reduces the overhead of the virtual machine emulator itself and the occupation of server resources, and reduces the cost of the virtual machine emulator itself and the virtual machine that provides services to users due to competition for resources.
  • the impact of the virtual machine business performance effectively guarantees the virtual machine business performance.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
  • the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the functions provided by the virtual machine management sub-module can be regarded as functions that have little relevance to the virtual machine business and/or involve asynchronous operations. Such functions have no impact on the internal performance of the virtual machine itself, but consume less server resources. larger. Therefore, by deploying the virtual machine management sub-module on the uninstall card, the occupation of server resources by the virtual machine simulator can be effectively reduced, and the service performance of the virtual machine can be effectively guaranteed.
  • the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is provided in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  • the virtual machine hardware emulation module is used to implement a function strongly related to the virtual machine function, and the function basically does not consume server resources. Therefore, even if the virtual machine hardware emulation module is deployed in the server, the virtual machine hardware emulation module will not affect the virtual machine. The probability of affecting the business performance of the virtual machine is also very low, which can effectively ensure the business performance of the virtual machine.
  • the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
  • DMA allows direct data transfer between external devices and storage resources, the CPU does not need to be involved in the data transfer process, which can effectively reduce the impact on the server of obtaining data from storage resources. Occupation of resources.
  • the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  • the present application provides a method for creating a virtual machine.
  • the method is applied to a server system.
  • the server system includes a server and an offload card inserted in the server.
  • a connection channel is established between the server and the offload card.
  • the method includes: the server receives The virtual machine creation request sent by the cloud management platform; the server creates a virtual machine in the server according to the virtual machine creation request, starts the virtual machine management agent sub-module set in the server, and starts the virtual machine management set in the uninstall card through the connection channel submodule; wherein, the virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, the virtual machine management module includes a virtual machine management agent submodule and a virtual machine management submodule, and the virtual machine management agent submodule is connected by The channel communicates with the virtual machine management sub-module, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
  • the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
  • the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  • the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  • the present application provides an apparatus for creating a virtual machine, the apparatus is applied to a server, an uninstall card is inserted on the server, a connection channel is established between the server and the uninstall card, and the apparatus includes: a receiving module for receiving cloud management The virtual machine creation request sent by the platform; the processing module is used to create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine set in the uninstall card through the connection channel.
  • the virtual machine is implemented by a virtual machine simulator
  • the virtual machine simulator includes a virtual machine management module
  • the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module
  • the virtual machine management agent sub-module It communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
  • the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
  • the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  • the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  • a computer device in a fourth aspect, includes: a processor and a memory, and a computer program is stored in the memory; when the processor executes the computer program, the computer device implements the method provided in the second aspect.
  • a storage medium is provided, and when instructions in the storage medium are executed by a processor, the method provided in the second aspect is implemented.
  • FIG. 1 is a schematic diagram of an implementation scenario involved in a server system provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the deployment of a server system provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a server system provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another server system provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an implementation process of a virtual machine management agent sub-module and a virtual machine management sub-module collaboratively implementing a VNC function according to an embodiment of the present application;
  • FIG. 6 is a schematic diagram of an implementation process of performing input on a VNC client through a mouse and a keyboard to realize remote control of a virtual machine provided by an embodiment of the present application;
  • FIG. 7 is a flowchart of a method for creating a virtual machine provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an apparatus for creating a virtual machine provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • Cloud computing is a type of distributed computing, which refers to a network that uniformly manages and schedules a large number of computing and storage resources and provides on-demand services to users. Both the computing resources and the storage resources are provided by a cluster of computing devices arranged in the data center. Moreover, cloud computing can provide users with various types of services, such as infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (software as a service). a service, SaaS), etc.
  • IaaS infrastructure as a service
  • PaaS platform as a service
  • SaaS software as a service
  • Virtualization is a resource management technology, which abstracts and transforms various physical resources of the host, such as servers, network resources, memory and storage resources, to break the inseparability between the physical structures of the host. barriers, allowing users to apply these resources in a better way than the original configuration.
  • the resources used through virtualization are called virtualized resources, and the virtualized resources are not limited by the way of setting up existing resources, the geographical area or the physical configuration.
  • virtualized resources include computing resources and storage resources.
  • Virtual machine refers to a complete computer system with complete hardware system functions simulated by virtualization technology and running in a completely isolated environment. Part of the instruction subset of the virtual machine can be processed in the host machine, and other part of the instruction can be executed in an emulated manner. Users can purchase cloud services by renting virtual machines.
  • Host also called physical machine: A physical resource (such as a virtual machine or physical machine) used to host virtualization technology.
  • a host for deploying a virtual machine is a physical server.
  • Direct memory access It can also be called direct memory operation or group data transfer, which means that external devices do not go through the central processing unit (CPU) of the computer, but directly access the memory from the computer's memory.
  • Data interaction mode for fetching data.
  • the CPU of the computer issues an instruction to the DMA controller to instruct the DMA controller to control the data transfer, and the DMA controller feeds back the transfer completion information to the CPU after completing the data transfer. It can be seen that in the process of transferring data by DMA, there is no need for the computer's CPU to perform the transfer operation, which can save the computer's CPU operations such as fetching instructions, fetching numbers, and sending numbers, reducing the resource occupancy rate of the computer's CPU and saving system resource.
  • DMA can include remote DMA (remote direct memory access, RDMA) and local DMA.
  • RDMA refers to a data transmission method that transfers data directly from the memory of one computer to another computer through the network without the intervention of the operating systems of both parties.
  • Local DMA refers to the transfer of data without going through the network.
  • PCIe Peripheral Component Interconnect Express
  • Compute Express Link (CXL) bus A fast connection bus for high-speed computers.
  • Network card Also known as a network interface controller (NIC), network adapter, or LAN receiver, is a piece of computer hardware designed to allow a host or computing device to communicate over a network.
  • NIC network interface controller
  • LAN receiver is a piece of computer hardware designed to allow a host or computing device to communicate over a network.
  • Memory It can also be called internal memory or main memory. Its function is to temporarily store the operation data in the CPU and the data exchanged with external memory such as hard disks.
  • the embodiment of the present application provides a server system.
  • the server system includes a server and an unloading card inserted in the server.
  • a connection channel is established between the server and the uninstall card.
  • a virtual machine is set in the server, and the virtual machine is realized by a virtual machine simulator.
  • the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes a virtual machine management agent submodule and a virtual machine management submodule.
  • a virtual machine management agent submodule is deployed on the server, and a virtual machine management submodule is deployed on the uninstall card.
  • the virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
  • the virtual machine management sub-module Since the virtual machine management sub-module is used to implement the management function of the virtual machine, the virtual machine management sub-module consumes a lot of physical resources. By splitting the virtual machine management module into a virtual machine management agent sub-module and a virtual machine management sub-module , and deploy the virtual machine management sub-module on the uninstall card, so that the functions that consume more server resources in the virtual machine emulator are deployed on the uninstall card, reducing the occupancy of server resources by the overhead of the virtual machine emulator itself. , reducing the cost of the virtual machine simulator itself and the impact of the virtual machine providing services to users on the business performance of the virtual machine due to competing resources, and effectively ensuring the business performance of the virtual machine.
  • FIG. 1 is a schematic diagram of an implementation scenario involved in a server system provided by an embodiment of the present application.
  • the implementation scenario includes: a server system 1 and a management platform 2 .
  • the management platform 2 is used to interact with the user and send the user's request to the server system 1 .
  • the server system 1 is used to respond to the user's request.
  • the management platform 2 is used to send a request for creating a virtual machine or a request for managing a virtual machine to the server system 1
  • the server system 1 is used to create a virtual machine according to the request for creating a virtual machine, or the server 1 is used to create a virtual machine according to the virtual machine creation request.
  • the request for management of the virtual machine is performed to perform operations related to the management of the virtual machine.
  • the virtual machine is used to implement the user's business and provide services for the user, for example, the virtual machine is used to provide the user with a language recognition service, a video review service, or an image rendering service.
  • the server system 1 may be deployed in a cloud platform P of a cloud data center, and the management platform may be a cloud management platform 2 deployed in the cloud platform P.
  • the cloud platform P may be a cloud platform P of a central cloud, a cloud platform P of an edge cloud, or a cloud platform P including a central cloud and an edge cloud, which is not specifically limited in this embodiment of the present application.
  • FIG. 1 is a schematic diagram of the server system 1 being deployed in the cloud platform P. As shown in FIG.
  • the cloud platform P may be implemented by hardware such as the physical server 11 .
  • the cloud platform P can be implemented by one physical server 11, or a physical server 11 cluster composed of several physical servers 11, or a cloud computing service center.
  • the cloud platform P can be implemented by independently deployed resources, or can be implemented by distributed deployed resources.
  • a large number of basic resources owned by the cloud service provider are deployed in the cloud platform P, and the cloud platform P can use the basic resources to provide cloud services to users.
  • the basic resources may include computing resources, storage resources, network resources, etc., and the computing resources may be a large number of computing devices (eg, the server system 1 ).
  • the cloud platform P can create a virtual machine for the user by using basic resources such as the server system 1 to provide the user with the cloud service by using the created virtual machine.
  • the cloud management platform 2 and the server system 1 can be implemented according to the basic resources in the cloud platform P.
  • the cloud management platform 2 may be implemented by software such as virtual machines or containers on basic resources, or the cloud management platform 2 may be implemented by a physical server 11 (also called a host) such as a bare metal server 11 .
  • the server system 1 includes a server 11 and an uninstall card 12 , and the server 11 may be implemented by a physical server 11 (also called a host) such as a bare metal server 11 .
  • the offload card 12 can be implemented by heterogeneous hardware, and the heterogeneous hardware can be used as an external device of the server 11 .
  • the uninstall card 12 is also called a smart card, and the uninstall card 12 can be regarded as a small server.
  • a virtual machine monitor (VMM) 111 and a virtual machine simulator 112 run on the server 11 .
  • the VMM is used to provide hardware resources such as CPU and memory in the server 11 for use by virtual machines (VM1 to VMn in FIG. 2 ) through virtualization technology.
  • the VMM is also used to directly pass the input and output devices provided by the offload card 12 to the virtual machine. By directly passing the input and output devices of the offload card 12 to the virtual machine, the virtual machine can directly access the input and output devices of the offload card 12 bypassing the VMM, so that the virtual machine can obtain performance close to that of a physical machine.
  • the virtual machine simulator 112 is used to virtualize a virtual machine based on the hardware function of the virtual machine provided by the virtual machine manager 111 .
  • the offload card 12 can be connected with storage resources and/or network resources, so that the offload card 12 can send the I/O request of the virtual machine running in the server 11 to the storage resource and/or network resources for processing.
  • the server system 1 includes a server 11 and an uninstall card 12 , and a connection channel is established between the server 11 and the uninstall card 12 .
  • the server 11 is provided with a virtual machine VM (such as VM1, .
  • the management module 1121 includes a virtual machine management agent sub-module 1121a and a virtual machine management sub-module 1121b.
  • a virtual machine management agent sub-module 1121a is deployed on the server 11, and a virtual machine management sub-module 1121b is deployed on the uninstall card 12, wherein the virtual machine management agent sub-module 1121a communicates with the virtual machine management sub-module 1121b through a connection channel, and the virtual machine
  • the management submodule 1121b is used to implement the management function of the virtual machine.
  • the virtual machine management agent sub-module 1121a is specifically configured to receive a management request requesting to manage the virtual machine, and send the management request to the virtual machine management sub-module 1121b through the connection channel
  • the virtual machine management sub-module 1121b is specifically configured to perform operations related to the management of the virtual machine according to the management request, so as to realize the management of the virtual machine.
  • the virtual machine management sub-module 1121b Since the virtual machine management sub-module 1121b is used to implement the management function of virtual machines, the virtual machine management sub-module 1121b consumes a lot of physical resources.
  • the virtual machine management sub-module 1121b is deployed on the offload card 12, so that the function of the virtual machine emulator 112 that consumes more server resources can be deployed on the offload card 12, which reduces the number of virtual machine simulations.
  • the overhead of the server 112 itself occupies server resources, which reduces the overhead of the virtual machine emulator 112 itself and the impact of the virtual machine providing services to users on the business performance of the virtual machine due to competition for resources, effectively ensuring the business performance of the virtual machine. .
  • the server 11 may be implemented by a physical server 11 such as a bare metal server 11 .
  • the offload card 12 can be implemented by heterogeneous hardware, and the heterogeneous hardware can be used as an external device of the server 11 .
  • the connection channel between the offload card 12 and the server 11 can be realized through a connection bus.
  • a PCIe bus, a CXL bus, a virtual peripheral component interconnect (PCI) bus or a virtual industry standard architecture (ISA) bus is connected between the offload card 12 and the server 11.
  • the server 11 processes the input/output (I/O) service that needs to be offloaded to the offload card 12 for processing, it can output the relevant data to the offload card 12 through the bus between the offload card 12 and the server 11 deal with.
  • the offload card 12 is an offload card 12 suitable for connecting a bus between the offload card 12 and the server 11.
  • the offload card 12 is a PCIe card, which is implemented in this application.
  • the model is not specifically limited.
  • FIG. 4 is a schematic structural diagram of a server system 1 provided by an embodiment of the present application.
  • the server system 1 includes a server 11 and an uninstall card 12 .
  • the server 11 includes a CPU1, a memory 1 and a root complex (RC) chip.
  • the offload card 12 includes a CPU 2, a memory 2 and an endpoint (end point, EP) chip, and the EP chip is connected to the RC chip through a PCIe bus.
  • the RC chip is used to provide the CPU1 with a hardware interface for sending and receiving PCIe messages with external devices.
  • the EP chip is used to provide a hardware interface for the peripheral interface to send and receive PCIe messages with the server 11 .
  • the embodiments of the present application do not limit the specific implementation of the RC chip and the EP chip, and any RC chip and EP chip implemented in accordance with the PCIe specification can be used.
  • the EP chip may be an application-specific integrated circuit (ASIC) chip, a smart network card, or a field-programmable gate array (field-programmable gate array, FPGA) chip, or the like.
  • the EP chip can be directly or indirectly connected to the PCIe bus, so that the server 11 and the EP can be connected through the PCIe bus.
  • the EP can be indirectly connected to the PCIe bus through a switch, and the switch can provide more ports for connecting the EP chips to expand the link.
  • the management function of the virtual machine includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the virtual machine management sub-module 1121b includes: one of a virtual machine life cycle management unit b1, a migration unit b2, a virtual remote control unit b3, an asynchronous information processing unit b4 and a parameter parsing unit b5 or random combination.
  • the functions of each unit are as follows:
  • the virtual machine life cycle management unit b1 is used to implement the virtual machine life cycle management function, that is, to manage the running state of the virtual machine.
  • the virtual machine life cycle management unit b1 is used to control the start and stop of the virtual machine.
  • the migration unit b2 is configured to implement a virtual machine migration function, that is, acquire data to be migrated of the virtual machine from the virtual memory 1122b, and perform a migration operation on the virtual machine based on the data to be migrated.
  • the migration unit b2 may be a hot migration unit b2, which is used to perform accelerated processing of the migration logic, including acquiring the data to be migrated of the virtual machine in the virtual memory 1122b by DMA, and then sending the data to be migrated. to other servers 11 to which the virtual machine needs to be migrated.
  • the hot migration module may send the data to be migrated to other servers 11 through the connection channel between the servers 11 .
  • a communication channel such as a socket channel between servers 11 is used to send the data to be migrated to other servers 11 .
  • the virtual remote control unit b3 is used to realize the virtual remote control function, that is, obtain the video memory data from the virtual memory 1122b of the virtual machine, and provide the video memory data to the remote control client, so that the remote control client can remotely control the virtual machine based on the video memory data.
  • the virtual remote control unit b3 can be used to implement the functions of a virtual network console (virtual network console, VNC), including performing VNC protocol analysis, and obtaining video memory data according to operations such as keyboard and mouse.
  • VNC virtual network console
  • the asynchronous information processing unit b4 is used to implement the asynchronous information processing function, that is, to obtain the information required by the virtual machine management sub-module 1121b to perform asynchronous operations from the virtual machine.
  • the virtual machine management sub-module 1121b needs to implement some asynchronous operations according to the data obtained from the virtual machine.
  • the asynchronous information processing unit b4 is configured to acquire relevant information from the virtual machine in a non-busy state of the virtual machine.
  • the asynchronous information processing unit b4 may acquire some configuration information of the virtual machine when the virtual machine is powered on, so that the virtual machine management sub-module 1121b can perform corresponding asynchronous operations according to the configuration information.
  • the parameter parsing unit b5 is used for implementing a parameter parsing function, that is, parsing the communication protocol used for running the virtual machine and the parameters required for running the virtual machine.
  • the parameter parsing unit b5 is used to parse parameters required for creating a virtual machine.
  • the functions provided by the virtual machine management sub-module 1121b can be regarded as functions that have little relevance to the virtual machine business and/or involve asynchronous operations. Such functions have no impact on the internal performance of the virtual machine itself, but consume server resources. but larger. Therefore, by deploying the virtual machine management sub-module 1121b on the uninstall card 12, the occupation of server resources by the virtual machine simulator 112 can be effectively reduced, and the service performance of the virtual machine can be effectively guaranteed.
  • management functions of the virtual machine management module 1121 are only examples of the management functions of the virtual machine management module 1121, and are not used to limit the types of management functions of the virtual machine management module 1121.
  • the types of management functions of the 1121 can be adjusted according to the application requirements of the virtual machine.
  • the virtual machine simulator 112 further includes a virtual machine hardware simulation module 1122, the virtual machine hardware simulation module 1122 is set in the server 11, and the virtual machine hardware simulation module 1122 is used for according to the server
  • the hardware of 11 emulates the hardware of the virtual machine.
  • the virtual machine hardware emulation module 1122 is used to implement a function strongly related to the virtual machine function, and the function basically does not consume server resources. Therefore, even if the virtual machine hardware emulation module 1122 is deployed in the server 11, the virtual machine hardware emulation module The probability of 1122 affecting the business performance of the virtual machine is also very low, which can effectively ensure the business performance of the virtual machine.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor (virtual central processing unit) 1122a, a virtual memory 1122b, a virtual motherboard chip 1122c, a virtual input and output device 1122d, and a virtual bus 1122e .
  • a virtual processor virtual central processing unit
  • a virtual memory 1122b
  • a virtual motherboard chip 1122c
  • a virtual input and output device 1122d
  • a virtual bus 1122e virtual bus
  • the virtual machine hardware simulation module 1122 simulates the hardware of the virtual machine, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the function of the hardware corresponding to the virtual machine.
  • the virtual machine hardware simulation module 1122 simulates the virtual processor 1122a, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the computing capability of the virtual processor 1122a.
  • the virtual machine hardware simulation module 1122 simulates the virtual memory 1122b, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the virtual memory 1122b to temporarily store the operation data in the virtual processor 1122a and the data exchanged with the external memory such as the hard disk. Function.
  • the virtual machine hardware emulation module 1122 emulates the virtual motherboard chip 1122c, which means that the virtual machine hardware emulation module 1122 provides the virtual machine with the virtual motherboard chip 1122c to connect different virtual circuit elements, transmits information between different virtual circuit elements, and receives external information and pass the external information to the corresponding virtual circuit element processing and other functions.
  • the virtual machine hardware simulation module 1122 simulates the virtual input and output device 1122d, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the input and output functions of the input and output device.
  • the virtual machine hardware simulation module 1122 simulates the virtual bus 1122e, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the function of transferring information between the virtual processor 1122a, the virtual memory 1122b and the virtual input/output device 1122d.
  • the virtual memory 1122b includes processor memory allocated to the virtual processor 1122a, and also includes virtual video memory.
  • the virtual motherboard chip 1122c includes a virtual bus 1122e main bridge chip, a virtual bus 1122e south bridge chip, a virtual bus 1122e north bridge chip, and the like.
  • the virtual input and output devices 1122d include a virtual mouse, a virtual keyboard, and the like.
  • the type of the virtual bus 1122e may be determined according to the application requirements of the virtual machine.
  • the virtual bus 1122e may be a virtual PCIe bus, a CXL bus, a PCI bus, an ISA bus, or the like.
  • the above content of the hardware of the virtual machine is only an example of the hardware of the virtual machine simulated by the virtual machine hardware simulation module 1122, and is not used to limit the type of hardware of the virtual machine simulated by the virtual machine hardware simulation module 1122.
  • the type of hardware of the virtual machine simulated by the machine hardware simulation module 1122 can be adjusted according to the application requirements of the virtual machine.
  • the virtual machine simulator 112 since the virtual machine management agent sub-module 1121a and the virtual machine hardware simulation module 1122 are deployed on the server 11, and the virtual machine management sub-module 1121b is deployed on the uninstall card 12, the The management function of the virtual machine can only be realized through the cooperation of the virtual machine VM, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b.
  • the virtual machine management sub-module 1121b needs to acquire data from the storage resources of the virtual machine VM, and perform corresponding operations according to the acquired data.
  • a connection channel is established between the server 11 and the uninstall card 12, and the virtual machine management agent sub-module 1121a can communicate with the virtual machine management sub-module 1121b through the connection channel, so that the virtual machine management agent sub-module 1121a can access the storage resources of the virtual machine from the virtual machine management agent sub-module 1121a.
  • the acquired data is transmitted to the virtual machine management sub-module 1121b.
  • at least two communication channels implemented by software may be established based on the connection channel.
  • the at least two communication channels implemented by software include: an address acquisition channel and a DMA channel.
  • the address acquisition channel is used for the virtual machine management agent sub-module 1121a to send the storage address of the data in the virtual memory to the virtual machine management sub-module 1121b.
  • the storage address can be represented by the first address and offset for the data.
  • the address acquisition channel between the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b may be a socket connection channel (such as a vsock channel).
  • the DMA channel is used for the virtual machine management sub-module 1121b to obtain the required data from the virtual memory through DMA based on the storage address of the data in the virtual memory.
  • the storage address of the data in the virtual memory belongs to the control plane information. Since the data amount of the control plane information is small, the transmission of the control plane information through the address acquisition channel can effectively reduce the overhead of transmitting the control plane information and the occupation of server resources. In addition, data is obtained from virtual memory through DMA. Since DMA allows direct data transfer between external devices and storage resources, the CPU does not need to be involved in the data transfer process, which can effectively reduce the need to obtain data from storage resources. Occupation of server resources.
  • a vsock channel is set between the virtual machine management sub-module 1121b and the virtual machine management agent sub-module 1121a.
  • the virtual machine management submodule 1121b establishes a connection with the VNC client.
  • the virtual machine management sub-module 1121b may send an address acquisition request to the virtual machine management agent sub-module 1121a through the vsock channel.
  • the virtual machine management agent sub-module 1121a can obtain the address of the video memory data in the virtual video memory of the virtual machine according to the address obtaining request, and then sends the address to the virtual machine management sub-module 1121b through the vsock channel.
  • the virtual machine management sub-module 1121b obtains video memory data from the virtual video memory of the virtual machine through DMA according to the address, and sends the video memory data to the VNC client.
  • the implementation of the VNC function means that the VNC client obtains video memory data from the virtual video memory of the virtual machine, displays the video memory data on the VNC client, and then remotely controls the virtual machine according to the displayed content.
  • the specific implementation process of the VNC function may include the following steps:
  • Step S1 after the virtual machine is started, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b start to run, the server 11 pulls up the management agent main thread, the unload card 12 pulls up the vsk_iothread thread and the vnc_worker thread, and in the A vsock channel is established between the vsk_iothread thread and the management agent main thread.
  • the function of the virtual machine management agent sub-module 1121a is implemented by the management agent main thread in the server 11
  • the function of the virtual machine management sub-module 1121b is implemented by the vsk_iothread thread and the vnc_worker thread
  • the virtual memory 1122b is allocated with a virtual video memory vga.vram .
  • step S2 the vnc_worker thread monitors a connection request sent by the VNC client, where the connection request carries an internet protocol (IP) address and a port address of the VNC client.
  • IP internet protocol
  • Step S3 the vnc_worker thread establishes a communication connection with the VNC client according to the IP address and port address of the VNC client, and starts the timer in the virtual machine management sub-module 1121b.
  • step S4 the vsk_iothread thread sends an address acquisition request to the management agent main thread through the vsock channel under the trigger of the timer.
  • Step S5 the management agent main thread in the virtual machine management agent sub-module 1121a monitors the message sent through the vsock channel, parses the address acquisition request after receiving the address acquisition request, and then queries the virtual video memory vga.vram according to the parsed content to obtain Get the address of the video memory data in the virtual video memory, and send the queried video memory address to the vsk_iothread thread through the vsock channel.
  • the operating system of the virtual machine is used to update the video memory data in the virtual video memory according to the running state of the virtual machine.
  • the address of the video memory data in the virtual video memory can be reflected by information such as the physical address of the virtual video memory, a dirty page bitmap, an image dirty bitmap, and the like.
  • the virtual machine management agent sub-module 1121a also simulates a VGA virtual device.
  • the video memory data can be stored in the video memory memory allocated to the VGA virtual device.
  • you can query The video memory data is implemented at the address in the video memory memory allocated to the VGA virtual device.
  • the representation of this address is slightly different.
  • the address is represented by the VGA memory physical address, memory dirty page bitmap and image dirty page bitmap and other information.
  • the address is represented by information such as the physical address stored in the encoding result and the image dirty page bitmap.
  • the basic composition information of the video memory data in addition to obtaining the address of the video memory data in the virtual video memory, it is also necessary to obtain the basic composition information of the video memory data.
  • the image Basic composition information Dirty pages are pages that have updated content in memory but have not yet been flushed to disk.
  • Step S6 the vsk_iothread thread sends the video memory address obtained from the vsock channel to the vnc_worker thread.
  • Step S7 the vnc_worker thread obtains the video memory data from the virtual video memory by means of DMA according to the received video memory address.
  • the vnc_worker thread obtains the video memory data according to the video memory address, it also needs to do preparations such as applying for the memory space for storing the obtained video memory data according to the basic composition information of the video memory data.
  • step S8 the vnc_worker thread encodes the acquired video memory data, and sends the encoded video memory data to the VNC client.
  • step S9 the VNC client performs display according to the received video memory data, and remotely controls the virtual machine according to the displayed image.
  • FIG. 6 is the application A schematic diagram of an implementation process of the implementation scenario provided by the embodiment.
  • the virtual input and output devices simulated by the virtual machine hardware simulation module 1122 include a virtual mouse and a virtual keyboard, and the virtual machine management sub-module 1121b is configured with the virtual input and output devices. Shadow devices for mouse and keyboard.
  • the VNC client After the mouse or keyboard on the VNC client inputs information, the VNC client will transmit the input event to the vnc_worker thread, and the vnc_worker thread will then transmit the input event to the console in the offload card 12 .
  • the console determines whether the input event is generated by the mouse or the keyboard according to the input event, and then feeds back the identification of the input event to the vnc_worker thread.
  • the vnc_worker thread sends the identification to the shadow device, the shadow device records the identification, and sends the identification and the input information to the vsk_iothread thread.
  • the vsk_iothread thread sends the identification and input information to the management agent main thread through the vsock channel.
  • the management agent main thread sends the input information to the corresponding virtual input and output device 1122d according to the identification, that is, when the identification indicates a keyboard, the input information is sent to the virtual keyboard, and when the identification indicates a mouse, the input information is sent to virtual mouse.
  • the corresponding input and output device performs the relevant input operation according to the input information, and sends the result of the input operation to the operating system of the virtual machine through an interrupt signal, so that the operating system updates the video memory according to the result of the input operation.
  • the management agent main thread obtains the updated video memory address, and sends the updated video memory address to the vsk_iothread thread through the vsock channel, so that the vnc_worker thread can obtain the updated video memory data according to the address, and send the updated video memory data to VNC client to display the result of the input operation on the VNC client.
  • the process from receiving the input information to sending the information to the server 11 by the uninstall card 12 can be regarded as the uninstall card 12 encapsulates the input information of the VNC client and transforms it into a remote call event, and then registers the callback and the corresponding shadow device through the corresponding shadow device.
  • vsock channel the process of sending remote invocation events to server 11.
  • the process from the server 11 receiving the information sent by the vsk_iothread thread through the vsock channel to updating the video memory according to the operation result can be regarded as the server 11 reversely analysing the remote call event, and finding the corresponding event processing function of the device call according to the identifier in the content obtained by the analysis process of processing.
  • the implementation process can refer to the implementation process of the aforementioned VNC function. I won't repeat them one by one.
  • the offload card 12 can be connected to the storage resource and/or the network resource through the network card 13, so that the offload card 12 can send the I/O request of the virtual machine running in the server 11 to the storage resource. and/or network resources for processing.
  • the offload card 12 is configured with a network card 13 , and the offload card 12 can be connected to storage resources and network resources in the cloud data center through the network card 13 .
  • a server management module 113 is also deployed in the uninstall card 12 , and the server management module 113 is used to manage the running state of the server system 1 .
  • the server management module 113 is used to manage the virtualization platform (such as implementing the functions of libvirt), be responsible for maintaining and managing the computing resources of the virtual machine (such as implementing the functions of Nova), and be responsible for system installation, upgrade, and deployment in the server 11 functions related to operation and maintenance.
  • the server management module 113 is further configured to receive a management plane operation request sent by the cloud management platform 2, and perform corresponding operations according to the management plane operation request.
  • the management plane operation request may be a request sent by the cloud management platform 2 to manage the virtual machine, or may be a request sent by the user to manage the virtual machine through the cloud management platform 2 .
  • the management plane operation request is received by the server management module 113 and the corresponding operation is performed, so that the server 11 does not need to receive the management plane operation request and perform the corresponding operation, thereby reducing the overhead of server resources due to receiving the management plane request and performing the corresponding operation. , which can further ensure the service performance of the virtual machine.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed on the uninstall card , realizes that the functions that consume more server resources in the virtual machine emulator are deployed in the uninstall card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead and performance of the virtual machine emulator itself.
  • the virtual machine provided by the user effectively guarantees the business performance of the virtual machine due to the influence of competing resources on the business performance of the virtual machine.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
  • the embodiment of the present application also provides a method for creating a virtual machine.
  • the method for creating a virtual machine is applied to the server system provided by the embodiment of the present application.
  • the server system includes a server and an offload card inserted in the server, and a connection channel is established between the server and the offload card.
  • a server management module is also deployed in the uninstall card.
  • the offload card is connected to storage resources and/or network resources through a network card.
  • the server and the offload card may be connected through a bus, for example, a PCIe bus through a virtual high-speed peripheral component interconnection.
  • the virtual machine creation method includes:
  • Step 701 The server receives a virtual machine creation request sent by the cloud platform.
  • the user can operate on the client, and the operation will trigger a virtual machine creation request to be sent to the cloud management platform for requesting the creation of a virtual machine, and the cloud management platform will send the virtual machine to the server. Create a request.
  • the virtual machine creation request carries the configuration requirements of the virtual machine.
  • the configuration requirements for this virtual machine are used to indicate the specifications of the virtual machine requested to be created.
  • the configuration requirement may indicate the specifications of the hardware of the virtual machine required for the virtual machine to run.
  • the hardware specifications of the virtual machine indicated by the configuration requirements may include: the total number of virtual processors, the topology of virtual processors, the type of virtual processors, the amount of virtual memory, the usage policy of virtual memory, the number of virtual memory slots Setting method, type of virtual input and output device, specification of virtual input and output device, storage path of the image file of the operating system of the virtual machine, storage path of the image file of the application program used by the virtual machine to realize the business, and the operating system of the virtual machine Specification parameters such as configuration information of initialization parameters.
  • the topology of the virtual processors is used to indicate one or more of the total number of virtual processors that the virtual machine needs to use, the total number of virtual cores included in each virtual processor, and the total number of hyperthreads included in each virtual processor. multiple.
  • the type of virtual processor is used to indicate the word length and model of the virtual processor.
  • the word size of a virtual processor is the number of bits that the virtual processor can process in parallel at a time.
  • the virtual memory usage policy is used to indicate how virtual memory is used by multiple virtual processors used by the virtual machine. For example, the virtual memory usage policy is used to instruct multiple virtual CPUs used by the virtual machine to use the virtual memory in a non-uniform memory access (NUMA) manner.
  • NUMA non-uniform memory access
  • the specification of the virtual input/output device is used to indicate the configuration specification of the virtual input/output device.
  • the specification of the virtual network card indicates information such as the description information of the queue of the virtual network card and the media access control (media access control, MAC) address and other information.
  • the specification of the virtual disk indicates information such as the capacity of the virtual disk.
  • the image file of the operating system of the virtual machine is used to record information related to the interaction between the operating system and the hardware of the virtual machine.
  • the image file of the application program used by the virtual machine to implement the service is used to record the relevant information about the interaction between the application program used to implement the service and the operating system of the virtual machine running on the basis of the operating system of the virtual machine.
  • the image file of the operating system of the virtual machine may be a kernel image file
  • the image file of an application program used by the virtual machine to implement services may be an initrd image file.
  • Step 702 The server creates a virtual machine in the server according to the virtual machine creation request, starts the virtual machine management agent sub-module set in the server, and starts the virtual machine management sub-module set in the uninstall card through the connection channel.
  • the VMM in the server After the VMM in the server receives the virtual machine creation request, it will pull up the virtual machine hardware simulation module according to the virtual machine creation request, and use the virtual machine hardware simulation module according to the configuration requirements of the virtual machine indicated by the virtual machine creation request. Hardware emulates the hardware of a virtual machine.
  • the VMM will also start the virtual machine management agent sub-module set in the server, and start the virtual machine management sub-module set in the uninstall card through the connection channel, so as to facilitate the virtual machine management agent sub-module and the virtual machine management sub-module through the virtual machine management sub-module. Implements virtual machine management functions.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  • the virtual machine hardware emulation module can indicate the total number of virtual processors, the topology of virtual processors, the type of virtual processors, the amount of virtual memory, the usage policy of virtual memory, and the setting method of virtual memory slots according to the configuration requirements. , the type of virtual input and output devices and the specifications of virtual input and output devices and other specifications related to the hardware of the virtual machine, to simulate the hardware of the virtual machine.
  • the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
  • the management function of the virtual machine includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed in the uninstaller.
  • the functions that consume more server resources in the virtual machine emulator are deployed in the unloading card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead of the virtual machine emulator itself.
  • the business performance of the virtual machine is effectively guaranteed due to the impact of competing resources with the virtual machine that provides services to the user on the business performance of the virtual machine.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
  • the present application provides an apparatus for creating a virtual machine, the apparatus for creating a virtual machine is applied to a server, an uninstall card is inserted on the server, and a connection channel is established between the server and the uninstall card.
  • the apparatus 80 for creating a virtual machine includes: :
  • the receiving module 801 is configured to receive a virtual machine creation request sent by the cloud management platform.
  • the processing module 802 is configured to create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine management sub-module set in the uninstall card through the connection channel.
  • the virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management agent sub-module communicates with the virtual machine through a connection channel
  • the virtual machine management sub-module is used for communication, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
  • the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
  • the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
  • the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  • the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
  • the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  • the virtual machine management module is split into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed in the uninstaller.
  • the functions that consume more server resources in the virtual machine emulator are deployed in the unloading card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead of the virtual machine emulator itself.
  • the business performance of the virtual machine is effectively guaranteed due to the impact of competing resources with the virtual machine that provides services to the user on the business performance of the virtual machine.
  • the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
  • FIG. 9 exemplarily provides a possible architectural diagram of a computer device.
  • the computer device 90 may include a processor 901 , a memory 902 , a communication interface 903 and a bus 904 .
  • the number of processors 901 may be one or more, and FIG. 9 only illustrates one of the processors 901 .
  • the processor 901 may be a central processing unit (Central Processing Unit, CPU). If the computer device has multiple processors 901, the multiple processors 901 may be of different types, or may be the same. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
  • CPU Central Processing Unit
  • the memory 902 stores computer instructions and data, and the memory 902 may store computer instructions and data required to implement the virtual machine creation method provided by the present application.
  • the memory 902 can be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (Read-Only Memory, ROM), solid state disk (Solid State Disk, SSD), hard disk (Hard Disk) Drive, HDD), optical disc, etc., volatile memory.
  • non-volatile memory such as read-only memory (Read-Only Memory, ROM), solid state disk (Solid State Disk, SSD), hard disk (Hard Disk) Drive, HDD), optical disc, etc., volatile memory.
  • the communication interface 903 may be any one or any combination of the following devices: a network interface (eg, an Ethernet interface), a wireless network card, and other devices with a network access function.
  • the communication interface 903 is used for data communication between the computer device and other nodes or other computer devices.
  • FIG. 9 also exemplarily depicts bus 904 .
  • the bus 904 can connect the processor 901 with the memory 902 and the communication interface 903 .
  • the processor 901 can access the memory 902, and can also use the communication interface 903 to perform data interaction with other nodes or other computer devices.
  • the computer device executes the computer instructions in the memory 902 to implement the virtual machine creation method provided by the embodiments of the present application. For example, receive a virtual machine creation request sent by the cloud management platform; create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine set in the uninstall card through the connection channel machine management sub-module.
  • the implementation process of executing the steps of the computer device may refer to the corresponding descriptions in the foregoing method embodiments.
  • Embodiments of the present application further provide a storage medium, where the storage medium is a non-volatile computer-readable storage medium.
  • the storage medium is a non-volatile computer-readable storage medium.
  • the embodiments of the present application also provide a computer program product containing instructions, when the computer program product is run on a computer, the computer is made to execute the virtual machine creation method provided by the embodiments of the present application.
  • the terms “first”, “second” and “third” are only used for description purposes, and cannot be understood as indicating or implying relative importance.
  • the term “at least one” refers to one or more, and the term “plurality” refers to two or more, unless expressly limited otherwise.

Abstract

Disclosed are a server system, and a virtual machine creation method and apparatus, which belong to the technical field of cloud computing. The server system comprises a server and an uninstalling card inserted into the server, wherein a connection channel is established between the server and the uninstalling card; a virtual machine is arranged in the server, the virtual machine is implemented by means of a virtual machine simulator, the virtual machine simulator comprises a virtual machine management module, and the virtual machine management module comprises virtual machine management proxy sub-modules and virtual machine management sub-modules; the virtual machine management proxy sub-modules are deployed on the server, and the virtual machine management sub-modules are deployed on the uninstalling card; and the virtual machine management proxy sub-modules communicate with the virtual machine management sub-modules by means of the connection channel, and the virtual machine management sub-modules are used for implementing a management function of the virtual machine. By means of the present application, the occupation of server resources by the overheads of a virtual machine simulator itself is reduced.

Description

服务器系统、虚拟机创建方法及装置Server system, virtual machine creation method and device 技术领域technical field
本申请涉及云计算技术领域,特别涉及一种服务器系统、虚拟机创建方法及装置。The present application relates to the field of cloud computing technologies, and in particular, to a server system, a method and apparatus for creating a virtual machine.
背景技术Background technique
虚拟化技术作为云场景的核心技术,以虚拟机为粒度将一台服务器的物理资源共享给多个用户使用,使用户能在安全隔离的前提下方便灵活地使用服务器的物理资源,能极大提升服务器的物理资源的利用率。As the core technology of cloud scenarios, virtualization technology shares the physical resources of a server to multiple users with virtual machines as the granularity, so that users can use the physical resources of the server conveniently and flexibly under the premise of security isolation, which can greatly Improve the utilization of physical resources of the server.
然而,在传统虚拟化技术中,通过虚拟机模拟器使用服务器的物理资源为用户提供虚拟机服务时,需要消耗一定的物理资源。However, in the traditional virtualization technology, when using the physical resources of the server to provide virtual machine services to users through the virtual machine simulator, certain physical resources need to be consumed.
因此,无法将服务器的所有物理资源全部提供给用户使用。并且,随着IO性能的提升,虚拟机模拟器消耗的物理资源呈线性增长趁势,会对为用户提供的虚拟机的业务性能产生较大的影响。Therefore, it is impossible to provide all physical resources of the server to users. In addition, with the improvement of IO performance, the physical resources consumed by the virtual machine simulator will increase linearly, which will have a great impact on the business performance of the virtual machine provided to the user.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种服务器系统、虚拟机创建方法及装置,可以降低虚拟机模拟器对服务器的物理资源的占用,保证了虚拟机的业务性能。The present application provides a server system, a method and apparatus for creating a virtual machine, which can reduce the occupation of the physical resources of the server by the virtual machine simulator and ensure the service performance of the virtual machine.
第一方面,本申请提供了一种服务器系统,服务器系统包括服务器和插置于服务器的卸载卡,服务器和卸载卡建立有连接通道;服务器中设置有虚拟机,且虚拟机通过虚拟机模拟器实现,虚拟机模拟器包括虚拟机管理模块,虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块;服务器上部署有虚拟机管理代理子模块,卸载卡上部署有虚拟机管理子模块,其中,虚拟机管理代理子模块通过连接通道与虚拟机管理子模块进行通信,虚拟机管理子模块用于实现虚拟机的管理功能。In a first aspect, the present application provides a server system. The server system includes a server and an unloading card inserted in the server. A connection channel is established between the server and the unloading card; a virtual machine is set in the server, and the virtual machine passes through a virtual machine simulator. Implementation, the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module; a virtual machine management agent sub-module is deployed on the server, and a virtual machine management sub-module is deployed on the uninstall card. module, wherein the virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
在该服务器系统中,通过将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,并将虚拟机管理子模块部署在卸载卡上,实现了将虚拟机模拟器中对服务器资源消耗较大的功能部署在卸载卡中,减少了虚拟机模拟器本身的开销对服务器资源的占用,减小了虚拟机模拟器本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。并且,将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,对虚拟机的业务性能(如对虚拟处理器的调度性能和虚拟机的I/O读写性能)也不会产生副作用,因此具有较好的应用前景。In the server system, by dividing the virtual machine management module into a virtual machine management agent sub-module and a virtual machine management sub-module, and deploying the virtual machine management sub-module on the unloading card, the virtual machine simulator is realized. The functions that consume more server resources are deployed in the uninstall card, which reduces the overhead of the virtual machine emulator itself and the occupation of server resources, and reduces the cost of the virtual machine emulator itself and the virtual machine that provides services to users due to competition for resources. The impact of the virtual machine business performance effectively guarantees the virtual machine business performance. In addition, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
可选地,管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。Optionally, the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
由上可知,虚拟机管理子模块提供的功能可视为与虚拟机业务相关性不大和/或涉及异步操作的功能,此类功能对虚拟机内部性能本身无影响,但是对服务器资源的消耗却较大。因此,通过将虚拟机管理子模块部署在卸载卡,能够有效减小虚拟机模拟器对服务器资源的占用,有效保证虚拟机的业务性能。As can be seen from the above, the functions provided by the virtual machine management sub-module can be regarded as functions that have little relevance to the virtual machine business and/or involve asynchronous operations. Such functions have no impact on the internal performance of the virtual machine itself, but consume less server resources. larger. Therefore, by deploying the virtual machine management sub-module on the uninstall card, the occupation of server resources by the virtual machine simulator can be effectively reduced, and the service performance of the virtual machine can be effectively guaranteed.
在一种可实现方式中,虚拟机模拟器还包括虚拟机硬件模拟模块,虚拟机硬件模拟模块设置在服务器中,虚拟机硬件模拟模块用于根据服务器的硬件模拟虚拟机的硬件。In an implementation manner, the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is provided in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
可选地,虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、 虚拟输入输出设备和虚拟总线。Optionally, the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
该虚拟机硬件模拟模块用于实现与虚拟机功能强相关的功能,该功能基本不消耗服务器资源,因此,即使将该虚拟机硬件模拟模块部署在服务器中,该虚拟机硬件模拟模块对虚拟机的业务性能造成影响的概率也很低,能够有效保证虚拟机的业务性能。The virtual machine hardware emulation module is used to implement a function strongly related to the virtual machine function, and the function basically does not consume server resources. Therefore, even if the virtual machine hardware emulation module is deployed in the server, the virtual machine hardware emulation module will not affect the virtual machine. The probability of affecting the business performance of the virtual machine is also very low, which can effectively ensure the business performance of the virtual machine.
在一种可实现方式中,虚拟机管理子模块还用于通过连接通道以直接存储器访问DMA方式从服务器的内存中访问虚拟机的数据。In an implementation manner, the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
通过DMA方式从虚拟内存中获取数据,由于DMA方式能够允许外部设备和存储资源之间直接进行数据传送,使得数据传送过程中不需要CPU的参与,能够有效减小从存储资源中获取数据对服务器资源的占用。Obtain data from virtual memory through DMA. Since DMA allows direct data transfer between external devices and storage resources, the CPU does not need to be involved in the data transfer process, which can effectively reduce the impact on the server of obtaining data from storage resources. Occupation of resources.
可选地,服务器与卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。Optionally, the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
第二方面,本申请提供了一种虚拟机创建方法,该方法应用于服务器系统,服务器系统包括服务器和插置于服务器的卸载卡,服务器和卸载卡建立有连接通道,该方法包括:服务器接收云管理平台发送的虚拟机创建请求;服务器根据虚拟机创建请求在服务器中创建虚拟机,启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块;其中,虚拟机通过虚拟机模拟器实现,虚拟机模拟器包括虚拟机管理模块,虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块,虚拟机管理代理子模块通过连接通道与虚拟机管理子模块进行通信,虚拟机管理子模块用于实现虚拟机的管理功能。In a second aspect, the present application provides a method for creating a virtual machine. The method is applied to a server system. The server system includes a server and an offload card inserted in the server. A connection channel is established between the server and the offload card. The method includes: the server receives The virtual machine creation request sent by the cloud management platform; the server creates a virtual machine in the server according to the virtual machine creation request, starts the virtual machine management agent sub-module set in the server, and starts the virtual machine management set in the uninstall card through the connection channel submodule; wherein, the virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, the virtual machine management module includes a virtual machine management agent submodule and a virtual machine management submodule, and the virtual machine management agent submodule is connected by The channel communicates with the virtual machine management sub-module, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
可选地,虚拟机模拟器还包括虚拟机硬件模拟模块,虚拟机硬件模拟模块设置在服务器中,虚拟机硬件模拟模块用于根据服务器的硬件模拟虚拟机的硬件。Optionally, the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
可选地,虚拟机管理子模块还用于通过连接通道以直接存储器访问DMA方式从服务器的内存中访问虚拟机的数据。Optionally, the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
可选地,虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。Optionally, the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
可选地,管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。Optionally, the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
可选地,服务器与卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。Optionally, the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
第三方面,本申请提供了一种虚拟机创建装置,该装置应用于服务器,服务器上插置有卸载卡,服务器和卸载卡建立有连接通道,该装置包括:接收模块,用于接收云管理平台发送的虚拟机创建请求;处理模块,用于根据虚拟机创建请求在服务器中创建虚拟机,启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块;其中,虚拟机通过虚拟机模拟器实现,虚拟机模拟器包括虚拟机管理模块,虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块,虚拟机管理代理子模块通过连接通道与虚拟机管理子模块进行通信,虚拟机管理子模块用于实现虚拟机的管理功能。In a third aspect, the present application provides an apparatus for creating a virtual machine, the apparatus is applied to a server, an uninstall card is inserted on the server, a connection channel is established between the server and the uninstall card, and the apparatus includes: a receiving module for receiving cloud management The virtual machine creation request sent by the platform; the processing module is used to create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine set in the uninstall card through the connection channel. machine management sub-module; wherein, the virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management agent sub-module It communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
可选地,虚拟机模拟器还包括虚拟机硬件模拟模块,虚拟机硬件模拟模块设置在服务器中,虚拟机硬件模拟模块用于根据服务器的硬件模拟虚拟机的硬件。Optionally, the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
可选地,虚拟机管理子模块还用于通过连接通道以直接存储器访问DMA方式从服务器的内存中访问虚拟机的数据。Optionally, the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
可选地,虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、 虚拟输入输出设备和虚拟总线。Optionally, the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
可选地,管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。Optionally, the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
可选地,服务器与卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。Optionally, the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
第四方面,提供了一种计算机设备,计算机设备包括:处理器和存储器,存储器中存储有计算机程序;处理器执行计算机程序时,计算机设备实现第二方面提供的方法。In a fourth aspect, a computer device is provided. The computer device includes: a processor and a memory, and a computer program is stored in the memory; when the processor executes the computer program, the computer device implements the method provided in the second aspect.
第五方面,提供了一种存储介质,当存储介质中的指令被处理器执行时,实现第二方面提供的方法。In a fifth aspect, a storage medium is provided, and when instructions in the storage medium are executed by a processor, the method provided in the second aspect is implemented.
附图说明Description of drawings
图1是本申请实施例提供的一种服务器系统涉及的实施场景的示意图;FIG. 1 is a schematic diagram of an implementation scenario involved in a server system provided by an embodiment of the present application;
图2是本申请实施例提供的一种服务器系统的部署示意图;2 is a schematic diagram of the deployment of a server system provided by an embodiment of the present application;
图3是本申请实施例提供的一种服务器系统的结构示意图;3 is a schematic structural diagram of a server system provided by an embodiment of the present application;
图4是本申请实施例提供的另一种服务器系统的结构示意图;4 is a schematic structural diagram of another server system provided by an embodiment of the present application;
图5是本申请实施例提供的一种虚拟机管理代理子模块和虚拟机管理子模块协同实现VNC功能的实现过程示意图;5 is a schematic diagram of an implementation process of a virtual machine management agent sub-module and a virtual machine management sub-module collaboratively implementing a VNC function according to an embodiment of the present application;
图6是本申请实施例提供的一种在VNC客户端上通过鼠标和键盘进行输入,以实现对虚拟机的远程控制的实现过程示意图;6 is a schematic diagram of an implementation process of performing input on a VNC client through a mouse and a keyboard to realize remote control of a virtual machine provided by an embodiment of the present application;
图7是本申请实施例提供的一种虚拟机创建方法的流程图;7 is a flowchart of a method for creating a virtual machine provided by an embodiment of the present application;
图8是本申请实施例提供的一种虚拟机创建装置的结构示意图;8 is a schematic structural diagram of an apparatus for creating a virtual machine provided by an embodiment of the present application;
图9是本申请实施例提供的一种计算机设备的结构示意图。FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
为便于理解,下面先对本申请实施例中涉及的名词进行解释。For ease of understanding, the terms involved in the embodiments of the present application are first explained below.
云计算(cloud computing):云计算是分布式计算的一种,指对大量计算资源和存储资源进行统一管理和调度,向用户提供按需服务的网络。该计算资源和存储资源均通过设置在数据中心的计算设备集群提供。并且,云计算可以为用户提供多种类型的服务类型,例如,可以提供基础设置即服务(infrastructure as a service,IaaS)、平台即服务(platform as a service,PaaS)和软件即服务(software as a service,SaaS)等。Cloud computing: Cloud computing is a type of distributed computing, which refers to a network that uniformly manages and schedules a large number of computing and storage resources and provides on-demand services to users. Both the computing resources and the storage resources are provided by a cluster of computing devices arranged in the data center. Moreover, cloud computing can provide users with various types of services, such as infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (software as a service). a service, SaaS), etc.
虚拟化(virtualization)是一种资源管理技术,是将主机的各种实体资源,如服务器、网络资源、内存及存储资源等,予以抽象、转换后呈现出来,打破主机的实体结构间的不可切割的障碍,使用户可以采用比原本的组态更好的方式来应用这些资源。通过虚拟化使用的资源称为虚拟化资源,虚拟化资源不受现有资源的架设方式、地域或物理组态所限制。一般地,虚拟化资源包括计算资源和存储资源。Virtualization is a resource management technology, which abstracts and transforms various physical resources of the host, such as servers, network resources, memory and storage resources, to break the inseparability between the physical structures of the host. barriers, allowing users to apply these resources in a better way than the original configuration. The resources used through virtualization are called virtualized resources, and the virtualized resources are not limited by the way of setting up existing resources, the geographical area or the physical configuration. Generally, virtualized resources include computing resources and storage resources.
虚拟机(virtual machine,VM):指通过虚拟化技术模拟得到的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整的计算机系统。虚拟机的部分指令子集可以在宿主(host)机中处理,其它部分指令可以以仿真的方式执行。用户可以通过租用虚拟机的形式购买云服务。Virtual machine (virtual machine, VM): refers to a complete computer system with complete hardware system functions simulated by virtualization technology and running in a completely isolated environment. Part of the instruction subset of the virtual machine can be processed in the host machine, and other part of the instruction can be executed in an emulated manner. Users can purchase cloud services by renting virtual machines.
主机(也称物理机):用于承载虚拟化技术的物理资源(如虚拟机或物理机)。通常的, 用于部署虚拟机的主机通常为物理服务器。Host (also called physical machine): A physical resource (such as a virtual machine or physical machine) used to host virtualization technology. Typically, a host for deploying a virtual machine is a physical server.
直接存储器访问(direct memory access,DMA):也可以称为直接内存操作或者组数据传输方式,是指外部设备不经过计算机的中央处理器(central processing unit,CPU),而直接从计算机的内存存取数据的数据交互模式。在DMA模式下传输数据时,由计算机的CPU向DMA控制器下达指令,以指示DMA控制器控制数据的传输,DMA控制器在完成数据传输后向CPU反馈传输完成的信息。可以看出,在该DMA传输数据的过程中,无需计算机的CPU执行传输操作,可以省去计算机的CPU取指令、取数、送数等操作,减轻了计算机的CPU的资源占有率,能够节省系统资源。Direct memory access (DMA): It can also be called direct memory operation or group data transfer, which means that external devices do not go through the central processing unit (CPU) of the computer, but directly access the memory from the computer's memory. Data interaction mode for fetching data. When transferring data in DMA mode, the CPU of the computer issues an instruction to the DMA controller to instruct the DMA controller to control the data transfer, and the DMA controller feeds back the transfer completion information to the CPU after completing the data transfer. It can be seen that in the process of transferring data by DMA, there is no need for the computer's CPU to perform the transfer operation, which can save the computer's CPU operations such as fetching instructions, fetching numbers, and sending numbers, reducing the resource occupancy rate of the computer's CPU and saving system resource.
DMA可以包括远程DMA(remote direct memory access,RDMA)和本地DMA。RDMA是指通过网络将数据直接从一台计算机的内存传输到另一台计算机,无需双方操作系统的介入的数据传输方式。本地DMA是指无需通过网络进行的数据传输方式。DMA can include remote DMA (remote direct memory access, RDMA) and local DMA. RDMA refers to a data transmission method that transfers data directly from the memory of one computer to another computer through the network without the intervention of the operating systems of both parties. Local DMA refers to the transfer of data without going through the network.
外围组件互连快速(peripheral component interconnect express,PCIe)总线:一种高速串行计算机扩展总线。Peripheral Component Interconnect Express (PCIe) bus: A high-speed serial computer expansion bus.
计算快速链接(compute express link,CXL)总线:一种高速计算机的快速连接总线。Compute Express Link (CXL) bus: A fast connection bus for high-speed computers.
网卡:也可以称为网络接口控制器(network interface controller,NIC)、网络适配器、或者局域网接收器,是一种被设计为允许主机或计算设备在网络上进行通信的计算机硬件。Network card: Also known as a network interface controller (NIC), network adapter, or LAN receiver, is a piece of computer hardware designed to allow a host or computing device to communicate over a network.
内存(memory):也可以称为内存储器或者主存储器,其作用是暂时存放CPU中的运算数据,以及与硬盘等外部存储器交换的数据。Memory: It can also be called internal memory or main memory. Its function is to temporarily store the operation data in the CPU and the data exchanged with external memory such as hard disks.
本申请实施例提供了一种服务器系统。该服务器系统包括服务器和插置于服务器的卸载卡。服务器和卸载卡建立有连接通道。服务器中设置有虚拟机,且虚拟机通过虚拟机模拟器实现,虚拟机模拟器包括虚拟机管理模块,虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块。服务器上部署有虚拟机管理代理子模块,卸载卡上部署有虚拟机管理子模块。其中,虚拟机管理代理子模块通过连接通道与虚拟机管理子模块进行通信,虚拟机管理子模块用于实现虚拟机的管理功能。The embodiment of the present application provides a server system. The server system includes a server and an unloading card inserted in the server. A connection channel is established between the server and the uninstall card. A virtual machine is set in the server, and the virtual machine is realized by a virtual machine simulator. The virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes a virtual machine management agent submodule and a virtual machine management submodule. A virtual machine management agent submodule is deployed on the server, and a virtual machine management submodule is deployed on the uninstall card. The virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
由于虚拟机管理子模块用于实现虚拟机的管理功能,该虚拟机管理子模块对物理资源的消耗较大,通过将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,并将虚拟机管理子模块部署在卸载卡上,实现了将虚拟机模拟器中对服务器资源消耗较大的功能部署在卸载卡中,减少了虚拟机模拟器本身的开销对服务器资源的占用,减小了虚拟机模拟器本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。Since the virtual machine management sub-module is used to implement the management function of the virtual machine, the virtual machine management sub-module consumes a lot of physical resources. By splitting the virtual machine management module into a virtual machine management agent sub-module and a virtual machine management sub-module , and deploy the virtual machine management sub-module on the uninstall card, so that the functions that consume more server resources in the virtual machine emulator are deployed on the uninstall card, reducing the occupancy of server resources by the overhead of the virtual machine emulator itself. , reducing the cost of the virtual machine simulator itself and the impact of the virtual machine providing services to users on the business performance of the virtual machine due to competing resources, and effectively ensuring the business performance of the virtual machine.
图1是本申请实施例提供的一种服务器系统涉及的实施场景的示意图。如图1所示,该实施场景包括:服务器系统1和管理平台2。管理平台2用于与用户进行交互,并将用户的请求发送至服务器系统1。服务器系统1用于对用户的请求进行响应。例如,管理平台2用于将虚拟机创建请求或对虚拟机进行管理的请求发送至服务器系统1,服务器系统1用于根据该虚拟机创建请求创建虚拟机,或者,服务器1用于根据对虚拟机进行管理的请求执行对虚拟机进行管理的相关操作。其中,虚拟机用于实现用户的业务,为用户提供服务,例如:虚拟机用于向用户提供语言识别服务、视频审核服务或图像渲染服务等。FIG. 1 is a schematic diagram of an implementation scenario involved in a server system provided by an embodiment of the present application. As shown in FIG. 1 , the implementation scenario includes: a server system 1 and a management platform 2 . The management platform 2 is used to interact with the user and send the user's request to the server system 1 . The server system 1 is used to respond to the user's request. For example, the management platform 2 is used to send a request for creating a virtual machine or a request for managing a virtual machine to the server system 1, and the server system 1 is used to create a virtual machine according to the request for creating a virtual machine, or the server 1 is used to create a virtual machine according to the virtual machine creation request. The request for management of the virtual machine is performed to perform operations related to the management of the virtual machine. Among them, the virtual machine is used to implement the user's business and provide services for the user, for example, the virtual machine is used to provide the user with a language recognition service, a video review service, or an image rendering service.
在一种可实现方式中,该服务器系统1可以部署在云数据中心的云平台P中,该管理平台可以为部署在云平台P中的云管理平台2。该云平台P可以是中心云的云平台P、边缘云的云平台P或包括中心云和边缘云的云平台P,本申请实施例对其也不做具体限定。其中, 图1为服务器系统1部署在云平台P中的示意图。In an implementation manner, the server system 1 may be deployed in a cloud platform P of a cloud data center, and the management platform may be a cloud management platform 2 deployed in the cloud platform P. The cloud platform P may be a cloud platform P of a central cloud, a cloud platform P of an edge cloud, or a cloud platform P including a central cloud and an edge cloud, which is not specifically limited in this embodiment of the present application. Wherein, FIG. 1 is a schematic diagram of the server system 1 being deployed in the cloud platform P. As shown in FIG.
在一种可实现方式中,云平台P可以通过物理服务器11等硬件方式实现。例如,云平台P可以通过一台物理服务器11,或者由若干台物理服务器11组成的物理服务器11集群,或者是一个云计算服务中心实现。并且,云平台P可以通过独立部署的资源实现,或者可以通过分布式部署的资源实现。In an implementation manner, the cloud platform P may be implemented by hardware such as the physical server 11 . For example, the cloud platform P can be implemented by one physical server 11, or a physical server 11 cluster composed of several physical servers 11, or a cloud computing service center. Moreover, the cloud platform P can be implemented by independently deployed resources, or can be implemented by distributed deployed resources.
云平台P中部署有云服务提供商拥有的大量基础资源,云平台P可以利用该基础资源向用户提供云服务。该基础资源可以包括计算资源、存储资源和网络资源等,且该计算资源可以是大量的计算设备(例如服务器系统1)。如图1所示,当用户购买云服务后,云平台P可以利用服务器系统1等基础资源为用户创建虚拟机,以使用创建的虚拟机向用户提供云服务。A large number of basic resources owned by the cloud service provider are deployed in the cloud platform P, and the cloud platform P can use the basic resources to provide cloud services to users. The basic resources may include computing resources, storage resources, network resources, etc., and the computing resources may be a large number of computing devices (eg, the server system 1 ). As shown in FIG. 1 , after the user purchases the cloud service, the cloud platform P can create a virtual machine for the user by using basic resources such as the server system 1 to provide the user with the cloud service by using the created virtual machine.
云管理平台2和服务器系统1可以根据该云平台P中的基础资源实现。可选的,云管理平台2可以通过在基础资源上通过虚拟机或容器等软件实现,或者,云管理平台2可以通过裸金属服务器11等物理服务器11(也称主机)实现。服务器系统1包括服务器11和卸载卡12,服务器11可以通过裸金属服务器11等物理服务器11(也称主机)实现。卸载卡12可以通过异构硬件实现,且该异构硬件可作为服务器11的外接设备。其中,卸载卡12也称智能卡,该卸载卡12可视为小型服务器。The cloud management platform 2 and the server system 1 can be implemented according to the basic resources in the cloud platform P. Optionally, the cloud management platform 2 may be implemented by software such as virtual machines or containers on basic resources, or the cloud management platform 2 may be implemented by a physical server 11 (also called a host) such as a bare metal server 11 . The server system 1 includes a server 11 and an uninstall card 12 , and the server 11 may be implemented by a physical server 11 (also called a host) such as a bare metal server 11 . The offload card 12 can be implemented by heterogeneous hardware, and the heterogeneous hardware can be used as an external device of the server 11 . The uninstall card 12 is also called a smart card, and the uninstall card 12 can be regarded as a small server.
如图2所示,服务器11上运行有虚拟机管理器(virtual machine monitor,VMM)111和虚拟机模拟器112。该VMM用于通过虚拟化技术,将服务器11中的CPU和内存等硬件资源提供给虚拟机(如图2中VM1至VMn)使用。并且,该VMM还用于将卸载卡12提供的输入输出设备直通给虚拟机使用。通过将卸载卡12的输入输出设备直通给虚拟机使用,使得虚拟机能够绕过VMM直接访问卸载卡12的输入输出设备,从而使得虚拟机能够获得接近物理机的性能。该虚拟机模拟器112用于基于虚拟机管理器111提供的虚拟机的硬件功能虚拟出虚拟机。As shown in FIG. 2 , a virtual machine monitor (VMM) 111 and a virtual machine simulator 112 run on the server 11 . The VMM is used to provide hardware resources such as CPU and memory in the server 11 for use by virtual machines (VM1 to VMn in FIG. 2 ) through virtualization technology. In addition, the VMM is also used to directly pass the input and output devices provided by the offload card 12 to the virtual machine. By directly passing the input and output devices of the offload card 12 to the virtual machine, the virtual machine can directly access the input and output devices of the offload card 12 bypassing the VMM, so that the virtual machine can obtain performance close to that of a physical machine. The virtual machine simulator 112 is used to virtualize a virtual machine based on the hardware function of the virtual machine provided by the virtual machine manager 111 .
可选地,如图2所示,卸载卡12可以与存储资源和/或网络资源连接,以便于卸载卡12能将服务器11中运行的虚拟机的I/O请求发送至存储资源和/或网络资源进行处理。Optionally, as shown in FIG. 2 , the offload card 12 can be connected with storage resources and/or network resources, so that the offload card 12 can send the I/O request of the virtual machine running in the server 11 to the storage resource and/or network resources for processing.
下面对本申请实施例提供的服务器系统1的实现方式进行说明。如图3所示,该服务器系统1包括:服务器11和卸载卡12,服务器11和卸载卡12建立有连接通道。The implementation manner of the server system 1 provided by the embodiments of the present application will be described below. As shown in FIG. 3 , the server system 1 includes a server 11 and an uninstall card 12 , and a connection channel is established between the server 11 and the uninstall card 12 .
服务器11中设置有虚拟机VM(如图3中VM1,......,VMn),且虚拟机通过虚拟机模拟器112实现,虚拟机模拟器112包括虚拟机管理模块1121,虚拟机管理模块1121包括虚拟机管理代理子模块1121a和虚拟机管理子模块1121b。The server 11 is provided with a virtual machine VM (such as VM1, . The management module 1121 includes a virtual machine management agent sub-module 1121a and a virtual machine management sub-module 1121b.
服务器11上部署有虚拟机管理代理子模块1121a,卸载卡12上部署有虚拟机管理子模块1121b,其中,虚拟机管理代理子模块1121a通过连接通道与虚拟机管理子模块1121b进行通信,虚拟机管理子模块1121b用于实现虚拟机的管理功能。A virtual machine management agent sub-module 1121a is deployed on the server 11, and a virtual machine management sub-module 1121b is deployed on the uninstall card 12, wherein the virtual machine management agent sub-module 1121a communicates with the virtual machine management sub-module 1121b through a connection channel, and the virtual machine The management submodule 1121b is used to implement the management function of the virtual machine.
在一种可实现方式中,虚拟机管理代理子模块1121a具体用于接收请求对虚拟机进行管理的管理请求,并通过连接通道将管理请求发送至虚拟机管理子模块1121b,虚拟机管理子模块1121b具体用于根据管理请求,执行对虚拟机进行管理的相关操作,实现对虚拟机的管理。In an implementation manner, the virtual machine management agent sub-module 1121a is specifically configured to receive a management request requesting to manage the virtual machine, and send the management request to the virtual machine management sub-module 1121b through the connection channel, and the virtual machine management sub-module 1121b is specifically configured to perform operations related to the management of the virtual machine according to the management request, so as to realize the management of the virtual machine.
由于虚拟机管理子模块1121b用于实现虚拟机的管理功能,该虚拟机管理子模块1121b对物理资源的消耗较大,通过将虚拟机管理模块1121拆分为虚拟机管理代理子模块1121a和虚拟机管理子模块1121b,并将虚拟机管理子模块1121b部署在卸载卡12上,实现了将虚拟机模拟器112中对服务器资源消耗较大的功能部署在卸载卡12中,减少了虚拟机模拟器112 本身的开销对服务器资源的占用,减小了虚拟机模拟器112本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。Since the virtual machine management sub-module 1121b is used to implement the management function of virtual machines, the virtual machine management sub-module 1121b consumes a lot of physical resources. The virtual machine management sub-module 1121b is deployed on the offload card 12, so that the function of the virtual machine emulator 112 that consumes more server resources can be deployed on the offload card 12, which reduces the number of virtual machine simulations. The overhead of the server 112 itself occupies server resources, which reduces the overhead of the virtual machine emulator 112 itself and the impact of the virtual machine providing services to users on the business performance of the virtual machine due to competition for resources, effectively ensuring the business performance of the virtual machine. .
在本申请实施例中,服务器11可以通过裸金属服务器11等物理服务器11实现。卸载卡12可以通过异构硬件实现,且该异构硬件可作为服务器11的外接设备。该卸载卡12与服务器11之间的连接通道可以通过连接总线实现。例如,卸载卡12和服务器11之间连接有PCIe总线、CXL总线、虚拟外围组件互联(peripheral component interconnect,PCI)总线或虚拟工业标准结构(industry standard architecture,ISA)总线。此时,服务器11在处理需要卸载至卸载卡12处理的输入/输出(input/output,I/O)业务时,可以通过卸载卡12和服务器11之间的总线将相关数据输给卸载卡12处理。并且,卸载卡12为适用于卸载卡12和服务器11之间连接总线的卸载卡12,例如,当卸载卡12和服务器11之间连接有PCIe总线时,卸载卡12为PCIe卡,本申请实施例对其型号不做具体限定。In this embodiment of the present application, the server 11 may be implemented by a physical server 11 such as a bare metal server 11 . The offload card 12 can be implemented by heterogeneous hardware, and the heterogeneous hardware can be used as an external device of the server 11 . The connection channel between the offload card 12 and the server 11 can be realized through a connection bus. For example, a PCIe bus, a CXL bus, a virtual peripheral component interconnect (PCI) bus or a virtual industry standard architecture (ISA) bus is connected between the offload card 12 and the server 11. At this time, when the server 11 processes the input/output (I/O) service that needs to be offloaded to the offload card 12 for processing, it can output the relevant data to the offload card 12 through the bus between the offload card 12 and the server 11 deal with. In addition, the offload card 12 is an offload card 12 suitable for connecting a bus between the offload card 12 and the server 11. For example, when a PCIe bus is connected between the offload card 12 and the server 11, the offload card 12 is a PCIe card, which is implemented in this application. For example, the model is not specifically limited.
下面以卸载卡12和服务器11之间通过PCIe总线连接为例,对该服务器系统1的实现方式进行说明。图4是本申请实施例提供的一种服务器系统1的结构示意图。如图4所示,该系统架构中服务器系统1包括服务器11和卸载卡12。服务器11包括CPU1、内存1和根复用器(root complex,RC)芯片。卸载卡12包括CPU2、内存2和端点(end point,EP)芯片,该EP芯片与RC芯片通过PCIe总线连接。其中,RC芯片用于为CPU1提供与外部设备发送和接收PCIe消息的硬件接口。EP芯片用于为外设接口提供与服务器11发送和接收PCIe消息的硬件接口。The implementation of the server system 1 will be described below by taking the connection between the offload card 12 and the server 11 via the PCIe bus as an example. FIG. 4 is a schematic structural diagram of a server system 1 provided by an embodiment of the present application. As shown in FIG. 4 , in the system architecture, the server system 1 includes a server 11 and an uninstall card 12 . The server 11 includes a CPU1, a memory 1 and a root complex (RC) chip. The offload card 12 includes a CPU 2, a memory 2 and an endpoint (end point, EP) chip, and the EP chip is connected to the RC chip through a PCIe bus. Among them, the RC chip is used to provide the CPU1 with a hardware interface for sending and receiving PCIe messages with external devices. The EP chip is used to provide a hardware interface for the peripheral interface to send and receive PCIe messages with the server 11 .
本申请实施例对RC芯片和EP芯片的具体实现不做限定,只要遵循PCIe规范实现的任何RC芯片以及EP芯片均可使用。例如,EP芯片可以是专用集成电路(application-specific integrated circuit,ASIC)芯片、智能网卡或者现场可编程门阵列(field-programmable gate array,FPGA)芯片等。并且,EP芯片可以直接或间接地连接到PCIe总线上,使得服务器11与EP可以通过PCIe总线进行连接。例如,EP可以通过交换机(switch)间接连接到PCIe总线上,该交换机能够提供更多的用于连接EP芯片的端口,以用于扩展链路。The embodiments of the present application do not limit the specific implementation of the RC chip and the EP chip, and any RC chip and EP chip implemented in accordance with the PCIe specification can be used. For example, the EP chip may be an application-specific integrated circuit (ASIC) chip, a smart network card, or a field-programmable gate array (field-programmable gate array, FPGA) chip, or the like. Moreover, the EP chip can be directly or indirectly connected to the PCIe bus, so that the server 11 and the EP can be connected through the PCIe bus. For example, the EP can be indirectly connected to the PCIe bus through a switch, and the switch can provide more ports for connecting the EP chips to expand the link.
可选地,虚拟机的管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。相应的,如图4所示,虚拟机管理子模块1121b包括:虚拟机生命周期管理单元b1、迁移单元b2、虚拟远程控制单元b3、异步信息处理单元b4和参数解析单元b5中的一者或任意组合。各个单元的作用如下:Optionally, the management function of the virtual machine includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function. Correspondingly, as shown in FIG. 4, the virtual machine management sub-module 1121b includes: one of a virtual machine life cycle management unit b1, a migration unit b2, a virtual remote control unit b3, an asynchronous information processing unit b4 and a parameter parsing unit b5 or random combination. The functions of each unit are as follows:
虚拟机生命周期管理单元b1用于实现虚拟机生命周期管理功能,即对虚拟机的运行状态进行管理。例如,虚拟机生命周期管理单元b1用于控制虚拟机启动和停止。The virtual machine life cycle management unit b1 is used to implement the virtual machine life cycle management function, that is, to manage the running state of the virtual machine. For example, the virtual machine life cycle management unit b1 is used to control the start and stop of the virtual machine.
迁移单元b2用于实现虚拟机迁移功能,即从虚拟内存1122b中获取虚拟机的待迁移数据,基于待迁移数据对虚拟机执行迁移操作。在一种可实现方式中,该迁移单元b2可以为热迁移单元b2,用于进行迁移逻辑的加速处理,包括采用DMA方式获取虚拟内存1122b中虚拟机的待迁移数据,再将待迁移数据发送至需将虚拟机迁移到的其他服务器11上。其中,热迁移模块可以通过服务器11间的连接通道向其他服务器11发送待迁移数据。例如,采用服务器11间的socket通道等通信通道向其他服务器11发送待迁移数据。The migration unit b2 is configured to implement a virtual machine migration function, that is, acquire data to be migrated of the virtual machine from the virtual memory 1122b, and perform a migration operation on the virtual machine based on the data to be migrated. In an achievable manner, the migration unit b2 may be a hot migration unit b2, which is used to perform accelerated processing of the migration logic, including acquiring the data to be migrated of the virtual machine in the virtual memory 1122b by DMA, and then sending the data to be migrated. to other servers 11 to which the virtual machine needs to be migrated. The hot migration module may send the data to be migrated to other servers 11 through the connection channel between the servers 11 . For example, a communication channel such as a socket channel between servers 11 is used to send the data to be migrated to other servers 11 .
虚拟远程控制单元b3用于实现虚拟远程控制功能,即从虚拟机的虚拟内存1122b中获取显存数据,向远程控制客户端提供显存数据,以供远程控制客户端基于显存数据对虚拟机进行远程控制。在一种可实现方式中,该虚拟远程控制单元b3可用于实现虚拟网络控制台(virtual network console,VNC)的功能,包括做VNC的协议解析、根据键盘鼠标等操作获取显存数据的功能等。The virtual remote control unit b3 is used to realize the virtual remote control function, that is, obtain the video memory data from the virtual memory 1122b of the virtual machine, and provide the video memory data to the remote control client, so that the remote control client can remotely control the virtual machine based on the video memory data. . In an achievable manner, the virtual remote control unit b3 can be used to implement the functions of a virtual network console (virtual network console, VNC), including performing VNC protocol analysis, and obtaining video memory data according to operations such as keyboard and mouse.
异步信息处理单元b4用于实现异步信息处理功能,即从虚拟机中获取虚拟机管理子模块1121b执行异步操作所需的信息。在虚拟机的运行过程中,虚拟机管理子模块1121b实现一些异步操作需要根据从虚拟机中获取的数据实现。此时,异步信息处理单元b4用于在虚拟机的非忙碌状态下,从虚拟机中获取相关信息。例如,异步信息处理单元b4可以在虚拟机开机时获取虚拟机的一些配置信息,使得虚拟机管理子模块1121b能够根据该配置信息执行对应的异步操作。The asynchronous information processing unit b4 is used to implement the asynchronous information processing function, that is, to obtain the information required by the virtual machine management sub-module 1121b to perform asynchronous operations from the virtual machine. During the running process of the virtual machine, the virtual machine management sub-module 1121b needs to implement some asynchronous operations according to the data obtained from the virtual machine. At this time, the asynchronous information processing unit b4 is configured to acquire relevant information from the virtual machine in a non-busy state of the virtual machine. For example, the asynchronous information processing unit b4 may acquire some configuration information of the virtual machine when the virtual machine is powered on, so that the virtual machine management sub-module 1121b can perform corresponding asynchronous operations according to the configuration information.
参数解析单元b5用于实现参数解析功能,即对运行虚拟机使用到的通信协议和运行虚拟机所需的参数进行解析。例如,参数解析单元b5用于解析创建虚拟机所需的参数。The parameter parsing unit b5 is used for implementing a parameter parsing function, that is, parsing the communication protocol used for running the virtual machine and the parameters required for running the virtual machine. For example, the parameter parsing unit b5 is used to parse parameters required for creating a virtual machine.
由上可知,虚拟机管理子模块1121b提供的功能可视为与虚拟机业务相关性不大和/或涉及异步操作的功能,此类功能对虚拟机内部性能本身无影响,但是对服务器资源的消耗却较大。因此,通过将虚拟机管理子模块1121b部署在卸载卡12,能够有效减小虚拟机模拟器112对服务器资源的占用,有效保证虚拟机的业务性能。As can be seen from the above, the functions provided by the virtual machine management sub-module 1121b can be regarded as functions that have little relevance to the virtual machine business and/or involve asynchronous operations. Such functions have no impact on the internal performance of the virtual machine itself, but consume server resources. but larger. Therefore, by deploying the virtual machine management sub-module 1121b on the uninstall card 12, the occupation of server resources by the virtual machine simulator 112 can be effectively reduced, and the service performance of the virtual machine can be effectively guaranteed.
需要说明的是,以上对虚拟机管理模块1121的管理功能的内容仅为对虚拟机管理模块1121的管理功能的举例,不用于限定虚拟机管理模块1121的管理功能的种类,该虚拟机管理模块1121的管理功能的种类可以根据虚拟机的应用需求进行调整。It should be noted that the above contents of the management functions of the virtual machine management module 1121 are only examples of the management functions of the virtual machine management module 1121, and are not used to limit the types of management functions of the virtual machine management module 1121. The types of management functions of the 1121 can be adjusted according to the application requirements of the virtual machine.
在一种可实现方式中,如图4所示,虚拟机模拟器112还包括虚拟机硬件模拟模块1122,虚拟机硬件模拟模块1122设置在服务器11中,虚拟机硬件模拟模块1122用于根据服务器11的硬件模拟虚拟机的硬件。该虚拟机硬件模拟模块1122用于实现与虚拟机功能强相关的功能,该功能基本不消耗服务器资源,因此,即使将该虚拟机硬件模拟模块1122部署在服务器11中,该虚拟机硬件模拟模块1122对虚拟机的业务性能造成影响的概率也很低,能够有效保证虚拟机的业务性能。In an implementation manner, as shown in FIG. 4 , the virtual machine simulator 112 further includes a virtual machine hardware simulation module 1122, the virtual machine hardware simulation module 1122 is set in the server 11, and the virtual machine hardware simulation module 1122 is used for according to the server The hardware of 11 emulates the hardware of the virtual machine. The virtual machine hardware emulation module 1122 is used to implement a function strongly related to the virtual machine function, and the function basically does not consume server resources. Therefore, even if the virtual machine hardware emulation module 1122 is deployed in the server 11, the virtual machine hardware emulation module The probability of 1122 affecting the business performance of the virtual machine is also very low, which can effectively ensure the business performance of the virtual machine.
可选地,如图4所示,虚拟机的硬件包括以下一个或多个:虚拟处理器(virtual central processing unit)1122a、虚拟内存1122b、虚拟主板芯片1122c、虚拟输入输出设备1122d和虚拟总线1122e。Optionally, as shown in FIG. 4 , the hardware of the virtual machine includes one or more of the following: a virtual processor (virtual central processing unit) 1122a, a virtual memory 1122b, a virtual motherboard chip 1122c, a virtual input and output device 1122d, and a virtual bus 1122e .
其中,虚拟机硬件模拟模块1122模拟虚拟机的硬件,是指虚拟机硬件模拟模块1122向虚拟机提供对应虚拟机的硬件的功能。例如,虚拟机硬件模拟模块1122模拟虚拟处理器1122a,是指虚拟机硬件模拟模块1122向虚拟机提供虚拟处理器1122a的计算能力。又例如,虚拟机硬件模拟模块1122模拟虚拟内存1122b,是指虚拟机硬件模拟模块1122向虚拟机提供虚拟内存1122b暂时存放虚拟处理器1122a中的运算数据,以及与硬盘等外部存储器交换的数据的功能。又例如,虚拟机硬件模拟模块1122模拟虚拟主板芯片1122c,是指虚拟机硬件模拟模块1122向虚拟机提供虚拟主板芯片1122c连接不同虚拟电路元件,在不同虚拟电路元件之间传递信息,以及接收外部信息并将该外部信息传递给对应虚拟电路元件处理等功能。又例如,虚拟机硬件模拟模块1122模拟虚拟输入输出设备1122d,是指虚拟机硬件模拟模块1122向虚拟机提供输入输出设备所具有的输入和输出功能。又例如,虚拟机硬件模拟模块1122模拟虚拟总线1122e,是指虚拟机硬件模拟模块1122向虚拟机提供在虚拟处理器1122a、虚拟内存1122b和虚拟输入输出设备1122d之间传递信息的功能。The virtual machine hardware simulation module 1122 simulates the hardware of the virtual machine, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the function of the hardware corresponding to the virtual machine. For example, the virtual machine hardware simulation module 1122 simulates the virtual processor 1122a, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the computing capability of the virtual processor 1122a. For another example, the virtual machine hardware simulation module 1122 simulates the virtual memory 1122b, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the virtual memory 1122b to temporarily store the operation data in the virtual processor 1122a and the data exchanged with the external memory such as the hard disk. Function. For another example, the virtual machine hardware emulation module 1122 emulates the virtual motherboard chip 1122c, which means that the virtual machine hardware emulation module 1122 provides the virtual machine with the virtual motherboard chip 1122c to connect different virtual circuit elements, transmits information between different virtual circuit elements, and receives external information and pass the external information to the corresponding virtual circuit element processing and other functions. For another example, the virtual machine hardware simulation module 1122 simulates the virtual input and output device 1122d, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the input and output functions of the input and output device. For another example, the virtual machine hardware simulation module 1122 simulates the virtual bus 1122e, which means that the virtual machine hardware simulation module 1122 provides the virtual machine with the function of transferring information between the virtual processor 1122a, the virtual memory 1122b and the virtual input/output device 1122d.
可选地,虚拟内存1122b包括向虚拟处理器1122a分配的处理器内存,还包括虚拟显存。虚拟主板芯片1122c包括虚拟总线1122e主桥芯片、虚拟总线1122e南桥芯片和虚拟总线1122e北桥芯片等。虚拟输入输出设备1122d包括虚拟鼠标和虚拟键盘等。虚拟总线1122e的类型可以根据虚拟机的应用需求确定。例如,虚拟总线1122e可以为虚拟PCIe总线、CXL总线、PCI总线或ISA总线等。Optionally, the virtual memory 1122b includes processor memory allocated to the virtual processor 1122a, and also includes virtual video memory. The virtual motherboard chip 1122c includes a virtual bus 1122e main bridge chip, a virtual bus 1122e south bridge chip, a virtual bus 1122e north bridge chip, and the like. The virtual input and output devices 1122d include a virtual mouse, a virtual keyboard, and the like. The type of the virtual bus 1122e may be determined according to the application requirements of the virtual machine. For example, the virtual bus 1122e may be a virtual PCIe bus, a CXL bus, a PCI bus, an ISA bus, or the like.
需要说明的是,以上虚拟机的硬件的内容仅为对虚拟机硬件模拟模块1122模拟的虚拟机的硬件的举例,不用于限定虚拟机硬件模拟模块1122模拟的虚拟机的硬件的种类,该虚拟机硬件模拟模块1122模拟的虚拟机的硬件的种类可以根据虚拟机的应用需求进行调整。It should be noted that the above content of the hardware of the virtual machine is only an example of the hardware of the virtual machine simulated by the virtual machine hardware simulation module 1122, and is not used to limit the type of hardware of the virtual machine simulated by the virtual machine hardware simulation module 1122. The type of hardware of the virtual machine simulated by the machine hardware simulation module 1122 can be adjusted according to the application requirements of the virtual machine.
在本申请实施例提供的虚拟机模拟器112中,由于虚拟机管理代理子模块1121a和虚拟机硬件模拟模块1122部署在服务器11上,虚拟机管理子模块1121b部署在卸载卡12上,而针对虚拟机的管理功能需要通过虚拟机VM、虚拟机管理代理子模块1121a和虚拟机管理子模块1121b协同合作才能实现。例如,在针对虚拟机的一些功能中,虚拟机管理子模块1121b需要从虚拟机VM的存储资源中获取数据,并根据获取的数据执行相应的操作。In the virtual machine simulator 112 provided in the embodiment of the present application, since the virtual machine management agent sub-module 1121a and the virtual machine hardware simulation module 1122 are deployed on the server 11, and the virtual machine management sub-module 1121b is deployed on the uninstall card 12, the The management function of the virtual machine can only be realized through the cooperation of the virtual machine VM, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b. For example, in some functions for virtual machines, the virtual machine management sub-module 1121b needs to acquire data from the storage resources of the virtual machine VM, and perform corresponding operations according to the acquired data.
服务器11和卸载卡12建立有连接通道,虚拟机管理代理子模块1121a能够通过该连接通道与虚拟机管理子模块1121b进行通信,以便于虚拟机管理代理子模块1121a将从虚拟机的存储资源中获取的数据传输给虚拟机管理子模块1121b。并且,为了减小获取数据的开销对服务器资源的占用,可以基于该连接通道建立至少两条通过软件实现的通信通道。A connection channel is established between the server 11 and the uninstall card 12, and the virtual machine management agent sub-module 1121a can communicate with the virtual machine management sub-module 1121b through the connection channel, so that the virtual machine management agent sub-module 1121a can access the storage resources of the virtual machine from the virtual machine management agent sub-module 1121a. The acquired data is transmitted to the virtual machine management sub-module 1121b. Moreover, in order to reduce the occupation of server resources due to the overhead of acquiring data, at least two communication channels implemented by software may be established based on the connection channel.
在一种可实现方式中,该至少两条通过软件实现的通信通道包括:地址获取通道和DMA通道。该地址获取通道用于供虚拟机管理代理子模块1121a向虚拟机管理子模块1121b发送数据在虚拟内存中的存储地址。该存储地址可以通过给数据的首地址和偏移量表示。可选地,虚拟机管理代理子模块1121a与虚拟机管理子模块1121b之间的地址获取通道可以为套接字(socket)连接通道(如vsock通道)。该DMA通道用于供虚拟机管理子模块1121b基于数据在虚拟内存中的存储地址,通过DMA方式从虚拟内存中获取所需的数据。In an implementation manner, the at least two communication channels implemented by software include: an address acquisition channel and a DMA channel. The address acquisition channel is used for the virtual machine management agent sub-module 1121a to send the storage address of the data in the virtual memory to the virtual machine management sub-module 1121b. The storage address can be represented by the first address and offset for the data. Optionally, the address acquisition channel between the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b may be a socket connection channel (such as a vsock channel). The DMA channel is used for the virtual machine management sub-module 1121b to obtain the required data from the virtual memory through DMA based on the storage address of the data in the virtual memory.
数据在虚拟内存中的存储地址属于控制面信息,由于控制面信息的数据量较小,通过地址获取通道传输控制面信息,能够有效减小传输控制面信息的开销对服务器资源的占用。并且,通过DMA方式从虚拟内存中获取数据,由于DMA方式能够允许外部设备和存储资源之间直接进行数据传送,使得数据传送过程中不需要CPU的参与,能够有效减小从存储资源中获取数据对服务器资源的占用。The storage address of the data in the virtual memory belongs to the control plane information. Since the data amount of the control plane information is small, the transmission of the control plane information through the address acquisition channel can effectively reduce the overhead of transmitting the control plane information and the occupation of server resources. In addition, data is obtained from virtual memory through DMA. Since DMA allows direct data transfer between external devices and storage resources, the CPU does not need to be involved in the data transfer process, which can effectively reduce the need to obtain data from storage resources. Occupation of server resources.
例如,虚拟机管理子模块1121b与虚拟机管理代理子模块1121a之间设置有vsock通道。在实现VNC功能时,虚拟机管理子模块1121b与VNC客户端建立有连接。在需要获取显存数据时,虚拟机管理子模块1121b可以通过该vsock通道向虚拟机管理代理子模块1121a发送地址获取请求。虚拟机管理代理子模块1121a可以根据该地址获取请求获取显存数据在虚拟机的虚拟显存中的地址,然后通过该vsock通道向虚拟机管理子模块1121b发送该地址。然后,虚拟机管理子模块1121b根据该地址通过DMA方式从虚拟机的虚拟显存中获取显存数据,并将该显存数据发送至VNC客户端。其中,实现VNC功能是指VNC客户端从虚拟机的虚拟显存中获取显存数据,根据该显存数据在该VNC客户端上进行显示,然后根据显示的内容对虚拟机进行远程控制。For example, a vsock channel is set between the virtual machine management sub-module 1121b and the virtual machine management agent sub-module 1121a. When implementing the VNC function, the virtual machine management submodule 1121b establishes a connection with the VNC client. When the video memory data needs to be acquired, the virtual machine management sub-module 1121b may send an address acquisition request to the virtual machine management agent sub-module 1121a through the vsock channel. The virtual machine management agent sub-module 1121a can obtain the address of the video memory data in the virtual video memory of the virtual machine according to the address obtaining request, and then sends the address to the virtual machine management sub-module 1121b through the vsock channel. Then, the virtual machine management sub-module 1121b obtains video memory data from the virtual video memory of the virtual machine through DMA according to the address, and sends the video memory data to the VNC client. The implementation of the VNC function means that the VNC client obtains video memory data from the virtual video memory of the virtual machine, displays the video memory data on the VNC client, and then remotely controls the virtual machine according to the displayed content.
在一种可实现方式中,如图5所示,该VNC功能的具体实现过程可以包括以下步骤:In an achievable manner, as shown in FIG. 5 , the specific implementation process of the VNC function may include the following steps:
步骤S1、在虚拟机启动后,虚拟机管理代理子模块1121a和虚拟机管理子模块1121b开始运行,服务器11中拉起管理代理主线程,卸载卡12中拉起vsk_iothread线程和vnc_worker线程,并在vsk_iothread线程与管理代理主线程之间建立vsock通道。其中,虚拟机管理代理子模块1121a的功能通过服务器11中的管理代理主线程实现,虚拟机管理子模块1121b的功能通过vsk_iothread线程和vnc_worker线程实现,且虚拟内存1122b中分配有虚拟显存vga.vram。Step S1, after the virtual machine is started, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b start to run, the server 11 pulls up the management agent main thread, the unload card 12 pulls up the vsk_iothread thread and the vnc_worker thread, and in the A vsock channel is established between the vsk_iothread thread and the management agent main thread. Among them, the function of the virtual machine management agent sub-module 1121a is implemented by the management agent main thread in the server 11, the function of the virtual machine management sub-module 1121b is implemented by the vsk_iothread thread and the vnc_worker thread, and the virtual memory 1122b is allocated with a virtual video memory vga.vram .
步骤S2、vnc_worker线程监听VNC客户端发送的连接请求,该连接请求携带有VNC客户端的互联网协议地址(internet protocol,IP)地址和端口地址。In step S2, the vnc_worker thread monitors a connection request sent by the VNC client, where the connection request carries an internet protocol (IP) address and a port address of the VNC client.
步骤S3、vnc_worker线程根据VNC客户端的IP地址和端口地址,建立与VNC客户端的通信连接,并启动虚拟机管理子模块1121b中的定时器。Step S3, the vnc_worker thread establishes a communication connection with the VNC client according to the IP address and port address of the VNC client, and starts the timer in the virtual machine management sub-module 1121b.
步骤S4、vsk_iothread线程在定时器的触发下,通过vsock通道向管理代理主线程发送地址获取请求。In step S4, the vsk_iothread thread sends an address acquisition request to the management agent main thread through the vsock channel under the trigger of the timer.
步骤S5、虚拟机管理代理子模块1121a中的管理代理主线程监听通过vsock通道发送的消息,接收到地址获取请求后对该地址获取请求进行解析,然后根据解析内容查询虚拟显存vga.vram,以得到显存数据在虚拟显存中的地址,并通过vsock通道向vsk_iothread线程发送查询到的显存地址。其中,虚拟机的操作系统用于根据虚拟机的运行状态更新虚拟显存中的显存数据。Step S5, the management agent main thread in the virtual machine management agent sub-module 1121a monitors the message sent through the vsock channel, parses the address acquisition request after receiving the address acquisition request, and then queries the virtual video memory vga.vram according to the parsed content to obtain Get the address of the video memory data in the virtual video memory, and send the queried video memory address to the vsk_iothread thread through the vsock channel. The operating system of the virtual machine is used to update the video memory data in the virtual video memory according to the running state of the virtual machine.
其中,显存数据在虚拟显存中的地址可以通过虚拟显存的物理地址、脏页位图和图像脏位图等信息反映。并且,虚拟机管理代理子模块1121a中还模拟有VGA虚拟设备,在实现VNC功能时,显存数据可以存储在分配给VGA虚拟设备的显存内存中,相应的,在查询显存地址时,可以通过查询显存数据在分配给VGA虚拟设备的显存内存中的地址实现。另外,当虚拟机分别工作在图形模式和文本模式时,该地址的表示形式稍有不同。图形模式下,地址通过VGA显存物理地址,显存脏页位图以及图像脏页位图等信息表示。文本模式下,地址通过编码结果存储的物理地址和图像脏页位图等信息表示。同时,为便于VNC客户端能够根据显存数据进行正确的显示,在获取显存数据在虚拟显存中的地址外,还需要获取显存数据的基本组成信息,例如,在图形模式下,还需要获取图像的基本组成信息。脏页是指内存中已更新内容但该更新的内容还未刷新到磁盘中的页。The address of the video memory data in the virtual video memory can be reflected by information such as the physical address of the virtual video memory, a dirty page bitmap, an image dirty bitmap, and the like. In addition, the virtual machine management agent sub-module 1121a also simulates a VGA virtual device. When implementing the VNC function, the video memory data can be stored in the video memory memory allocated to the VGA virtual device. Correspondingly, when querying the video memory address, you can query The video memory data is implemented at the address in the video memory memory allocated to the VGA virtual device. In addition, when the virtual machine works in graphics mode and text mode respectively, the representation of this address is slightly different. In graphics mode, the address is represented by the VGA memory physical address, memory dirty page bitmap and image dirty page bitmap and other information. In text mode, the address is represented by information such as the physical address stored in the encoding result and the image dirty page bitmap. At the same time, in order to facilitate the VNC client to display correctly according to the video memory data, in addition to obtaining the address of the video memory data in the virtual video memory, it is also necessary to obtain the basic composition information of the video memory data. For example, in the graphics mode, it is also necessary to obtain the image Basic composition information. Dirty pages are pages that have updated content in memory but have not yet been flushed to disk.
步骤S6、vsk_iothread线程将从vsock通道获取到的显存地址发送给vnc_worker线程。Step S6, the vsk_iothread thread sends the video memory address obtained from the vsock channel to the vnc_worker thread.
步骤S7、vnc_worker线程根据接收到的显存地址,通过DMA方式从虚拟显存中获取显存数据。Step S7, the vnc_worker thread obtains the video memory data from the virtual video memory by means of DMA according to the received video memory address.
另外,在vnc_worker线程根据显存地址获取显存数据之前,还需要根据显存数据的基本组成信息,做申请用于存储获取的显存数据的内存空间等准备工作。In addition, before the vnc_worker thread obtains the video memory data according to the video memory address, it also needs to do preparations such as applying for the memory space for storing the obtained video memory data according to the basic composition information of the video memory data.
骤S8、vnc_worker线程对获取到的显存数据进行编码,并向VNC客户端发送编码后的显存数据。In step S8, the vnc_worker thread encodes the acquired video memory data, and sends the encoded video memory data to the VNC client.
骤S9、VNC客户端根据接收到的显存数据进行显示,并根据显示的图像对虚拟机进行远程控制。In step S9, the VNC client performs display according to the received video memory data, and remotely controls the virtual machine according to the displayed image.
VNC功能的实现场景有多种,下面以在VNC客户端上通过鼠标和键盘进行输入,以实现对虚拟机的远程控制这种实现场景为例,对其实现过程进行说明,图6为本申请实施例提供的一种该实现场景的实现过程示意图。There are various implementation scenarios of the VNC function. The following takes inputting through the mouse and keyboard on the VNC client to realize the remote control of the virtual machine as an example to describe the implementation process. Figure 6 is the application A schematic diagram of an implementation process of the implementation scenario provided by the embodiment.
如图6所示,为响应于VNC客户端上鼠标和键盘的输入操作,虚拟机硬件模拟模块1122模拟的虚拟输入输出设备包括虚拟鼠标和虚拟键盘,且虚拟机管理子模块1121b中配置有该鼠标和键盘的影子设备。当VNC客户端上的鼠标或键盘输入信息后,VNC客户端会将该输入事件传递至vnc_worker线程,vnc_worker线程再将该输入事件传递至卸载卡12中的控制台。该控制台根据该输入事件确定该输入事件由鼠标产生还是由键盘产生,然后向vnc_worker线程反馈产生该输入事件的标识。vnc_worker线程将该标识发送至影子设备,影子设备记录该标识,并向vsk_iothread线程发送该标识和输入的信息。vsk_iothread线程通过vsock通道将该标识和输入的信息发送至管理代理主线程。管理代理主线程根据该标识将输入的信息发送至对应的虚拟输入输出设备1122d,即当标识指示键盘时,将该输入信息发送至虚拟键盘,当该标识指示鼠标时,将该输入信息发送至虚拟鼠标。然后,对应的输入输出设备根据该输 入信息执行相关的输入操作,并通过中断信号向虚拟机的操作系统发送该输入操作的结果,使得操作系统根据该输入操作的结果更新显存。然后,管理代理主线程获取更新的显存的地址,并通过vsock通道向vsk_iothread线程发送更新的显存的地址,以便于vnc_worker线程根据该地址获取更新的显存数据,并将该更新的显存数据发送至VNC客户端,以在VNC客户端上显示因输入操作产生的结果。其中,卸载卡12从接收到输入信息到向服务器11发送信息的过程,可视为卸载卡12对VNC客户端的输入信息进行封装并改造成远程调用事件,然后通过对应的影子设备注册的回调和vsock通道,将远程调用事件发送到服务器11的过程。服务器11从接收vsk_iothread线程通过vsock通道发送的信息到根据操作结果更新显存的过程,可视为服务器11将远程调用事件反向解析,并根据解析得到的内容中标识找到设备调用对应的事件处理函数进行处理的过程。As shown in FIG. 6, in response to the input operation of the mouse and the keyboard on the VNC client, the virtual input and output devices simulated by the virtual machine hardware simulation module 1122 include a virtual mouse and a virtual keyboard, and the virtual machine management sub-module 1121b is configured with the virtual input and output devices. Shadow devices for mouse and keyboard. After the mouse or keyboard on the VNC client inputs information, the VNC client will transmit the input event to the vnc_worker thread, and the vnc_worker thread will then transmit the input event to the console in the offload card 12 . The console determines whether the input event is generated by the mouse or the keyboard according to the input event, and then feeds back the identification of the input event to the vnc_worker thread. The vnc_worker thread sends the identification to the shadow device, the shadow device records the identification, and sends the identification and the input information to the vsk_iothread thread. The vsk_iothread thread sends the identification and input information to the management agent main thread through the vsock channel. The management agent main thread sends the input information to the corresponding virtual input and output device 1122d according to the identification, that is, when the identification indicates a keyboard, the input information is sent to the virtual keyboard, and when the identification indicates a mouse, the input information is sent to virtual mouse. Then, the corresponding input and output device performs the relevant input operation according to the input information, and sends the result of the input operation to the operating system of the virtual machine through an interrupt signal, so that the operating system updates the video memory according to the result of the input operation. Then, the management agent main thread obtains the updated video memory address, and sends the updated video memory address to the vsk_iothread thread through the vsock channel, so that the vnc_worker thread can obtain the updated video memory data according to the address, and send the updated video memory data to VNC client to display the result of the input operation on the VNC client. The process from receiving the input information to sending the information to the server 11 by the uninstall card 12 can be regarded as the uninstall card 12 encapsulates the input information of the VNC client and transforms it into a remote call event, and then registers the callback and the corresponding shadow device through the corresponding shadow device. vsock channel, the process of sending remote invocation events to server 11. The process from the server 11 receiving the information sent by the vsk_iothread thread through the vsock channel to updating the video memory according to the operation result can be regarded as the server 11 reversely analysing the remote call event, and finding the corresponding event processing function of the device call according to the identifier in the content obtained by the analysis process of processing.
需要说明的是,虚拟机涉及的需要通过虚拟机、虚拟机管理代理子模块1121a和虚拟机管理子模块1121b协同合作实现的功能有多种,本申请实施例未对其进行一一列举。但应理解的是,在实现需要虚拟机、虚拟机管理代理子模块1121a和虚拟机管理子模块1121b协同合作实现的功能时,其实现过程可以相应参考前述VNC功能的实现过程,此处对其不再一一赘述。It should be noted that there are various functions involved in the virtual machine that need to be implemented through the cooperation of the virtual machine, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b, which are not listed one by one in the embodiments of the present application. However, it should be understood that, when implementing the functions that require the cooperation of the virtual machine, the virtual machine management agent sub-module 1121a and the virtual machine management sub-module 1121b, the implementation process can refer to the implementation process of the aforementioned VNC function. I won't repeat them one by one.
可选地,如图4所示,卸载卡12可以通过网卡13与存储资源和/或网络资源连接,以便于卸载卡12能将服务器11中运行的虚拟机的I/O请求发送至存储资源和/或网络资源进行处理。例如,卸载卡12上配置有网卡13,卸载卡12能够通过该网卡13与云数据中心中的存储资源和网络资源连接。Optionally, as shown in FIG. 4 , the offload card 12 can be connected to the storage resource and/or the network resource through the network card 13, so that the offload card 12 can send the I/O request of the virtual machine running in the server 11 to the storage resource. and/or network resources for processing. For example, the offload card 12 is configured with a network card 13 , and the offload card 12 can be connected to storage resources and network resources in the cloud data center through the network card 13 .
在一种可实现方式中,如图4所示,卸载卡12中还部署有服务器管理模块113,该服务器管理模块113用于对服务器系统1的运行状态进行管理。例如,服务器管理模块113用于对虚拟化平台进行管理(如实现libvirt的功能),负责维护和管理虚拟机的计算资源(如实现Nova的功能),以及负责服务器11中系统安装、升级、部署和运维相关的功能。In an implementation manner, as shown in FIG. 4 , a server management module 113 is also deployed in the uninstall card 12 , and the server management module 113 is used to manage the running state of the server system 1 . For example, the server management module 113 is used to manage the virtualization platform (such as implementing the functions of libvirt), be responsible for maintaining and managing the computing resources of the virtual machine (such as implementing the functions of Nova), and be responsible for system installation, upgrade, and deployment in the server 11 functions related to operation and maintenance.
另外,当服务器系统1部署在云数据中心中时,服务器管理模块113还用于接收云管理平台2发送的管理面操作请求,并根据该管理面操作请求执行相应的操作。该管理面操作请求可以为云管理平台2对虚拟机进行管理发送的请求,也可以为用户通过云管理平台2对虚拟机进行管理发送的请求。In addition, when the server system 1 is deployed in the cloud data center, the server management module 113 is further configured to receive a management plane operation request sent by the cloud management platform 2, and perform corresponding operations according to the management plane operation request. The management plane operation request may be a request sent by the cloud management platform 2 to manage the virtual machine, or may be a request sent by the user to manage the virtual machine through the cloud management platform 2 .
通过服务器管理模块113接收管理面操作请求并执行相应的操作,使得无需由服务器11接收该管理面操作请求并执行相应的操作,减小了因接收管理面请求并执行相应操作对服务器资源的开销,能够进行一步保证虚拟机的业务性能。The management plane operation request is received by the server management module 113 and the corresponding operation is performed, so that the server 11 does not need to receive the management plane operation request and perform the corresponding operation, thereby reducing the overhead of server resources due to receiving the management plane request and performing the corresponding operation. , which can further ensure the service performance of the virtual machine.
综上所述,在本申请实施例提供的服务器系统中,通过将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,并将虚拟机管理子模块部署在卸载卡上,实现了将虚拟机模拟器中对服务器资源消耗较大的功能部署在卸载卡中,减少了虚拟机模拟器本身的开销对服务器资源的占用,减小了虚拟机模拟器本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。并且,将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,对虚拟机的业务性能(如对虚拟处理器的调度性能和虚拟机的I/O读写性能)也不会产生副作用,因此具有较好的应用前景。To sum up, in the server system provided by the embodiments of the present application, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed on the uninstall card , realizes that the functions that consume more server resources in the virtual machine emulator are deployed in the uninstall card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead and performance of the virtual machine emulator itself. The virtual machine provided by the user effectively guarantees the business performance of the virtual machine due to the influence of competing resources on the business performance of the virtual machine. In addition, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
本申请实施例还提供了一种虚拟机创建方法。该虚拟机创建方法应用于本申请实施例提供的服务器系统,该服务器系统包括服务器和插置于服务器的卸载卡,服务器和卸载卡建立有连接通道。可选地,卸载卡中还部署有服务器管理模块。并且,卸载卡通过网卡与存储资 源和/或网络资源连接。进一步地,服务器与卸载卡可以通过总线连接,例如通过虚拟高速外围组件互联PCIe总线连接。The embodiment of the present application also provides a method for creating a virtual machine. The method for creating a virtual machine is applied to the server system provided by the embodiment of the present application. The server system includes a server and an offload card inserted in the server, and a connection channel is established between the server and the offload card. Optionally, a server management module is also deployed in the uninstall card. Also, the offload card is connected to storage resources and/or network resources through a network card. Further, the server and the offload card may be connected through a bus, for example, a PCIe bus through a virtual high-speed peripheral component interconnection.
如图7所示,该虚拟机创建方法包括:As shown in Figure 7, the virtual machine creation method includes:
步骤701、服务器接收云平台发送的虚拟机创建请求。Step 701: The server receives a virtual machine creation request sent by the cloud platform.
在用户需要使用虚拟机实现业务时,用户可以在客户端上操作,该操作会触发向云管理平台发送用于请求创建虚拟机的虚拟机创建请求,且云管理平台会向服务器发送该虚拟机创建请求。When a user needs to use a virtual machine to implement services, the user can operate on the client, and the operation will trigger a virtual machine creation request to be sent to the cloud management platform for requesting the creation of a virtual machine, and the cloud management platform will send the virtual machine to the server. Create a request.
虚拟机创建请求中携带有虚拟机的配置需求。该虚拟机的配置需求用于指示请求创建的虚拟机的规格。并且,由于虚拟机需要基于虚拟机模拟器提供的虚拟机的硬件运行,因此配置需求指示的可以是虚拟机运行所需的虚拟机的硬件的规格。例如,配置需求指示的虚拟机的硬件的规格可以包括:虚拟处理器的总数、虚拟处理器的拓扑结构、虚拟处理器的类型、虚拟内存的数量、虚拟内存的使用策略、虚拟内存插槽的设置方式、虚拟输入输出设备的类型、虚拟输入输出设备的规格、虚拟机的操作系统的镜像文件的存放路径、虚拟机用于实现业务的应用程序的镜像文件的存放路径、虚拟机的操作系统的初始化参数的配置信息等规格参数。The virtual machine creation request carries the configuration requirements of the virtual machine. The configuration requirements for this virtual machine are used to indicate the specifications of the virtual machine requested to be created. Moreover, since the virtual machine needs to run based on the hardware of the virtual machine provided by the virtual machine simulator, the configuration requirement may indicate the specifications of the hardware of the virtual machine required for the virtual machine to run. For example, the hardware specifications of the virtual machine indicated by the configuration requirements may include: the total number of virtual processors, the topology of virtual processors, the type of virtual processors, the amount of virtual memory, the usage policy of virtual memory, the number of virtual memory slots Setting method, type of virtual input and output device, specification of virtual input and output device, storage path of the image file of the operating system of the virtual machine, storage path of the image file of the application program used by the virtual machine to realize the business, and the operating system of the virtual machine Specification parameters such as configuration information of initialization parameters.
其中,虚拟处理器的拓扑结构用于指示虚拟机需要使用的虚拟处理器的总数、每个虚拟处理器包括的虚拟内核的总数、及每个虚拟处理器包括的超线程的总数中的一个或多个。虚拟处理器的类型用于指示该虚拟处理器的字长和型号等。虚拟处理器的字长是虚拟处理器一次能并行处理的二进制位数。虚拟内存的使用策略用于指示虚拟机使用的多个虚拟处理器使用虚拟内存的方式。例如,该虚拟内存的使用策略用于指示虚拟机使用的多个虚拟CPU按照非统一内存访问(non uniform memory access,NUMA)方式使用虚拟内存。虚拟输入输出设备的规格用于指示虚拟输入输出设备的配置规格。例如,当虚拟输入输出设备为虚拟网卡时,该虚拟网卡的规格指示该虚拟网卡的队列的描述信息和媒体访问控制(media access control,MAC)地址等信息。当虚拟输入输出设备为虚拟磁盘时,该虚拟磁盘的规格指示该虚拟磁盘的容量等信息。虚拟机的操作系统的镜像文件用于记载操作系统与虚拟机的硬件之间进行交互的相关信息。虚拟机用于实现业务的应用程序的镜像文件用于记载在虚拟机的操作系统的基础上运行的用于实现业务的应用程序与该虚拟机的操作系统之间进行交互的相关信息。例如,当虚拟机的操作系统为LINUX系统时,虚拟机的操作系统的镜像文件可以为kernel镜像文件,虚拟机用于实现业务的应用程序的镜像文件可以为initrd镜像文件。The topology of the virtual processors is used to indicate one or more of the total number of virtual processors that the virtual machine needs to use, the total number of virtual cores included in each virtual processor, and the total number of hyperthreads included in each virtual processor. multiple. The type of virtual processor is used to indicate the word length and model of the virtual processor. The word size of a virtual processor is the number of bits that the virtual processor can process in parallel at a time. The virtual memory usage policy is used to indicate how virtual memory is used by multiple virtual processors used by the virtual machine. For example, the virtual memory usage policy is used to instruct multiple virtual CPUs used by the virtual machine to use the virtual memory in a non-uniform memory access (NUMA) manner. The specification of the virtual input/output device is used to indicate the configuration specification of the virtual input/output device. For example, when the virtual input and output device is a virtual network card, the specification of the virtual network card indicates information such as the description information of the queue of the virtual network card and the media access control (media access control, MAC) address and other information. When the virtual input/output device is a virtual disk, the specification of the virtual disk indicates information such as the capacity of the virtual disk. The image file of the operating system of the virtual machine is used to record information related to the interaction between the operating system and the hardware of the virtual machine. The image file of the application program used by the virtual machine to implement the service is used to record the relevant information about the interaction between the application program used to implement the service and the operating system of the virtual machine running on the basis of the operating system of the virtual machine. For example, when the operating system of the virtual machine is a LINUX system, the image file of the operating system of the virtual machine may be a kernel image file, and the image file of an application program used by the virtual machine to implement services may be an initrd image file.
步骤702、服务器根据虚拟机创建请求在服务器中创建虚拟机,启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块。Step 702: The server creates a virtual machine in the server according to the virtual machine creation request, starts the virtual machine management agent sub-module set in the server, and starts the virtual machine management sub-module set in the uninstall card through the connection channel.
服务器中的VMM接收到虚拟机创建请求后,会根据该虚拟机创建请求拉起虚拟机硬件模拟模块,并使用虚拟机硬件模拟模块按照虚拟机创建请求指示的虚拟机的配置需求,根据服务器的硬件模拟虚拟机的硬件。并且,VMM还会启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块,以便于通过虚拟机管理代理子模块和虚拟机管理子模块实现虚拟机的管理功能。After the VMM in the server receives the virtual machine creation request, it will pull up the virtual machine hardware simulation module according to the virtual machine creation request, and use the virtual machine hardware simulation module according to the configuration requirements of the virtual machine indicated by the virtual machine creation request. Hardware emulates the hardware of a virtual machine. In addition, the VMM will also start the virtual machine management agent sub-module set in the server, and start the virtual machine management sub-module set in the uninstall card through the connection channel, so as to facilitate the virtual machine management agent sub-module and the virtual machine management sub-module through the virtual machine management sub-module. Implements virtual machine management functions.
可选地,虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。例如,虚拟机硬件模拟模块可以根据配置需求指示的虚拟处理器的总数、虚拟处理器的拓扑结构、虚拟处理器的类型、虚拟内存的数量、虚拟内存的使用策略、虚拟内存插槽的设置方式、虚拟输入输出设备的类型和虚拟输入输出设备的规格等与虚拟机的硬件相关的规格参数,模拟虚拟机的硬件。Optionally, the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus. For example, the virtual machine hardware emulation module can indicate the total number of virtual processors, the topology of virtual processors, the type of virtual processors, the amount of virtual memory, the usage policy of virtual memory, and the setting method of virtual memory slots according to the configuration requirements. , the type of virtual input and output devices and the specifications of virtual input and output devices and other specifications related to the hardware of the virtual machine, to simulate the hardware of the virtual machine.
可选地,虚拟机管理子模块还用于通过连接通道以直接存储器访问DMA方式从服务器的内存中访问虚拟机的数据。Optionally, the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
可选地,虚拟机的管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。Optionally, the management function of the virtual machine includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
可选地,服务器与卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。Optionally, the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
综上所述,在本申请实施例提供的虚拟机创建方法中,通过将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,并将虚拟机管理子模块部署在卸载卡上,实现了将虚拟机模拟器中对服务器资源消耗较大的功能部署在卸载卡中,减少了虚拟机模拟器本身的开销对服务器资源的占用,减小了虚拟机模拟器本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。并且,将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,对虚拟机的业务性能(如对虚拟处理器的调度性能和虚拟机的I/O读写性能)也不会产生副作用,因此具有较好的应用前景。To sum up, in the virtual machine creation method provided by the embodiments of the present application, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed in the uninstaller. On the card, the functions that consume more server resources in the virtual machine emulator are deployed in the unloading card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead of the virtual machine emulator itself. The business performance of the virtual machine is effectively guaranteed due to the impact of competing resources with the virtual machine that provides services to the user on the business performance of the virtual machine. In addition, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
需要说明的是,本申请实施例提供的虚拟机创建方法的步骤先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。It should be noted that, the sequence of steps of the method for creating a virtual machine provided by the embodiment of the present application may be adjusted appropriately, and the steps may be correspondingly increased or decreased according to the situation. Any person skilled in the art who is familiar with the technical scope disclosed in the present application can easily think of any variation of the method, which should be covered by the protection scope of the present application, and thus will not be repeated here.
并且,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的虚拟机创建方法的实现过程及其相关内容,可以参考前述服务器系统实施例中的对应内容,在此不再赘述。Moreover, those skilled in the art can clearly understand that, for the convenience and brevity of description, the implementation process of the above-described virtual machine creation method and its related content can refer to the corresponding content in the foregoing server system embodiment, which is not described here. Repeat.
本申请提供了一种虚拟机创建装置,该虚拟机创建装置应用于服务器,服务器上插置有卸载卡,服务器和卸载卡建立有连接通道,如图8所示,该虚拟机创建装置80包括:The present application provides an apparatus for creating a virtual machine, the apparatus for creating a virtual machine is applied to a server, an uninstall card is inserted on the server, and a connection channel is established between the server and the uninstall card. As shown in FIG. 8 , the apparatus 80 for creating a virtual machine includes: :
接收模块801,用于接收云管理平台发送的虚拟机创建请求。The receiving module 801 is configured to receive a virtual machine creation request sent by the cloud management platform.
处理模块802,用于根据虚拟机创建请求在服务器中创建虚拟机,启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块。The processing module 802 is configured to create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine management sub-module set in the uninstall card through the connection channel.
其中,虚拟机通过虚拟机模拟器实现,虚拟机模拟器包括虚拟机管理模块,虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块,虚拟机管理代理子模块通过连接通道与虚拟机管理子模块进行通信,虚拟机管理子模块用于实现虚拟机的管理功能。The virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management agent sub-module communicates with the virtual machine through a connection channel The virtual machine management sub-module is used for communication, and the virtual machine management sub-module is used to realize the management function of the virtual machine.
可选地,虚拟机模拟器还包括虚拟机硬件模拟模块,虚拟机硬件模拟模块设置在服务器中,虚拟机硬件模拟模块用于根据服务器的硬件模拟虚拟机的硬件。Optionally, the virtual machine simulator further includes a virtual machine hardware simulation module, the virtual machine hardware simulation module is set in the server, and the virtual machine hardware simulation module is used to simulate the hardware of the virtual machine according to the hardware of the server.
可选地,虚拟机管理子模块还用于通过连接通道以直接存储器访问DMA方式从服务器的内存中访问虚拟机的数据。Optionally, the virtual machine management sub-module is further configured to access data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel.
可选地,虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。Optionally, the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
可选地,管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。Optionally, the management function includes: one or any combination of a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function and a parameter parsing function.
可选地,服务器与卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。Optionally, the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
综上所述,在本申请实施例提供的虚拟机创建装置中,通过将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,并将虚拟机管理子模块部署在卸载卡上,实现了将虚拟机模拟器中对服务器资源消耗较大的功能部署在卸载卡中,减少了虚拟机模拟器本身 的开销对服务器资源的占用,减小了虚拟机模拟器本身的开销与为用户提供服务的虚拟机因竞争资源对虚拟机业务性能的影响,有效地保证了虚拟机的业务性能。并且,将虚拟机管理模块拆分为虚拟机管理代理子模块和虚拟机管理子模块,对虚拟机的业务性能(如对虚拟处理器的调度性能和虚拟机的I/O读写性能)也不会产生副作用,因此具有较好的应用前景。To sum up, in the virtual machine creation apparatus provided by the embodiments of the present application, the virtual machine management module is split into a virtual machine management agent sub-module and a virtual machine management sub-module, and the virtual machine management sub-module is deployed in the uninstaller. On the card, the functions that consume more server resources in the virtual machine emulator are deployed in the unloading card, which reduces the occupation of server resources by the overhead of the virtual machine emulator itself, and reduces the overhead of the virtual machine emulator itself. The business performance of the virtual machine is effectively guaranteed due to the impact of competing resources with the virtual machine that provides services to the user on the business performance of the virtual machine. In addition, the virtual machine management module is divided into a virtual machine management agent sub-module and a virtual machine management sub-module, and the business performance of the virtual machine (such as the scheduling performance of the virtual processor and the I/O read and write performance of the virtual machine) is also It will not produce side effects, so it has a good application prospect.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的虚拟机创建装置及模块的工作原理,可以参考前述服务器系统实施例中的对应内容,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the working principle of the virtual machine creation device and module described above can be referred to the corresponding content in the foregoing server system embodiment, which is not repeated here.
本申请实施例提供了一种计算机设备。图9示例性的提供了计算机设备的一种可能的架构图。如图9所示,该计算机设备90可以包括处理器901、存储器902、通信接口903和总线904。在计算机设备中,处理器901的数量可以是一个或多个,图9仅示意了其中一个处理器901。可选的,处理器901可以是中央处理器(Central Processing Unit,CPU)。若计算机设备具有多个处理器901,多个处理器901的类型可以不同,或者可以相同。可选的,计算机设备的多个处理器还可以集成为多核处理器。The embodiments of the present application provide a computer device. FIG. 9 exemplarily provides a possible architectural diagram of a computer device. As shown in FIG. 9 , the computer device 90 may include a processor 901 , a memory 902 , a communication interface 903 and a bus 904 . In a computer device, the number of processors 901 may be one or more, and FIG. 9 only illustrates one of the processors 901 . Optionally, the processor 901 may be a central processing unit (Central Processing Unit, CPU). If the computer device has multiple processors 901, the multiple processors 901 may be of different types, or may be the same. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
存储器902存储计算机指令和数据,存储器902可以存储实现本申请提供的虚拟机创建方法所需的计算机指令和数据。存储器902可以是以下存储介质的任一种或任一种组合:非易失性存储器(如只读存储器(Read-Only Memory,ROM)、固态硬盘(Solid State Disk,SSD)、硬盘(Hard Disk Drive,HDD)、光盘等、易失性存储器。The memory 902 stores computer instructions and data, and the memory 902 may store computer instructions and data required to implement the virtual machine creation method provided by the present application. The memory 902 can be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (Read-Only Memory, ROM), solid state disk (Solid State Disk, SSD), hard disk (Hard Disk) Drive, HDD), optical disc, etc., volatile memory.
通信接口903可以是以下器件的任一种或任一种组合:网络接口(如以太网接口)、无线网卡等具有网络接入功能的器件。通信接口903用于计算机设备与其他节点或者其他计算机设备进行数据通信。The communication interface 903 may be any one or any combination of the following devices: a network interface (eg, an Ethernet interface), a wireless network card, and other devices with a network access function. The communication interface 903 is used for data communication between the computer device and other nodes or other computer devices.
图9还示例性地绘制出总线904。总线904可以将处理器901与存储器902、通信接口903连接。这样,通过总线904,处理器901可以访问存储器902,还可以利用通信接口903与其他节点或者其他计算机设备进行数据交互。FIG. 9 also exemplarily depicts bus 904 . The bus 904 can connect the processor 901 with the memory 902 and the communication interface 903 . In this way, through the bus 904, the processor 901 can access the memory 902, and can also use the communication interface 903 to perform data interaction with other nodes or other computer devices.
在本申请中,计算机设备执行存储器902中的计算机指令,可以实现本申请实施例提供的虚拟机创建方法。例如,接收云管理平台发送的虚拟机创建请求;根据虚拟机创建请求在服务器中创建虚拟机,启动设置在服务器中的虚拟机管理代理子模块,并通过连接通道启动设置在卸载卡中的虚拟机管理子模块。并且,计算机设备通过执行存储器902中的计算机指令,执行计算机设备的步骤的实现过程可以相应参考上述方法实施例中对应的描述。In the present application, the computer device executes the computer instructions in the memory 902 to implement the virtual machine creation method provided by the embodiments of the present application. For example, receive a virtual machine creation request sent by the cloud management platform; create a virtual machine in the server according to the virtual machine creation request, start the virtual machine management agent sub-module set in the server, and start the virtual machine set in the uninstall card through the connection channel machine management sub-module. Moreover, by executing the computer instructions in the memory 902 by the computer device, the implementation process of executing the steps of the computer device may refer to the corresponding descriptions in the foregoing method embodiments.
本申请实施例还提供了一种存储介质,该存储介质为非易失性计算机可读存储介质,当存储介质中的指令被处理器执行时,实现如本申请实施例提供的虚拟机创建方法。Embodiments of the present application further provide a storage medium, where the storage medium is a non-volatile computer-readable storage medium. When instructions in the storage medium are executed by a processor, the method for creating a virtual machine provided by the embodiments of the present application is implemented. .
本申请实施例还提供了一种包含指令的计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行本申请实施例提供的虚拟机创建方法。The embodiments of the present application also provide a computer program product containing instructions, when the computer program product is run on a computer, the computer is made to execute the virtual machine creation method provided by the embodiments of the present application.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
在本申请实施例中,术语“第一”、“第二”和“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。术语“至少一个”是指一个或多个,术语“多个”指两个或两个以上,除非另有明确的限定。In the embodiments of the present application, the terms "first", "second" and "third" are only used for description purposes, and cannot be understood as indicating or implying relative importance. The term "at least one" refers to one or more, and the term "plurality" refers to two or more, unless expressly limited otherwise.
本申请中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。The term "and/or" in this application is only an association relationship to describe associated objects, which means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, independently There are three cases of B. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的构思和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the concept and principles of the present application shall be included in the protection of the present application. within the range.

Claims (20)

  1. 一种服务器系统,其特征在于,服务器系统包括服务器和插置于所述服务器的卸载卡,所述服务器和所述卸载卡建立有连接通道;A server system, characterized in that the server system includes a server and an unloading card inserted in the server, and a connection channel is established between the server and the unloading card;
    所述服务器中设置有虚拟机,且所述虚拟机通过虚拟机模拟器实现,所述虚拟机模拟器包括虚拟机管理模块,所述虚拟机管理模块包括虚拟机管理代理子模块和虚拟机管理子模块;The server is provided with a virtual machine, and the virtual machine is implemented by a virtual machine simulator, the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes a virtual machine management agent sub-module and a virtual machine management module submodule;
    所述服务器上部署有所述虚拟机管理代理子模块,所述卸载卡上部署有虚拟机管理子模块,其中,所述虚拟机管理代理子模块通过所述连接通道与所述虚拟机管理子模块进行通信,所述虚拟机管理子模块用于实现所述虚拟机的管理功能。The virtual machine management agent sub-module is deployed on the server, and the virtual machine management sub-module is deployed on the uninstall card, wherein the virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel. module for communication, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
  2. 根据权利要求1所述的系统,其特征在于,所述虚拟机模拟器还包括虚拟机硬件模拟模块,所述虚拟机硬件模拟模块设置在所述服务器中,所述虚拟机硬件模拟模块用于根据所述服务器的硬件模拟所述虚拟机的硬件。The system according to claim 1, wherein the virtual machine simulator further comprises a virtual machine hardware simulation module, the virtual machine hardware simulation module is provided in the server, and the virtual machine hardware simulation module is used for The hardware of the virtual machine is simulated according to the hardware of the server.
  3. 根据权利要求1或2所述的系统,其特征在于,所述虚拟机管理子模块还用于通过所述连接通道以直接存储器访问DMA方式从所述服务器的内存中访问所述虚拟机的数据。The system according to claim 1 or 2, wherein the virtual machine management sub-module is further configured to access the data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel .
  4. 根据权利要求2至3任一项所述的系统,其特征在于,所述虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。The system according to any one of claims 2 to 3, wherein the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  5. 根据权利要求1至4任一项所述的系统,其特征在于,所述管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。The system according to any one of claims 1 to 4, wherein the management functions include: a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function, and a parameter parsing function. one or any combination.
  6. 根据权利要求1至5任一所述的系统,其特征在于,所述服务器与所述卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。The system according to any one of claims 1 to 5, wherein the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  7. 一种虚拟机创建方法,其特征在于,所述方法应用于服务器系统,服务器系统包括服务器和插置于所述服务器的卸载卡,所述服务器和所述卸载卡建立有连接通道,所述方法包括:A method for creating a virtual machine, characterized in that the method is applied to a server system, the server system includes a server and an offload card inserted in the server, and a connection channel is established between the server and the offload card, and the method include:
    所述服务器接收云管理平台发送的虚拟机创建请求;The server receives the virtual machine creation request sent by the cloud management platform;
    所述服务器根据所述虚拟机创建请求在所述服务器中创建虚拟机,启动设置在所述服务器中的虚拟机管理代理子模块,并通过所述连接通道启动设置在所述卸载卡中的虚拟机管理子模块;The server creates a virtual machine in the server according to the virtual machine creation request, starts the virtual machine management agent sub-module set in the server, and starts the virtual machine set in the uninstall card through the connection channel. machine management sub-module;
    其中,所述虚拟机通过虚拟机模拟器实现,所述虚拟机模拟器包括虚拟机管理模块,所述虚拟机管理模块包括所述虚拟机管理代理子模块和所述虚拟机管理子模块,所述虚拟机管理代理子模块通过所述连接通道与所述虚拟机管理子模块进行通信,所述虚拟机管理子模块用于实现所述虚拟机的管理功能。Wherein, the virtual machine is implemented by a virtual machine simulator, and the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes the virtual machine management agent sub-module and the virtual machine management sub-module. The virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
  8. 根据权利要求7所述的方法,其特征在于,所述虚拟机模拟器还包括虚拟机硬件模拟模块,所述虚拟机硬件模拟模块设置在所述服务器中,所述虚拟机硬件模拟模块用于根据所述服务器的硬件模拟所述虚拟机的硬件。The method according to claim 7, wherein the virtual machine simulator further comprises a virtual machine hardware simulation module, the virtual machine hardware simulation module is provided in the server, and the virtual machine hardware simulation module is used for The hardware of the virtual machine is simulated according to the hardware of the server.
  9. 根据权利要求7或8所述的方法,其特征在于,所述虚拟机管理子模块还用于通过所述连接通道以直接存储器访问DMA方式从所述服务器的内存中访问所述虚拟机的数据。The method according to claim 7 or 8, wherein the virtual machine management submodule is further configured to access the data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel .
  10. 根据权利要求8至9任一项所述的方法,其特征在于,所述虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。The method according to any one of claims 8 to 9, wherein the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  11. 根据权利要求7至10任一项所述的方法,其特征在于,所述管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功 能中的一者或任意组合。The method according to any one of claims 7 to 10, wherein the management functions include: a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function, and a parameter parsing function. one or any combination.
  12. 根据权利要求7至11任一所述的方法,其特征在于,所述服务器与所述卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。The method according to any one of claims 7 to 11, wherein the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  13. 一种虚拟机创建装置,其特征在于,所述装置应用于服务器,所述服务器上插置有卸载卡,所述服务器和所述卸载卡建立有连接通道,所述装置包括:An apparatus for creating a virtual machine, wherein the apparatus is applied to a server, an uninstall card is inserted on the server, and a connection channel is established between the server and the uninstall card, and the apparatus includes:
    接收模块,用于接收云管理平台发送的虚拟机创建请求;The receiving module is used to receive the virtual machine creation request sent by the cloud management platform;
    处理模块,用于根据所述虚拟机创建请求在所述服务器中创建虚拟机,启动设置在所述服务器中的虚拟机管理代理子模块,并通过所述连接通道启动设置在所述卸载卡中的虚拟机管理子模块;a processing module, configured to create a virtual machine in the server according to the virtual machine creation request, start a virtual machine management agent sub-module set in the server, and start and set in the uninstall card through the connection channel The virtual machine management submodule;
    其中,所述虚拟机通过虚拟机模拟器实现,所述虚拟机模拟器包括虚拟机管理模块,所述虚拟机管理模块包括所述虚拟机管理代理子模块和所述虚拟机管理子模块,所述虚拟机管理代理子模块通过所述连接通道与所述虚拟机管理子模块进行通信,所述虚拟机管理子模块用于实现所述虚拟机的管理功能。Wherein, the virtual machine is implemented by a virtual machine simulator, and the virtual machine simulator includes a virtual machine management module, and the virtual machine management module includes the virtual machine management agent sub-module and the virtual machine management sub-module. The virtual machine management agent sub-module communicates with the virtual machine management sub-module through the connection channel, and the virtual machine management sub-module is used to implement the management function of the virtual machine.
  14. 根据权利要求13所述的装置,其特征在于,所述虚拟机模拟器还包括虚拟机硬件模拟模块,所述虚拟机硬件模拟模块设置在所述服务器中,所述虚拟机硬件模拟模块用于根据所述服务器的硬件模拟所述虚拟机的硬件。The apparatus according to claim 13, wherein the virtual machine simulator further comprises a virtual machine hardware simulation module, the virtual machine hardware simulation module is provided in the server, and the virtual machine hardware simulation module is used for The hardware of the virtual machine is simulated according to the hardware of the server.
  15. 根据权利要求13或14所述的装置,其特征在于,所述虚拟机管理子模块还用于通过所述连接通道以直接存储器访问DMA方式从所述服务器的内存中访问所述虚拟机的数据。The apparatus according to claim 13 or 14, wherein the virtual machine management sub-module is further configured to access the data of the virtual machine from the memory of the server in a direct memory access DMA manner through the connection channel .
  16. 根据权利要求14至15任一项所述的装置,其特征在于,所述虚拟机的硬件包括以下一个或多个:虚拟处理器、虚拟内存、虚拟主板芯片、虚拟输入输出设备和虚拟总线。The apparatus according to any one of claims 14 to 15, wherein the hardware of the virtual machine includes one or more of the following: a virtual processor, a virtual memory, a virtual motherboard chip, a virtual input and output device, and a virtual bus.
  17. 根据权利要求13至16任一项所述的装置,其特征在于,所述管理功能包括:虚拟机生命周期管理功能、虚拟机迁移功能、虚拟远程控制功能、异步信息处理功能和参数解析功能中的一者或任意组合。The device according to any one of claims 13 to 16, wherein the management functions include: a virtual machine life cycle management function, a virtual machine migration function, a virtual remote control function, an asynchronous information processing function, and a parameter parsing function. one or any combination.
  18. 根据权利要求13至17任一所述的装置,其特征在于,所述服务器与所述卸载卡通过虚拟高速外围组件互联PCIe总线或计算快速链接CXL总线连接。The apparatus according to any one of claims 13 to 17, wherein the server and the offload card are connected through a virtual high-speed peripheral component interconnect PCIe bus or a computing express link CXL bus.
  19. 一种计算机设备,其特征在于,所述计算机设备包括:处理器和存储器,所述存储器中存储有计算机程序;所述处理器执行计算机程序时,所述计算机设备实现权利要求7至12任一所述的方法。A computer device, characterized in that the computer device comprises: a processor and a memory, wherein a computer program is stored in the memory; when the processor executes the computer program, the computer device implements any one of claims 7 to 12 the method described.
  20. 一种存储介质,其特征在于,当所述存储介质中的指令被处理器执行时,实现权利要求7至12任一所述的方法。A storage medium, characterized in that, when an instruction in the storage medium is executed by a processor, the method of any one of claims 7 to 12 is implemented.
PCT/CN2021/142282 2020-12-29 2021-12-29 Server system, and virtual machine creation method and apparatus WO2022143714A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011603679 2020-12-29
CN202011603679.5 2020-12-29
CN202110351008.2A CN114691286A (en) 2020-12-29 2021-03-31 Server system, virtual machine creation method and device
CN202110351008.2 2021-03-31

Publications (1)

Publication Number Publication Date
WO2022143714A1 true WO2022143714A1 (en) 2022-07-07

Family

ID=82135613

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/142282 WO2022143714A1 (en) 2020-12-29 2021-12-29 Server system, and virtual machine creation method and apparatus

Country Status (2)

Country Link
CN (1) CN114691286A (en)
WO (1) WO2022143714A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858102A (en) * 2023-02-24 2023-03-28 珠海星云智联科技有限公司 Method for deploying virtual machine supporting virtualization hardware acceleration

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991544B (en) * 2023-09-26 2024-01-26 苏州元脑智能科技有限公司 Simulation method and device of CXL (control information and automation) equipment, electronic equipment and client
CN117170877B (en) * 2023-10-26 2024-02-23 西安羚控电子科技有限公司 Unmanned aerial vehicle virtualization task management device and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10146471B1 (en) * 2016-06-27 2018-12-04 Emc Corporation Offloaded data protection based on virtual machine snapshots
CN109564524A (en) * 2016-06-30 2019-04-02 亚马逊科技公司 The safety guidance of virtualization manager
CN111198663A (en) * 2020-01-03 2020-05-26 苏州浪潮智能科技有限公司 Method, system, apparatus and storage medium for controlling data access operation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10146471B1 (en) * 2016-06-27 2018-12-04 Emc Corporation Offloaded data protection based on virtual machine snapshots
CN109564524A (en) * 2016-06-30 2019-04-02 亚马逊科技公司 The safety guidance of virtualization manager
CN111198663A (en) * 2020-01-03 2020-05-26 苏州浪潮智能科技有限公司 Method, system, apparatus and storage medium for controlling data access operation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858102A (en) * 2023-02-24 2023-03-28 珠海星云智联科技有限公司 Method for deploying virtual machine supporting virtualization hardware acceleration
CN115858102B (en) * 2023-02-24 2023-05-16 珠海星云智联科技有限公司 Method for deploying virtual machine supporting virtualized hardware acceleration

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2022143714A1 (en) Server system, and virtual machine creation method and apparatus
CN107690622B9 (en) Method, equipment and system for realizing hardware acceleration processing
WO2017114283A1 (en) Method and apparatus for processing read/write request in physical host
WO2018120986A1 (en) Method for forwarding packet and physical host
WO2021000717A1 (en) Method and apparatus for processing io
WO2017066944A1 (en) Method, apparatus and system for accessing storage device
US20120054740A1 (en) Techniques For Selectively Enabling Or Disabling Virtual Devices In Virtual Environments
CN113312143B (en) Cloud computing system, command processing method and virtualization simulation device
JP2013530573A (en) Resource affinity through dynamic reconfiguration of multiqueue network adapters
WO2022179423A1 (en) Virtualization processing system, method and apparatus, and device
JP7310924B2 (en) In-server delay control device, server, in-server delay control method and program
WO2022001808A1 (en) System and interrupt processing method
US11940933B2 (en) Cross address-space bridging
US20220050795A1 (en) Data processing method, apparatus, and device
WO2021018267A1 (en) Live migration method for virtual machine and communication device
WO2022143717A1 (en) Method, apparatus, and system for migrating virtual machine
CN117389694B (en) Virtual storage IO performance improving method based on virtio-blk technology
US10782992B2 (en) Hypervisor conversion
US11929926B2 (en) Traffic service threads for large pools of network addresses
US11409624B2 (en) Exposing an independent hardware management and monitoring (IHMM) device of a host system to guests thereon
CN114281442A (en) Cloud desktop client and method thereof
Zhang et al. NVMe-over-RPMsg: A virtual storage device model applied to heterogeneous multi-core SoCs
WO2022068753A1 (en) Server system, and container setting method and apparatus
US11601515B2 (en) System and method to offload point to multipoint transmissions
WO2023230766A1 (en) Data transmission method and virtualization system

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21914448

Country of ref document: EP

Kind code of ref document: A1