Virtual machine management
By introducing a virtual queue between the virtual machine and the virtual machine simulator, the problems of operation and maintenance data accuracy degradation and real-time configuration are solved, high-precision operation and maintenance data transmission and real-time resource management are achieved, and the operation and maintenance and configuration efficiency of the virtual machine is improved.
Patent Information
- Application Number
- PCT/IB2025/052318
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-26
- Filing Date
- 2025-03-04
- Publication Date
- 2025-10-02
AI Technical Summary
In existing virtual machine management systems, the degradation of operation and maintenance data accuracy makes it impossible to obtain high-precision operation and maintenance data, and it is impossible to perform real-time configuration of tasks with severe performance fluctuations.
By introducing a virtual queue between the virtual machine and the virtual machine simulator, the data link between the virtual machine driver and the virtual machine simulator driver is directly connected to achieve high-precision operation and maintenance data transmission and real-time resource configuration.
High-precision operation and maintenance data can be obtained without degrading the accuracy of operation and maintenance data, and virtual machine resource configuration can be updated in real time to meet the needs of tasks with severe performance fluctuations, significantly improving operation and maintenance and configuration efficiency.
Smart Images

Figure IB2025052318_02102025_PF_FP_ABST
Abstract
Description
[0001] Virtual Machine Management Technology Field
[0002]
[0001] The present disclosure relates to the field of cloud computing technology, and more particularly to virtual machine management.
[0003]
[0002] In existing virtualization architectures, virtual machine operation and maintenance, as well as configuration changes, are typically accomplished manually by manually sending network control commands from the Elastic Compute Service (ECS) control terminal to the host machine's Quick Emulator (QEMU). However, to reduce bandwidth and storage costs, QEMU downgrades the accuracy of collected operation and maintenance data (such as processor stealing time) before sending it to the ECS console. This prevents operation and maintenance personnel from obtaining high-precision operation and maintenance data. Furthermore, because virtual machine operation and maintenance, as well as configuration changes, are network-based, real-time configuration cannot be performed for tasks with drastic performance fluctuations when the network experiences network fluctuations. Summary of the Invention
[0004]
[0003] In view of the above problems, the present disclosure provides a virtual machine management method, system, electronic device and storage medium to at least solve the technical problems in the related art of being unable to obtain high-precision virtual machine operation and maintenance data and performing real-time configuration for tasks with large virtual machine performance fluctuations.
[0005]
[0004] According to a first aspect of an embodiment of the present disclosure, a virtual machine management method is provided, which is applied to a virtual machine. The method includes: receiving a communication message sent by an application running on the virtual machine for managing the virtual machine; writing the communication message into a virtual queue, so that a virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator.
[0006]
[0005] According to a second aspect of an embodiment of the present disclosure, a virtual machine management method is provided, which is applied to a virtual machine simulator, wherein a virtual machine is running on a host machine where the virtual machine simulator is located. The method includes: obtaining a communication message for managing the virtual machine from a virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the host machine; and executing a processing strategy corresponding to the communication message.
[0007]
[0006] According to a third aspect of an embodiment of the present disclosure, a virtual machine is provided, comprising: a receiving unit for receiving a communication message sent by an application running on the virtual machine for managing the virtual machine; a first writing unit for writing the communication message into a virtual queue so that a virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator.
[0008]
[0007] According to a fourth aspect of an embodiment of the present disclosure, a virtual machine simulator is provided, wherein a host machine on which the virtual machine simulator is located has a virtual machine running thereon, and the virtual machine simulator includes: an acquisition unit, configured to acquire a communication message for managing the virtual machine from a virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; and an execution unit, configured to execute a processing strategy corresponding to the communication message.
[0009]
[0008] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the virtual machine management method of the first or second aspect.
[0010]
[0009] According to a sixth aspect of the embodiments of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the virtual machine management method of the first aspect or the second aspect when running.
[0011]
[0010] According to a seventh aspect of an embodiment of the present disclosure, a computer program product includes a computer program, wherein the computer program is executed by a processor to implement the virtual machine management method of the first aspect or the second aspect.
[0012]
[0011] In an embodiment of the present disclosure, a method is adopted for receiving a communication message sent by an application running on the virtual machine for managing the virtual machine; the communication message is written into a virtual queue, and the virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator; the present disclosure does not need to downgrade the accuracy of the operation and maintenance data collected by the virtual machine simulator QEMU and can send it to the operation and maintenance personnel through the virtual queue, so that the operation and maintenance personnel can obtain high-precision operation and maintenance data. Moreover, based on the method of carrying the above-mentioned communication messages through the virtual queue, the resources of the virtual machine can also be configured and updated in real time, meeting the resource requirements of tasks with severe performance fluctuations in the virtual machine, and significantly improving the operation and maintenance and configuration efficiency of the virtual machine.
[0013]
[0012] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiments below. The accompanying drawings are provided for illustration purposes only and are not to be construed as limiting the present disclosure. Like reference numerals are used throughout the accompanying drawings to denote like parts. In the accompanying drawings:
[0014]
[0013] FIG1 is a schematic diagram of an application environment of an optional virtual machine management method according to the related art;
[0014] FIG2 is a schematic diagram of a flow chart of an optional virtual machine management method according to an embodiment of the present disclosure;
[0015]
[0015] FIG3 is a schematic diagram of an application environment of another optional virtual machine management method according to an embodiment of the present disclosure;
[0016]
[0016] FIG4 is a flow chart of another optional virtual machine management method according to an embodiment of the present disclosure;
[0017]
[0017] FIG5 is a schematic diagram of the structure of an optional virtual machine according to an embodiment of the present disclosure;
[0018]
[0018] FIG6 is a schematic diagram of the structure of an optional virtual machine simulator according to an embodiment of the present disclosure;
[0019]
[0019] FIG7 is a schematic diagram of the structure of an optional virtual machine management system according to an embodiment of the present disclosure;
[0020] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
[0021]
[0021] FIG9 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present disclosure.
[0022] To help those skilled in the art better understand the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings. It should be understood that the described embodiments are merely a portion of the embodiments of the present invention, and are not intended to be exhaustive. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention.
[0023]
[0023] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.
[0024]
[0024] As shown in Figure 1, the operation and maintenance of virtual machines in a virtualization architecture in the related art and configuration changes are usually completed by manually sending network control instructions (operation and maintenance data or configuration instructions) from the cloud server (Elastic Compute Service, ECS) control terminal to control the virtual machine simulator (Quick Emulator, QEMU) on the host machine. However, in order to reduce bandwidth and storage costs, QEMU will downgrade the accuracy of the collected operation and maintenance data (such as processor stealing time, etc.) before sending it to the ECS console. This will cause the operation and maintenance personnel to be unable to obtain high-precision operation and maintenance data. In addition, because the operation and maintenance and configuration changes of virtual machines are implemented based on the network, when the network fluctuates, it is impossible to perform real-time configuration for tasks with severe performance fluctuations.
[0025]
[0025] In order to solve the above technical problems, as an optional implementation method, as shown in FIG2, the embodiment of the present disclosure provides a virtual machine management method, which is applied to a virtual machine and includes the following steps.
[0026]
[0026] S202, receiving a communication message sent by an application running on the virtual machine for managing the virtual machine.
[0027]
[0027] Specifically, in the embodiment of the present disclosure, as shown in FIG3 , the application running in the virtual machine can be a user space
[0028] (user space) An application that exclusively occupies the virtual machine, such as a cloud desktop application, or an application that runs in multiple applications in the virtual machine and is used to manage the virtual machine configuration. The communication message used to manage the virtual machine includes a message header
[0029] The message header and payload data can include the message type, such as a message type indicating a resource increase or decrease, and the payload data can include the amount of resources to be increased or decreased. The message type can also be an operation and maintenance data type, such as the number of read and write operations per second (IOPS) of a process. The virtual machine transmits the communication message to the driver in the kernel space of the virtual machine through the input / output control interface (ioctl).
[0030]
[0028] S204, writing the communication message into a virtual queue, so that the virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator.
[0031] Specifically, in the disclosed embodiments, a virtual queue (Vring) for transmitting communication messages is a data link connecting the virtual machine driver and the virtual machine emulator driver. The virtual queue (Vring) may be a message queue in a paravirtualized device (Virtual Input / Output Device). After the virtual machine driver writes the communication message to the virtual queue, the virtual machine emulator (QEMU) can retrieve the communication message from the virtual queue (Vring), thereby managing virtual configurations and obtaining high-precision operation and maintenance data.
[0032]
[0030] In an embodiment of the present disclosure, a communication message for managing the virtual machine sent by an application running on the virtual machine is received; the communication message is written into a virtual queue, and the virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a method for a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator; the present disclosure does not need to degrade the accuracy of the operation and maintenance data collected by the virtual machine simulator QEMU and can send it to the operation and maintenance personnel through the virtual queue. The operation and maintenance personnel of the virtual machine can obtain high-precision operation and maintenance data, and based on the method of carrying the above-mentioned communication messages through the virtual queue, the resources of the virtual machine can also be updated in real time to meet the resource requirements of tasks with severe performance fluctuations in the virtual machine, thereby significantly improving the operation and maintenance and configuration efficiency of the virtual machine.
[0033]
[0031] In one or more embodiments, the communication message carries a message type and payload data, and writing the communication message into the virtual queue includes: creating a communication message body corresponding to the message type and payload data in the communication message, and writing the message body into the virtual queue.
[0034] Specifically, in the embodiment of the present disclosure, as shown in FIG3 , the virtual machine driver combines the message type (message header) and payload data (Payload) of the received communication message into a message body, where the message type corresponds to the first sequence data (Sg[0]) of the message body, and the payload data serves as the second sequence data (Sg[1]) of the message body. The virtual machine driver then writes the message body into the virtual queue Vring.
[0035]
[0033] In one or more embodiments, after receiving the communication message sent by the application running on the virtual machine for managing the virtual machine, it also includes: determining that the communication message is received, calling the driver of the virtual machine to apply for memory space from the memory of the virtual machine; and writing the address information corresponding to the memory space into the payload data.
[0036]
[0034] Specifically, in the disclosed embodiment, after a virtual machine receives a communication message sent by an application, it calls the virtual machine's driver to request memory space from the virtual machine's memory. This memory space is currently unused storage space. The virtual machine then writes the address information corresponding to the memory space requested by the virtual machine into the payload data. This address information can be passed to the virtual machine emulator QEMU via a virtual queue Vring. It should be noted that this memory space can store operation and maintenance information (such as IOPS data) sent by the virtual machine's application, as well as operation and maintenance information (such as processor steal time) generated by the virtual machine emulator. By utilizing this memory space, high-precision operation and maintenance data can be loaded without downgrading the accuracy of the operation and maintenance data. For example, there is no need to downgrade the processor steal time from milliseconds to seconds to save bandwidth.
[0037]
[0035] In one or more embodiments, the message type includes a first message type for indicating obtaining operation and maintenance data from a virtual machine simulator, and the method further includes: based on the address information corresponding to the memory space, reading the operation and maintenance data fed back by the virtual machine simulator for the first message type from the memory space.
[0038]
[0036] Specifically, in the embodiment of the present disclosure, the above-mentioned first message type can be, for example, the processor stealing time or other operation and maintenance data fed back by the virtual machine simulator for the current virtual machine. After the virtual machine simulator QEMU obtains the address information corresponding to the above-mentioned memory space from the virtual machine queue Vring, for example, the processor stealing time or other operation and maintenance data fed back by the virtual machine simulator for the current virtual machine can be written into the above-mentioned memory space, and the virtual machine can read the above-mentioned operation and maintenance data from the memory space.
[0039]
[0037] In one or more embodiments, the message type includes a second message type for indicating that operation and maintenance data is to be sent to the virtual machine simulator, and the method further includes: based on the address information corresponding to the memory space, writing the operation and maintenance data corresponding to the second message type to the memory space, so that the virtual machine simulator reads the operation and maintenance data corresponding to the second message type from the memory space.
[0038] Specifically, in the embodiments of the present disclosure, the second message type may be, for example, the number of read and write times per second of a process in the virtual machine or other operation and maintenance data currently fed back by the virtual machine. Based on the address information corresponding to the memory space, the virtual machine may, for example, write the number of read and write times per second of a process or other operation and maintenance data currently fed back by the virtual machine to the memory space. The virtual machine simulator may then read the operation and maintenance data from the memory space based on the address information corresponding to the memory space.
[0040]
[0039] In one or more embodiments, the message type includes a resource configuration type, the payload data includes resource configuration information, and the creation of a communication message body corresponding to the message type and payload data in the communication message includes: using the resource configuration type as the first sequence data and the resource configuration information as the second sequence data; and creating the communication message body based on the first sequence data and the second sequence data.
[0041] Specifically, in the embodiments of the present disclosure, the resource configuration type may be, for example, a processor configuration type, a storage space configuration type, or a network configuration type; the resource configuration information may be, for example, an increase or decrease in the number of processors or an increase or decrease in the size of memory space; as shown in FIG3 , the virtual machine driver uses the received resource configuration type as first sequence data (Sg[0]) and the resource configuration information as second sequence data (Sg[1]); and creates the communication message body based on the first sequence data Sg[0] and the second sequence data Sg[1]. After receiving the communication message body, the virtual machine simulator efficiently and in real time changes the resource configuration of the virtual machine based on the resource configuration type and resource configuration information in the message body.
[0042]
[0041] In one or more embodiments, the resource configuration type includes a computing power configuration type; when the current computing power parameter of the virtual machine meets the preset overload condition, the computing power configuration type is an increase computing power type, and the resource configuration information includes a computing power increase parameter; when the current computing power parameter meets the preset computing power sufficient condition, the computing power configuration type is a decrease computing power type, and the resource configuration information includes a computing power decrease parameter.
[0043] Specifically, in the embodiments of the present disclosure, for example, if the computing power required by an application running on the current virtual machine is high and the current computing power of the virtual machine is overloaded, the virtual machine needs to transmit the computing power increase type and computing power increase parameters to the virtual machine simulator via the communication message body. The virtual machine simulator increases the computing power resources of the virtual machine based on the computing power increase type and computing power increase parameters. For example, if the current processor utilization of the virtual machine is greater than a preset utilization rate, the computing power configuration type is a message type for increasing processors, and the resource configuration information includes parameters such as the number of processors to be increased.
[0044] For example, if an application running on the current virtual machine is running smoothly and the current computing power of the virtual machine is sufficient, the virtual machine needs to transmit the computing power reduction type and computing power reduction parameters to the virtual machine simulator via the communication message body. The virtual machine simulator reduces the computing power resources of the virtual machine based on the computing power reduction type and computing power reduction parameters. For example, if the current processor utilization of the virtual machine is less than or equal to the preset utilization, the computing power configuration type is a message type for reducing processors, and the resource configuration information includes parameters such as the number of processors to be reduced.
[0045]
[0044] As an optional implementation, as shown in FIG4, an embodiment of the present disclosure provides a virtual machine management method, which is applied to a virtual machine simulator, where a virtual machine is running on a host machine where the virtual machine simulator is located, and includes the following steps.
[0046]
[0045] S402, obtaining a communication message for managing the virtual machine from a virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the host machine.
[0047]
[0046] S404, executing the processing strategy corresponding to the communication message.
[0048] Specifically, in the disclosed embodiment, a virtual queue (Vring) for transmitting communication messages is a data link connecting the virtual machine driver and the virtual machine simulator driver. This virtual queue (Vring) may be a message queue for a paravirtualized device (Virtual I / O Device) t. As shown in FIG3 , after the virtual machine driver writes a communication message for managing the virtual machine into the virtual queue, the virtual machine simulator QEMU retrieves the communication message from the virtual queue (Vring), thereby enabling management and control of virtual configurations and obtaining high-precision operation and maintenance data.
[0049]
[0048] In an embodiment of the present disclosure, a communication message for managing the virtual machine is obtained from a virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator; a method for executing a processing strategy corresponding to the communication message; the present disclosure does not need to downgrade the accuracy of the operation and maintenance data collected by the virtual machine simulator QEMU and can send it to the operation and maintenance personnel through the virtual queue. The operation and maintenance personnel of the virtual machine can obtain high-precision operation and maintenance data, and based on the method of carrying the above-mentioned communication messages through the virtual queue, the resources of the virtual machine can also be updated in real time to meet the resource requirements of tasks with severe performance fluctuations in the virtual machine, and significantly improve the operation and maintenance and configuration efficiency of the virtual machine.
[0050]
[0049] In one or more embodiments, the execution of the processing strategy corresponding to the communication message includes: determining that the message type carried by the communication message is a first message type, and generating operation and maintenance data corresponding to the first message type; the first message type is used to indicate that the operation and maintenance data is obtained from the virtual machine simulator; obtaining address information corresponding to the memory space from the communication message, and writing the operation and maintenance data corresponding to the first message type into the memory space; the memory space is the storage space applied for by the driver of the virtual machine from the memory of the virtual machine.
[0051]
[0050] Specifically, in an embodiment of the present disclosure, the first message type may be, for example, processor stealing time or other operation and maintenance data fed back by the virtual machine simulator QEMU for the current virtual machine. After the virtual machine simulator QEMU obtains the message type indicating that the operation and maintenance message is obtained, as well as address information corresponding to the memory space, from the virtual machine queue Vring, the processor stealing time or other operation and maintenance data fed back by the virtual machine simulator for the current virtual machine may be written to the memory space corresponding to the address information, and the virtual machine may then read the operation and maintenance data from the memory space.
[0051] In one or more embodiments, executing the processing strategy corresponding to the communication message includes: determining that the message type carried by the communication message is a second message type, obtaining address information corresponding to the memory space from the communication message; the second message type is used to indicate that operation and maintenance data is to be sent to the virtual machine simulator, the memory space being storage space requested by the virtual machine driver from the memory of the virtual machine; and reading the operation and maintenance data corresponding to the second message type written by the virtual machine from the memory space based on the address information.
[0052]
[0052] Specifically, in the embodiments of the present disclosure, the second message type may be, for example, the number of read and write times per second of a process in the virtual machine, or other operation and maintenance data reported by the current virtual machine. Based on the address information corresponding to the memory space, the virtual machine may, for example, write the number of read and write times per second of the process, or other operation and maintenance data reported by the current virtual machine, into the memory space. When the message type of the communication message received by the virtual machine simulator is the type of the operation and maintenance data reported by the current virtual machine, the virtual machine simulator obtains the address information corresponding to the memory space from the communication message. The virtual machine simulator can then read the operation and maintenance data corresponding to the second message type written by the virtual machine from the memory space based on the address information corresponding to the memory space.
[0053]
[0053] In one or more embodiments, executing the processing strategy corresponding to the communication message further includes: determining the resource configuration type corresponding to the communication message; and updating the configuration of the virtual machine according to the resource configuration type and the resource configuration information carried by the communication message.
[0054]
[0054] In the embodiment of the present disclosure, for example, if the application running on the current virtual machine requires a large number of resources, the virtual machine will transmit the increased resource type and resource increase parameters to the virtual machine simulator through the above-mentioned communication message body, and the virtual machine simulator will increase the resources required by the virtual machine according to the resource configuration type and resource increase parameters.
[0055]
[0055] For another example, if the application running on the current virtual machine runs smoothly and the current resource utilization of the virtual machine is low, the virtual machine will transmit the resource reduction type and resource reduction parameters to the virtual machine simulator through the above-mentioned communication message body, and the virtual machine simulator will reduce the resources required by the virtual machine according to the resource configuration type and resource reduction parameters.
[0056]
[0056] In one or more embodiments, the resource configuration type includes a computing power configuration type, the resource configuration information includes a computing power increase parameter or a computing power reduction parameter, and updating the configuration of the virtual machine according to the resource configuration type and the configuration information of the computing power resources carried by the communication message includes: determining that the resource configuration type of the communication message is a computing power configuration type, and increasing the computing power resources of the virtual machine according to the computing power increase parameter; or, reducing the computing power resources of the virtual machine according to the computing power reduction parameter.
[0057]
[0057] Specifically, in the embodiments of the present disclosure, for example, if the computing power required by an application running on the current virtual machine is large and the current computing power of the virtual machine is overloaded, the virtual machine needs to transmit the computing power increase type and computing power increase parameters to the virtual machine simulator via the communication message body. The virtual machine simulator increases the computing power resources of the virtual machine based on the computing power increase type and computing power increase parameters. For example, if the current processor utilization of the virtual machine is greater than a preset utilization rate, the computing power configuration type is a message type for increasing processors, and the resource configuration information includes parameters such as the number of processors to be increased.
[0058] For example, if an application running on the current virtual machine is running smoothly and the current computing power of the virtual machine is sufficient, the virtual machine needs to transmit the computing power reduction type and computing power reduction parameters to the virtual machine simulator via the communication message body. The virtual machine simulator reduces the computing power resources of the virtual machine according to the computing power reduction type and computing power reduction parameters. If the current processor utilization of the virtual machine is less than or equal to the preset utilization, the computing power configuration type is a message type for reducing processors, and the resource configuration information includes parameters such as the number of processors to be reduced.
[0059] Based on the above embodiment, in an application embodiment, as shown in FIG3 , the application architecture package of the above virtual machine management method is composed of three parts: (1) an application running in the user space of the guest virtual machine (Guest VM); (2) a driver running in the kernel space of the Guest VM; and (3) a virtual machine simulator QEMU running on the host machine. The Guest VM communicates with the Virtio driver and its corresponding virtualization driver based on the Peripheral Component Interconnect (PCI) bus, i.e., the Virtio-PCI device.
[0060]
[0060] The user space application transmits a communication message (ioctl cmd message) to the kernel space through the input / output channel control interface (ioctl) ioctl interface. The communication message consists of two parts: 1. Header: a fixed 8-byte header used to mark the type of the message; 2. Payload: a variable length payload used to transmit the actual payload information of the message, such as operation and maintenance data or configuration parameters.
[0061]
[0061] The communication message is transmitted in the kernel space to the virtual machine controller QEMLH on the host through the virtual queue Vring. The specific process includes: forming the communication message into a message body Sgs (sg[0] and sg[1]), writing the message body Sgs into Vring, adding a buffer to Vring through the vq_add_buff function, and then notifying the virtual machine emulator QEMU on the host to process the message through the Kick function.
[0062] The kernel space driver transmits messages in a synchronous manner. That is, after the kernel space driver sends a message, it blocks the sending of subsequent messages until it receives the return value of the current message from the virtual machine simulator QEMU. The second message will be written. When the message arrives at QEMLH, QEMU extracts the message and calls different processing logic according to the message type contained in the message header. Finally, the return value is written to Vring.
[0063]
[0063] 2. The operation and maintenance solution based on the communication architecture includes: 1. The guest virtual machine GuestVM applies for a piece of memory space with continuous addresses through a driver; 2. The guest virtual machine writes the address and storage capacity of the memory space into the payload data Payload of the communication message, and further transmits it to the virtual machine emulator QEMU through Vring.
[0064] The guest virtual machine reads and writes operation and maintenance information: GuestVM writes the information required by QEMU (such as the IOPS of the process in the guest virtual machine) to the agreed location in the memory space, and can also read the operation and maintenance information written by QEMU from the agreed location.
[0064]
[0065] QEMU reads and writes operation and maintenance information: QEMU writes the operation and maintenance information required by the guest virtual machine (such as processor steal time) to the agreed memory location, and can also read the operation and maintenance information written by the guest virtual machine from the agreed location.
[0065]
[0066] Through the above technical means, the present disclosure can enable the guest virtual machine and the host machine to directly read and write original high-precision and highly effective operation and maintenance data, and realize the exchange of operation and maintenance data through memory mapping, thereby reducing the message delay.
[0066]
[0067] 3. The resource allocation solution based on the communication architecture includes the following: the guest VM notifies the virtual machine emulator of its resource requirements through the aforementioned communication framework. The virtual machine emulator dynamically allocates resources to the guest VM based on the policy. The following uses processors as an example: When the application within the guest VM is experiencing computing power shortages, it sends a message to QEMU requesting processing resources, requesting an increase in the number of processors. The message type is stored in the message header, and the number of processors requested is stored in the payload. After receiving the message, QEMU increases the number of processors in the guest VM based on the number of processors in the payload.
[0067]
[0068] When the application in the guest VM is running smoothly, it can request processing resources by sending a message to QEMU with the "Reduce Processor Count" message type. The message type is stored in the message header, and the requested number of processors is stored in the payload. After receiving the message, QEMU reduces the number of processors in the guest VM based on the number of processors in the payload.
[0068]
[0069] Through the above technical means, the present disclosure can realize the real-time resource configuration requirements of the guest virtual machine, and can perform real-time configuration for tasks with severe performance fluctuations of the guest virtual machine.
[0069]
[0070] It should be noted that, for simplicity of description, the aforementioned method embodiments are described as a series of actions. However, those skilled in the art should understand that the present invention is not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously according to the present invention. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for the present invention.
[0070]
[0071] According to another aspect of an embodiment of the present disclosure, a virtual machine for implementing the above-mentioned virtual machine management method is further provided. As shown in FIG5 , the virtual machine includes: a receiving unit 502, configured to receive a communication message sent by an application running on the virtual machine for managing the virtual machine; a first writing unit 504, configured to write the communication message into a virtual queue, so that a virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator.
[0071]
[0072] In an embodiment of the present disclosure, a method is adopted for receiving communication messages sent by an application running on the virtual machine for managing the virtual machine; writing the communication messages into a virtual queue, and the virtual machine simulator corresponding to the virtual machine obtaining the communication messages from the virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator; the present disclosure does not need to degrade the accuracy of the operation and maintenance data collected by the virtual machine simulator QEMU and can send it to the operation and maintenance personnel through the virtual queue. The operation and maintenance personnel of the virtual machine can obtain high-precision operation and maintenance data. Moreover, based on the method of carrying the above-mentioned communication messages through the virtual queue, the resources of the virtual machine can also be updated in real time, meeting the resource requirements of tasks with severe performance fluctuations in the virtual machine, and significantly improving the operation and maintenance and configuration efficiency of the virtual machine.
[0072]
[0073] In one or more embodiments, the communication message carries a message type and payload data, and the first writing unit 504 includes: a creation module configured to create a communication message body corresponding to the message type and payload data in the communication message, and write the message body into the virtual queue.
[0073]
[0074] In one or more embodiments, the virtual machine further includes: a storage space application unit, configured to determine receipt of the communication message and call a driver of the virtual machine to apply for memory space from the memory of the virtual machine; and a second writing unit, configured to write address information corresponding to the memory space into the payload data.
[0074]
[0075] In one or more embodiments, the message type includes a first message type for indicating obtaining operation and maintenance data from a virtual machine simulator, and the virtual machine further includes: a reading unit for reading the operation and maintenance data fed back by the virtual machine simulator for the first message type from the memory space based on address information corresponding to the memory space.
[0075]
[0076] In one or more embodiments, the message type includes a second message type for indicating sending operation and maintenance data to a virtual machine simulator, and the virtual machine also includes: a third writing unit, for writing operation and maintenance data corresponding to the second message type to the memory space based on address information corresponding to the memory space, so that the virtual machine simulator reads the operation and maintenance data corresponding to the second message type from the memory space.
[0076]
[0077] In one or more embodiments, the message type includes a resource configuration type, the payload data includes resource configuration information, and the creation module includes: a processing subunit, configured to use the resource configuration type as a first sequence data and the resource configuration information as a second sequence data; and a creation subunit, configured to create the communication message body based on the first sequence data and the second sequence data.
[0077]
[0078] In one or more embodiments, in the virtual machine, the resource configuration type includes a computing power configuration type; when the current computing power parameter of the virtual machine meets a preset overload condition, the computing power configuration type is an increase computing power type, and the resource configuration information includes a computing power increase parameter; when the current computing power parameter meets a preset sufficient computing power condition, the computing power configuration type is a decrease computing power type, and the resource configuration information includes a computing power decrease parameter.
[0078]
[0079] According to another aspect of an embodiment of the present disclosure, a virtual machine simulator for implementing the aforementioned virtual machine management method is further provided. As shown in FIG6 , the virtual machine simulator includes: an acquisition unit 602, configured to acquire a communication message for managing the virtual machine from a virtual queue; the virtual queue being a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; and an execution unit 604, configured to execute a processing policy corresponding to the communication message.
[0079]
[0080] In an embodiment of the present disclosure, a communication message for managing the virtual machine is obtained from a virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator; a method for executing a processing strategy corresponding to the communication message is provided; the present disclosure does not need to degrade the accuracy of the operation and maintenance data collected by the virtual machine simulator QEMU and can send it to the operation and maintenance personnel through the virtual queue. The operation and maintenance personnel of the virtual machine can obtain high-precision operation and maintenance data. Moreover, based on the method of carrying the above-mentioned communication messages through the virtual queue, the resources of the virtual machine can also be updated in real time, meeting the resource requirements of tasks with severe performance fluctuations in the virtual machine, and significantly improving the operation and maintenance and configuration efficiency of the virtual machine.
[0080]
[0081] In one or more embodiments, the execution unit 604 includes: a determination generation module, used to determine that the message type carried by the communication message is a first message type, and generate operation and maintenance data corresponding to the first message type; the first message type is used to indicate that the operation and maintenance data is obtained from the virtual machine simulator; an acquisition module, used to obtain address information corresponding to the memory space from the communication message, and write the operation and maintenance data corresponding to the first message type into the memory space; the memory space is the storage space applied for by the driver of the virtual machine from the memory of the virtual machine.
[0081]
[0082] In one or more embodiments, the execution unit 604 includes: a determination acquisition module, used to determine that the message type carried by the communication message is a second message type, and obtain address information corresponding to the memory space from the communication message; the second message type is used to indicate sending operation and maintenance data to the virtual machine simulator, and the memory space is the storage space applied for by the driver of the virtual machine from the memory of the virtual machine; a writing module, used to read the operation and maintenance data corresponding to the second message type written by the virtual machine from the memory space based on the address information.
[0082]
[0083] In one or more embodiments, the execution unit 604 includes: a determination module configured to determine a resource configuration type corresponding to the communication message; and a configuration update module configured to update the configuration of the virtual machine according to the resource configuration type and resource configuration information carried in the communication message.
[0083]
[0084] In one or more embodiments, the resource configuration type includes a computing power configuration type, the resource configuration information includes a computing power increase parameter or a computing power reduction parameter, and the update configuration module includes: an increase subunit, used to determine that the resource configuration type of the communication message is a computing power configuration type, and then increase the computing power resources of the virtual machine according to the computing power increase parameter; or, a decrease subunit, used to reduce the computing power resources of the virtual machine according to the computing power reduction parameter.
[0084]
[0085] According to another aspect of the embodiments of the present disclosure, a virtual machine management system for implementing the above-mentioned virtual machine management method is also provided. As shown in Figure 7, the system includes: a virtual machine and a virtual machine simulator corresponding to the virtual machine; the virtual machine is configured to receive a communication message for managing the virtual machine sent by an application running on the virtual machine; the communication message is written into a virtual queue so that the virtual machine simulator obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; the virtual machine simulator is configured to obtain a communication message for managing the virtual machine from the virtual queue; and the processing strategy corresponding to the communication message is executed.
[0085]
[0086] According to another aspect of an embodiment of the present disclosure, an electronic device for implementing the aforementioned virtual machine management method is provided. This electronic device may be a virtual machine or virtual machine simulator as described in the aforementioned example. This embodiment is described using the electronic device as a virtual machine as an example. As shown in FIG8 , the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps of any of the aforementioned method embodiments using the computer program.
[0086]
[0087] Optionally, in this embodiment, the electronic device may be at least one network device among multiple network devices of a computer network.
[0087]
[0088] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S11, receiving a communication message for managing the virtual machine sent by an application running on the virtual machine; S12, writing the communication message into a virtual queue, so that a virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator.
[0088]
[0089] Memory 802 can be used to store software programs and modules, such as program instructions / modules corresponding to the virtual machine management method and apparatus in the embodiments of the present disclosure. Processor 804 executes the software programs and modules stored in memory 802 to execute various functional applications and data processing, thereby implementing the aforementioned virtual machine management method. Memory 802 may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, memory 802 may further include memory remotely located from processor 804, which can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Memory 802 can specifically, but is not limited to, be used to store communication messages sent by applications running in the virtual machine.
[0090] As an example, as shown in FIG8 , the memory 802 may include, but is not limited to, the receiving unit 502 and the first writing unit 504 in the virtual machine management apparatus. Furthermore, it may also include, but is not limited to, other module units in the virtual machine, which will not be described in detail in this example.
[0089]
[0091] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 806 includes a network adapter.
[0090] A Network Interface Controller (NIC) can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0091]
[0092] In addition, the electronic device further includes a connection bus 808, which is used to connect various module components in the electronic device.
[0092]
[0093] According to another aspect of an embodiment of the present disclosure, an electronic device for implementing the aforementioned virtual machine management method is provided. This electronic device may be a virtual machine or virtual machine simulator as described in the aforementioned examples. This embodiment is described using the electronic device as a virtual machine simulator as an example. As shown in FIG9 , the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps of any of the aforementioned method embodiments using the computer program.
[0093]
[0094] Optionally, in this embodiment, the electronic device may be at least one network device among multiple network devices of a computer network.
[0094]
[0095] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program: S21, obtaining a communication message for managing the virtual machine from a virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; S22, executing a processing strategy corresponding to the communication message.
[0095]
[0096] Memory 902 may be used to store software programs and modules, such as program instructions / modules corresponding to the virtual machine management method and apparatus in the embodiments of the present disclosure. Processor 904 executes the software programs and modules stored in memory 902 to execute various functional applications and data processing, thereby implementing the aforementioned virtual machine management method. Memory 902 may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, memory 902 may further include memory remotely located from processor 904, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Memory 902 may be used, but is not limited to, to store communication messages for managing the virtual machines.
[0097] As an example, as shown in FIG9 , the memory 902 may include, but is not limited to, the acquisition unit 602 and the execution unit 604 in the virtual machine simulator. Furthermore, it may also include, but is not limited to, other module units in the virtual machine simulator, which will not be described in detail in this example.
[0096]
[0098] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter.
[0097] A Network Interface Controller (NIC) can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 906 is a radio frequency (RF) module for wireless communication with the Internet.
[0098]
[0099] In addition, the electronic device further includes a connection bus 908, which is used to connect various module components in the electronic device.
[0099]
[0100] In other embodiments, the electronic device may be a node in a distributed system, wherein the distributed system may be a blockchain system. The blockchain system may be a distributed system formed by connecting multiple nodes via network communication. The nodes may form a peer-to-peer (P2P) network. Any computing device, such as a server or terminal, may become a node in the blockchain system by joining the peer-to-peer network.
[0100]
[0101] In one or more embodiments, the present disclosure further provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned virtual machine management method. The computer program is configured to execute the steps of any of the aforementioned method embodiments when executed.
[0101]
[0102] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program configured to perform the following steps: S11: receiving a communication message for managing the virtual machine sent by an application running on the virtual machine; S12: writing the communication message to a virtual queue, so that a virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue being a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; and S22: executing a processing policy corresponding to the communication message.
[0102]
[0103] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0103]
[0104] The serial numbers of the above embodiments of the present disclosure are for description only and do not represent the advantages or disadvantages of the embodiments.
[0104]
[0105] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the relevant art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for causing one or more computer devices (such as personal computers, servers, or network devices) to execute all or part of the steps of the methods of various embodiments of the present invention.
[0105]
[0106] In the above embodiments of the present invention, the description of each embodiment is given with emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0106]
[0107] In the several embodiments provided in this disclosure, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other divisions may be employed. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through interfaces, or indirect coupling or communication connection between units or modules, and may be electrical or otherwise.
[0107]
[0108] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.
[0108]
[0109] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0109]
[0110] The above are only preferred embodiments of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention.
[0110]
[0111] All user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. The collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation portals shall be provided for users to choose to authorize or refuse.
Claims
Claims 1. A virtual machine management method, applied to a virtual machine, comprising: receiving a communication message for managing the virtual machine sent by an application running on the virtual machine; The communication message is written into a virtual queue, so that the virtual machine simulator corresponding to the virtual machine obtains the communication message from the virtual queue; the virtual queue is a data link connecting the driver of the virtual machine and the driver of the virtual machine simulator.
2. The method according to claim 1, wherein The communication message carries a message type and payload data, and writing the communication message into the virtual queue includes: creating a communication message body corresponding to the message type and payload data in the communication message, and writing the message body into the virtual queue.
3. The method according to claim 2, wherein After receiving the communication message sent by the application running on the virtual machine for managing the virtual machine, it also includes: determining that the communication message is received, calling the driver of the virtual machine to apply for memory space from the memory of the virtual machine; and writing the address information corresponding to the memory space into the payload data.
4. The method according to claim 3, wherein The message type includes a first message type for indicating obtaining operation and maintenance data from a virtual machine simulator. The method further includes: reading, from the memory space based on address information corresponding to the memory space, the operation and maintenance data fed back by the virtual machine simulator for the first message type.
5. The method according to claim 3, wherein The message type includes a second message type for indicating sending operation and maintenance data to the virtual machine simulator, and the method further includes: based on the address information corresponding to the memory space, writing the operation and maintenance data corresponding to the second message type to the memory space, so that the virtual machine simulator reads the operation and maintenance data corresponding to the second message type from the memory space.
6. The method according to any one of claims 2 to 5, wherein: The message type includes a resource configuration type, the payload data includes resource configuration information, and the creation of a communication message body corresponding to the message type and payload data in the communication message includes: using the resource configuration type as the first sequence data and the resource configuration information as the second sequence data; and creating the communication message body based on the first sequence data and the second sequence data.
7. The method according to claim 6, wherein: The resource configuration type includes a computing power configuration type; when the current computing power parameter of the virtual machine meets the preset overload condition, the computing power configuration type is The computing power increase type, the resource configuration information includes computing power increase parameters; when the current computing power parameters meet the preset computing power sufficient conditions, the computing power configuration type is a computing power reduction type, and the resource configuration information includes computing power reduction parameters.
8. A virtual machine management method, wherein: Applied to a virtual machine simulator, where a virtual machine is running on a host machine where the virtual machine simulator resides, the method comprises: obtaining a communication message for managing the virtual machine from a virtual queue; the virtual queue being a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; and executing a processing strategy corresponding to the communication message.
9. The method according to claim 8, wherein The executing the processing strategy corresponding to the communication message includes: determining that the message type carried by the communication message is a first message type, and generating operation and maintenance data corresponding to the first message type; the first message type is used to indicate obtaining the operation and maintenance data from the virtual machine simulator; obtaining address information corresponding to a memory space from the communication message, and writing the operation and maintenance data corresponding to the first message type into the memory space; The memory space is the storage space requested by the driver of the virtual machine from the memory of the virtual machine.
10. The method according to claim 8, wherein: The execution of the processing strategy corresponding to the communication message includes: determining that the message type carried by the communication message is a second message type, and obtaining address information corresponding to the memory space from the communication message; the second message type is used to indicate sending operation and maintenance data to the virtual machine simulator, and the memory space is the storage space applied for by the driver of the virtual machine from the memory of the virtual machine; based on the address information, reading the operation and maintenance data corresponding to the second message type written by the virtual machine from the memory space.
11. The method according to claim 8, wherein: The executing the processing strategy corresponding to the communication message further includes: determining a resource configuration type corresponding to the communication message; and updating the configuration of the virtual machine according to the resource configuration type and the resource configuration information carried by the communication message.
12. The method according to claim 11, wherein: The resource configuration type includes a computing power configuration type, the resource configuration information includes a computing power increase parameter or a computing power reduction parameter, and updating the configuration of the virtual machine according to the resource configuration type and the configuration information of the computing power resource carried by the communication message includes: determining that the resource configuration type of the communication message is a computing power configuration type, and then increasing the computing power according to the computing power increase parameter. or, reducing the computing power resources of the virtual machine according to the computing power reduction parameter.
13. A virtual machine management system, wherein: The system includes a virtual machine and a virtual machine simulator corresponding to the virtual machine; the virtual machine is used to receive a communication message for managing the virtual machine sent by an application running on the virtual machine; the communication message is written into a virtual queue so that the virtual machine simulator obtains the communication message from the virtual queue; the virtual queue is a data link connecting a driver of the virtual machine and a driver of the virtual machine simulator; the virtual machine simulator is used to obtain a communication message for managing the virtual machine from the virtual queue; and a processing strategy corresponding to the communication message is executed.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the method according to any one of claims 1 to 7, or 8 to 12.
15. A computer-readable storage medium having a computer program stored thereon, wherein: The program is executed by a processor to implement the method according to any one of claims 1 to 7, or 8 to 12.
16. A computer program product comprising a computer program, wherein: The computer program is executed by a processor to implement the method according to any one of claims 1 to 7, or 8 to 12.
Citation Information
Patent Citations
Virtual machine flow detection method and system
CN116318775A
Virtual machine state detection method and device, electronic equipment and storage medium
CN116382839A
Secure and efficient access to host memory for guests
US20200242263A1