Method for managing virtual machines, virtual machine monitor and virtual machine system
Patent Information
- Application Number
- CN202310869288.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2043-07-14
AI Technical Summary
[0004]本申请实施例提供了一种虚拟机的管理方法、虚拟机监控器、计算机可读存储介质和虚拟机系统,以至少解决现有技术中的监控工具获取物理服务器的资源占用情况比较慢,导致虚拟机资源调度速度慢的问题
[0015] This application utilizes the rapid data acquisition capability of the baseboard management controller (BMC). The virtual machine monitor (VM) controls the BMC to quickly obtain the number and capacity of unoccupied components in the physical server. Based on this data, the unoccupied components are allocated to virtual machines, thereby improving the speed of virtual machine resource scheduling. This solves the problem in existing technologies where monitoring tools are slow to obtain information about physical server resource occupancy, leading to slow virtual machine resource scheduling. Therefore, this method significantly improves the speed of virtual machine resource scheduling.
Smart Images

Figure CN116893879B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a virtual machine management method, a virtual machine monitor, a computer-readable storage medium, and a virtual machine system. Background Technology
[0002] In the process of virtual machine management, existing monitoring tools are slow to obtain the resource usage of physical servers, resulting in slow virtual machine resource scheduling. They do not consider load balancing when scheduling virtual machine resources, causing some physical servers to be overloaded while others are idle. Furthermore, they do not consider virtual machine fault monitoring or the security of virtual machine access during virtual machine operation.
[0003] There is currently no solution in the existing technology for the above situation. Summary of the Invention
[0004] This application provides a virtual machine management method, a virtual machine monitor, a computer-readable storage medium, and a virtual machine system to at least solve the problem that existing monitoring tools are slow to obtain information on the resource usage of physical servers, resulting in slow virtual machine resource scheduling.
[0005] According to one embodiment of this application, a virtual machine management method is provided, applied to a virtual machine monitor. The virtual machine monitor is communicatively connected to a baseboard management controller, an application layer, and multiple virtual machines. The baseboard management controller is communicatively connected to multiple physical servers, each physical server comprising multiple components. The method includes: obtaining multiple pieces of first information from the application layer, each piece of first information corresponding to a virtual machine, the first information including the resource requirements of the corresponding virtual machine, the resources including the number of the multiple components and the capacity of each component; obtaining corresponding second information from the physical servers through the baseboard management controller, each piece of second information corresponding to a physical server, the second information including the idle resources of the corresponding physical server, the idle resources being the number of idle components and the capacity of the idle components in the physical server, the idle components being components in the physical server that are not fully occupied; and controlling the baseboard management controller to allocate the idle components to each virtual machine based on the first information and the second information.
[0006] In an exemplary embodiment, obtaining corresponding second information from the physical server through the baseboard management controller includes: sending third information and a callback function to the baseboard management controller using the User Datagram Protocol (UDP), wherein the third information is used to request the baseboard management controller to obtain the second information and execute the callback function, and the callback function is used to cause the baseboard management controller to send the second information to the virtual machine monitor; and receiving the second information.
[0007] In an exemplary embodiment, controlling the baseboard management controller to allocate the idle components to each of the virtual machines according to the first information and the second information includes: determining multiple resource allocation schemes using a load balancing algorithm according to the first information and the second information, wherein each resource allocation scheme corresponds one-to-one with a virtual machine, and each resource allocation scheme includes the number of idle components allocated to the corresponding virtual machine and the capacity of the idle components allocated to the corresponding virtual machine; and controlling the baseboard management controller to allocate the idle components to the corresponding virtual machine according to each resource allocation scheme.
[0008] In an exemplary embodiment, determining multiple resource allocation schemes using a load balancing algorithm based on the first information and the second information includes: configuring weights for each physical server according to the second information, wherein each weight corresponds one-to-one with the physical server, the weight of a physical server is positively correlated with the number of idle components of the physical server, and the weight of a physical server is positively correlated with the capacity of the idle components of the physical server; determining multiple resource allocation schemes based on each weight, wherein the number of idle components allocated to a physical server is positively correlated with the weight of the physical server, and the capacity of the idle components allocated to a physical server is positively correlated with the weight of the physical server.
[0009] In an exemplary embodiment, after controlling the baseboard management controller to allocate the idle components to each of the virtual machines according to the first information and the second information, the method further includes: obtaining a plurality of fourth information through the baseboard management controller, the fourth information corresponding one-to-one with the virtual machine, the fourth information including the operating parameters of the idle components allocated to the corresponding virtual machine, the operating parameters being used to characterize the operating state of the idle components; and determining whether the corresponding virtual machine has malfunctioned according to each of the fourth information.
[0010] In one exemplary embodiment, the fourth information further includes the data transmission speed between each of the components. The acquisition of multiple pieces of fourth information through the baseboard management controller includes: acquiring the operating parameters of the corresponding idle component through the baseboard management controller according to each communication protocol, wherein one communication protocol corresponds to one type of idle component; and controlling the baseboard management controller to acquire the data transmission speed between each of the idle components through the link.
[0011] In one exemplary embodiment, after controlling the baseboard management controller to allocate the idle components to each of the virtual machines according to the first information and the second information, the method further includes: configuring authentication information for the plurality of virtual machines and sending the authentication information to the baseboard management controller, such that the baseboard management controller only receives data from the virtual machines having the corresponding authentication information; and / or sending an access control list to the baseboard management controller, the access control list including at least a plurality of target addresses, one target address corresponding to one virtual machine, the target address being the physical address of the network interface of the virtual machine, and the baseboard management controller only receiving data from the target address.
[0012] According to one embodiment of this application, a virtual machine monitor is also provided. The virtual machine monitor is communicatively connected to a baseboard management controller, an application layer, and multiple virtual machines. The baseboard management controller is communicatively connected to multiple physical servers. Each physical server includes multiple components. The virtual machine monitor includes: a first acquisition module, configured to acquire multiple pieces of first information from the application layer, wherein each piece of first information corresponds to a virtual machine, and the first information includes the resource requirements of the corresponding virtual machine, wherein the resources include the number of multiple components and the capacity of each component; a second acquisition module, configured to acquire corresponding second information from the physical servers through the baseboard management controller, wherein each piece of second information corresponds to a physical server, and the second information includes the idle resources of the corresponding physical server, wherein the idle resources are the number of idle components and the capacity of the idle components in the physical server, and the idle components are the components in the physical server that are not fully occupied; and a control module, configured to control the baseboard management controller to allocate the idle components to each virtual machine according to the first information and the second information.
[0013] According to one embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program, when executed by a processor, implements the steps of any of the methods described herein.
[0014] According to one embodiment of this application, a virtual machine system is also provided, the virtual machine system comprising: a plurality of physical servers; a baseboard management controller, the baseboard management controller being communicatively connected to each of the physical servers; an application layer; and a virtualization layer, the virtualization layer comprising a virtual machine monitor and a plurality of virtual machines, the virtual machine monitor being communicatively connected to the baseboard management controller, the application layer and each of the virtual machines, the virtual machine monitor being used to implement the steps of the method described in any one of the embodiments.
[0015] This application utilizes the rapid data acquisition capability of the baseboard management controller (BMC). The virtual machine monitor (VM) controls the BMC to quickly obtain the number and capacity of unoccupied components in the physical server. Based on this data, the unoccupied components are allocated to virtual machines, thereby improving the speed of virtual machine resource scheduling. This solves the problem in existing technologies where monitoring tools are slow to obtain information about physical server resource occupancy, leading to slow virtual machine resource scheduling. Therefore, this method significantly improves the speed of virtual machine resource scheduling. Attached Figure Description
[0016] Figure 1 This is a flowchart of a virtual machine management method according to an embodiment of this application;
[0017] Figure 2 This is a structural block diagram of a virtual machine monitor according to an embodiment of this application. Detailed Implementation
[0018] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0020] This embodiment provides a method running on a virtual machine monitor, wherein the virtual machine monitor is communicatively connected to a baseboard management controller, an application layer, and multiple virtual machines, and the baseboard management controller is communicatively connected to multiple physical servers, each physical server comprising multiple components. Figure 1 This is a flowchart according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:
[0021] Step S102: Obtain multiple pieces of first information from the application layer. Each piece of first information corresponds to a virtual machine. The first information includes the resources required by the corresponding virtual machine. The resources include the quantity of multiple components and the capacity of each component.
[0022] Specifically, the aforementioned components include the central processing unit (CPU), memory, and hard disk in the physical server.
[0023] Step S104: Obtain corresponding second information from the physical server through the aforementioned baseboard management controller. The second information corresponds one-to-one with the physical server and includes the idle resources of the corresponding physical server.
[0024] The aforementioned idle resources refer to the number and capacity of idle components in the aforementioned physical server, and the aforementioned idle components are the components in the aforementioned physical server that are not fully occupied.
[0025] Specifically, the Baseboard Management Controller (BMC) has an independent network interface and management functions. Compared with traditional monitoring tools, the Baseboard Management Controller can remotely monitor and manage multiple physical servers through the network. Management operations can be performed without physical contact with the physical servers. In addition, while traditional monitoring tools acquire data once per minute, the Baseboard Management Controller can acquire data once every few seconds. Through the Baseboard Management Controller, the corresponding secondary information can be quickly obtained from the physical servers.
[0026] The above step S104 can be implemented as follows:
[0027] Using the User Datagram Protocol (UDP), the third information and the callback function are sent to the aforementioned baseboard management controller. The third information is used to request the aforementioned baseboard management controller to obtain the aforementioned second information and execute the aforementioned callback function. The callback function is used to cause the aforementioned baseboard management controller to send the aforementioned second information to the aforementioned virtual machine monitor.
[0028] Receive the second piece of information mentioned above.
[0029] In this embodiment, the communication protocol between the Virtual Machine Monitor (VM Monitor) and the Baseboard Management Controller (BMC) is optimized. User Datagram Protocol (UDP) is used to complete the communication between the VM Monitor and the BMC. UDP has lower communication latency and less network overhead, enabling faster data transmission. A callback function is used to complete the communication between the VM Monitor and the BMC. The specific process is as follows: Initiating a communication request: The VM Monitor calls an appropriate asynchronous communication function to send third information to the BMC and passes a callback function as a parameter to the BMC; Processing the communication request: Upon receiving the third information, the BMC obtains the second information. After obtaining the second information, it calls the pre-registered callback function; Execution of the callback function: The callback function is triggered in the BMC and begins to execute specific operations, such as sending the second information to the VM Monitor; The VM Monitor receives the second information. The virtual machine monitor needs to define appropriate callback functions in advance to ensure that the callback functions match the communication interface of the baseboard management controller. By using callback functions, the virtual machine monitor and the baseboard management controller can achieve asynchronous communication, decouple operations and improve system responsiveness and efficiency. The execution of callback functions can be completed without blocking the main thread, thus allowing the virtual machine monitor to perform other operations at the same time.
[0030] The above step S104 can be implemented as follows:
[0031] Using the aforementioned User Datagram Protocol, the fourth information and the key are sent to the aforementioned Baseboard Management Controller. The fourth information is used to represent a request to the aforementioned Baseboard Management Controller to obtain the aforementioned second information, to encrypt the aforementioned second information using the aforementioned key, and to send the encrypted aforementioned second information to the aforementioned Virtual Machine Monitor.
[0032] Receive the encrypted version of the second information mentioned above.
[0033] In this embodiment, encrypted transmission is used to complete the communication between the virtual machine monitor and the baseboard management controller, ensuring the security of the communication between the virtual machine monitor and the baseboard management controller.
[0034] Step S106: Based on the first information and the second information, control the baseboard management controller to allocate the idle components to each of the virtual machines.
[0035] The above step S106 can be implemented as follows:
[0036] Step S1061: Based on the first information and the second information, a load balancing algorithm is used to determine multiple resource allocation schemes. Each resource allocation scheme corresponds to a virtual machine. Each resource allocation scheme includes the number of idle components allocated to the corresponding virtual machine and the capacity of the idle components allocated to the corresponding virtual machine.
[0037] The above step S1061 can be implemented as follows:
[0038] According to the second information above, each physical server is assigned a weight. The weight corresponds one-to-one with the physical server. The weight of the physical server is positively correlated with the number of idle components of the physical server. The weight of the physical server is positively correlated with the capacity of the idle components of the physical server.
[0039] Based on the aforementioned weights, multiple resource allocation schemes are determined. The number of idle components allocated to the physical server is positively correlated with the weight of the physical server, and the capacity of the idle components allocated to the physical server is positively correlated with the weight of the physical server.
[0040] In this embodiment, a weighted load balancing algorithm is employed in some implementations. Based on the resources required by virtual machines and the available resources of the physical server, the idle resources of the physical server are allocated to different virtual machines to achieve optimal load balancing. The weight is related to the number and capacity of idle components on the physical server. Physical servers with more idle components and larger idle component capacity have higher weights because they can support more virtual machines and applications. Furthermore, the weight of a physical server is positively correlated with the utilization rate of physical server resources and the performance of the physical server (CPU performance, memory speed, and network bandwidth, etc.). Higher resource utilization rates result in higher weights for the physical server, allowing for more efficient use of its idle resources. Physical servers with better performance have higher weights to provide higher computing and transmission capabilities. Weights are assigned to each server, and the allocation of idle resources is determined based on the weight ratio to better utilize the idle resources of the physical server.
[0041] Step S1062: According to each of the above resource allocation schemes, control the baseboard management controller to allocate the above idle components to the corresponding virtual machines.
[0042] In this embodiment, by monitoring the resources required by virtual machines and the idle resources of physical servers in real time, a load balancing algorithm is used to automatically and intelligently allocate the idle resources of physical servers to different virtual machines, so as to achieve load balancing, improve resource utilization, and improve the performance and efficiency of the virtualization environment.
[0043] Following step S106, the above method further includes:
[0044] Step S202: Obtain multiple pieces of fourth information through the aforementioned baseboard management controller. Each piece of fourth information corresponds to a virtual machine. The fourth information includes the operating parameters of the idle components allocated to the corresponding virtual machines. The operating parameters are used to characterize the operating status of the idle components.
[0045] The fourth piece of information mentioned above also includes the data transmission speed between the aforementioned components, and step S202 can be implemented as follows:
[0046] According to each communication protocol, the operating parameters of the corresponding idle component are obtained through the baseboard management controller, and one communication protocol corresponds to one idle component.
[0047] The aforementioned baseboard management controller controls the data transmission speed between the aforementioned idle components via a link.
[0048] In this embodiment, the operating parameters of the corresponding idle components are obtained through communication protocols. For example, the Simple Network Management Protocol (SNMP) is used to monitor indicators such as network interface traffic and bandwidth, and the Intelligent Platform Management Interface (IPMI) is used to monitor the operating parameters of hardware sensors. The aforementioned baseboard management controller is controlled to obtain the data transmission speed between each idle component through the link. For example, the data transmission speed between components such as the central processing unit, memory, and hard disk can be monitored through the link. In addition, a dedicated channel can be used to monitor the data transmission between the network interface and the storage device. Different protocols, links, and channels can be combined to build a complete monitoring system to achieve comprehensive monitoring and analysis of various components of the physical server. The unique feature of this connection is that it can flexibly adapt to various monitoring needs and can use different technologies and protocols to process various monitoring data to improve the efficiency and accuracy of monitoring.
[0049] Step S204: Based on the aforementioned fourth information, determine whether the corresponding virtual machine has malfunctioned.
[0050] In this embodiment, the baseboard management controller can obtain the operating parameters of the idle components allocated to the corresponding virtual machine, such as the utilization rate of the central processing unit, the capacity of the memory, the capacity of the hard disk, the speed of the fan, and the status of the power supply. Based on the operating parameters of the idle components allocated to the corresponding virtual machine, it can determine whether the virtual machine has failed, realize the fault monitoring of the virtual machine, and ensure the continuity, stability and reliability of the virtualization environment.
[0051] Following step S106, the method further includes:
[0052] Configuring authentication information for multiple virtual machines and sending the authentication information to the baseboard management controller, so that the baseboard management controller only receives data from the virtual machines with the corresponding authentication information;
[0053] And / or,
[0054] The access control list is sent to the baseboard management controller. The access control list includes at least a plurality of target addresses, one of which corresponds to one of the virtual machines. The target address is the physical address of the network interface of the virtual machine. The baseboard management controller only receives data from the target addresses.
[0055] In this embodiment, authentication information is configured for multiple virtual machines, so that the baseboard management controller only receives data from virtual machines with corresponding authentication information, and / or, by configuring access control lists, unnecessary traffic is filtered and blocked to prevent accidental hacker attacks and network threats.
[0056] Through the above steps, this method leverages the rapid data acquisition speed of the baseboard management controller (BMC). The virtual machine monitor (VM) controls the BMC to quickly obtain the number and capacity of unused components in the physical server. Based on this data, the unused components are allocated to virtual machines, thereby improving the speed of virtual machine resource scheduling. This solves the problem in existing technologies where monitoring tools are slow to obtain information about physical server resource occupancy, leading to slow virtual machine resource scheduling. Therefore, this method significantly improves the speed of virtual machine resource scheduling.
[0057] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0058] This embodiment also provides a virtual machine monitor for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the virtual machine monitor described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0059] Figure 2 This is a structural block diagram of a virtual machine monitor according to an embodiment of this application. The virtual machine monitor is communicatively connected to the baseboard management controller, the application layer, and multiple virtual machines. The baseboard management controller is communicatively connected to multiple physical servers, and the physical servers include multiple components, such as... Figure 2 As shown, the virtual machine monitor includes a first acquisition module 22, a second acquisition module 24, and a control module 26.
[0060] The first acquisition module 22 is used to acquire multiple pieces of first information from the application layer. Each piece of first information corresponds to a virtual machine. The first information includes the resources required by the corresponding virtual machine. The resources include the quantity of the multiple components and the capacity of each component.
[0061] Specifically, the aforementioned components include the central processing unit (CPU), memory, and hard disk in the physical server.
[0062] The second acquisition module 24 is used to acquire corresponding second information from the physical server through the baseboard management controller. The second information corresponds one-to-one with the physical server and includes the idle resources of the corresponding physical server.
[0063] The aforementioned idle resources refer to the number and capacity of idle components in the aforementioned physical server, and the aforementioned idle components are the components in the aforementioned physical server that are not fully occupied.
[0064] Specifically, the Baseboard Management Controller (BMC) has an independent network interface and management functions. Compared with traditional monitoring tools, the Baseboard Management Controller can remotely monitor and manage multiple physical servers through the network. Management operations can be performed without physical contact with the physical servers. In addition, while traditional monitoring tools acquire data once per minute, the Baseboard Management Controller can acquire data once every few seconds. Through the Baseboard Management Controller, the corresponding secondary information can be quickly obtained from the physical servers.
[0065] The aforementioned second acquisition module includes a first sending submodule and a first receiving submodule.
[0066] The first sending submodule is used to send the third information and the callback function to the baseboard management controller using the User Datagram Protocol. The third information is used to request the baseboard management controller to obtain the second information and execute the callback function. The callback function is used to cause the baseboard management controller to send the second information to the virtual machine monitor.
[0067] The first receiving submodule is used to receive the second information.
[0068] In this embodiment, the communication protocol between the Virtual Machine Monitor (VM Monitor) and the Baseboard Management Controller (BMC) is optimized. User Datagram Protocol (UDP) is used to complete the communication between the VM Monitor and the BMC. UDP has lower communication latency and less network overhead, enabling faster data transmission. A callback function is used to complete the communication between the VM Monitor and the BMC. The specific process is as follows: Initiating a communication request: The VM Monitor calls an appropriate asynchronous communication function to send third information to the BMC and passes a callback function as a parameter to the BMC; Processing the communication request: Upon receiving the third information, the BMC obtains the second information. After obtaining the second information, it calls the pre-registered callback function; Execution of the callback function: The callback function is triggered in the BMC and begins to execute specific operations, such as sending the second information to the VM Monitor; The VM Monitor receives the second information. The virtual machine monitor needs to define appropriate callback functions in advance to ensure that the callback functions match the communication interface of the baseboard management controller. By using callback functions, the virtual machine monitor and the baseboard management controller can achieve asynchronous communication, decouple operations and improve system responsiveness and efficiency. The execution of callback functions can be completed without blocking the main thread, thus allowing the virtual machine monitor to perform other operations at the same time.
[0069] The aforementioned second acquisition module includes a second sending submodule and a second receiving submodule.
[0070] The second sending submodule is used to send the fourth information and the key to the baseboard management controller using the user datagram protocol. The fourth information is used to indicate that the baseboard management controller is requested to obtain the second information, the second information is encrypted using the key, and the encrypted second information is sent to the virtual machine monitor.
[0071] The second receiving submodule is used to receive the encrypted second information.
[0072] In this embodiment, encrypted transmission is used to complete the communication between the virtual machine monitor and the baseboard management controller, ensuring the security of the communication between the virtual machine monitor and the baseboard management controller.
[0073] The control module 26 is used to control the baseboard management controller to allocate the idle components to each of the virtual machines according to the first information and the second information.
[0074] The aforementioned control module includes a determination submodule and a first control submodule.
[0075] The aforementioned determining submodule is used to determine multiple resource allocation schemes based on the aforementioned first information and the aforementioned second information using a load balancing algorithm. Each resource allocation scheme corresponds one-to-one with the aforementioned virtual machine. Each resource allocation scheme includes the number of the aforementioned idle components allocated to the corresponding virtual machine and the capacity of the aforementioned idle components allocated to the corresponding virtual machine.
[0076] The aforementioned determination submodule includes a configuration unit and a determination unit.
[0077] The configuration unit is used to configure weights for each physical server according to the second information. Each weight corresponds to a physical server. The weight of a physical server is positively correlated with the number of idle components of the physical server and the weight of a physical server is positively correlated with the capacity of the idle components of the physical server.
[0078] The aforementioned determining unit is used to determine multiple resource allocation schemes based on the aforementioned weights. The number of idle components allocated to the aforementioned physical server is positively correlated with the aforementioned weight of the aforementioned physical server, and the capacity of the idle components allocated to the aforementioned physical server is positively correlated with the aforementioned weight of the aforementioned physical server.
[0079] In this embodiment, a weighted load balancing algorithm is employed in some implementations. Based on the resources required by virtual machines and the available resources of the physical server, the idle resources of the physical server are allocated to different virtual machines to achieve optimal load balancing. The weight is related to the number and capacity of idle components on the physical server. Physical servers with more idle components and larger idle component capacity have higher weights because they can support more virtual machines and applications. Furthermore, the weight of a physical server is positively correlated with the utilization rate of physical server resources and the performance of the physical server (CPU performance, memory speed, and network bandwidth, etc.). Higher resource utilization rates result in higher weights for the physical server, allowing for more efficient use of its idle resources. Physical servers with better performance have higher weights to provide higher computing and transmission capabilities. Weights are assigned to each server, and the allocation of idle resources is determined based on the weight ratio to better utilize the idle resources of the physical server.
[0080] The first control submodule is used to control the baseboard management controller to allocate the idle components to the corresponding virtual machines according to the above-mentioned resource allocation schemes.
[0081] In this embodiment, by monitoring the resources required by virtual machines and the idle resources of physical servers in real time, a load balancing algorithm is used to automatically and intelligently allocate the idle resources of physical servers to different virtual machines, so as to achieve load balancing, improve resource utilization, and improve the performance and efficiency of the virtualization environment.
[0082] The aforementioned virtual machine monitor also includes a third acquisition module and a judgment module.
[0083] The third acquisition module is used to acquire multiple pieces of fourth information through the baseboard management controller. The fourth information corresponds one-to-one with the virtual machine. The fourth information includes the operating parameters of the idle components allocated to the corresponding virtual machine. The operating parameters are used to characterize the operating status of the idle components.
[0084] The fourth piece of information mentioned above also includes the data transmission speed between the aforementioned components. The third acquisition module includes an acquisition submodule and a second control submodule.
[0085] The aforementioned acquisition submodule is used to acquire the operating parameters of the corresponding idle component through the aforementioned baseboard management controller according to each communication protocol, wherein one of the aforementioned communication protocols corresponds to one of the aforementioned idle components.
[0086] The second control submodule is used to control the baseboard management controller to obtain the data transmission speed between the idle components via the link.
[0087] In this embodiment, the operating parameters of the corresponding idle components are obtained through communication protocols. For example, the Simple Network Management Protocol (SNMP) is used to monitor indicators such as network interface traffic and bandwidth, and the Intelligent Platform Management Interface (IPMI) is used to monitor the operating parameters of hardware sensors. The aforementioned baseboard management controller is controlled to obtain the data transmission speed between each idle component through the link. For example, the data transmission speed between components such as the central processing unit, memory, and hard disk can be monitored through the link. In addition, a dedicated channel can be used to monitor the data transmission between the network interface and the storage device. Different protocols, links, and channels can be combined to build a complete monitoring system to achieve comprehensive monitoring and analysis of various components of the physical server. The unique feature of this connection is that it can flexibly adapt to various monitoring needs and can use different technologies and protocols to process various monitoring data to improve the efficiency and accuracy of monitoring.
[0088] The aforementioned judgment module is used to determine whether the corresponding virtual machine has malfunctioned based on each of the aforementioned fourth pieces of information.
[0089] In this embodiment, the baseboard management controller can obtain the operating parameters of the idle components allocated to the corresponding virtual machine, such as the utilization rate of the central processing unit, the capacity of the memory, the capacity of the hard disk, the speed of the fan, and the status of the power supply. Based on the operating parameters of the idle components allocated to the corresponding virtual machine, it can determine whether the virtual machine has failed, realize the fault monitoring of the virtual machine, and ensure the continuity, stability and reliability of the virtualization environment.
[0090] The virtual machine monitors mentioned above include:
[0091] The first sending module is configured to configure identity authentication information for multiple virtual machines and send the identity authentication information to the baseboard management controller, so that the baseboard management controller only receives data from the virtual machines with the corresponding identity authentication information;
[0092] And / or,
[0093] The second sending module is used to send the access control list to the baseboard management controller. The access control list includes at least a plurality of target addresses, one of the target addresses corresponds to one of the virtual machines, and the target address is the physical address of the network interface of the virtual machine. The baseboard management controller only receives data from the target addresses.
[0094] In this embodiment, authentication information is configured for multiple virtual machines, so that the baseboard management controller only receives data from virtual machines with corresponding authentication information, and / or, by configuring access control lists, unnecessary traffic is filtered and blocked to prevent accidental hacker attacks and network threats.
[0095] Through the above steps, this method leverages the rapid data acquisition speed of the baseboard management controller (BMC). The virtual machine monitor (VM) controls the BMC to quickly obtain the number and capacity of unused components in the physical server. Based on this data, the unused components are allocated to virtual machines, thereby improving the speed of virtual machine resource scheduling. This solves the problem in existing technologies where monitoring tools are slow to obtain information about physical server resource occupancy, leading to slow virtual machine resource scheduling. Therefore, this method significantly improves the speed of virtual machine resource scheduling.
[0096] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0097] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0098] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0099] An embodiment of this application also provides a virtual machine system, which includes: multiple physical servers; a baseboard management controller, which is communicatively connected to each of the physical servers; an application layer; and a virtualization layer, which includes a virtual machine monitor and multiple virtual machines. The virtual machine monitor is communicatively connected to the baseboard management controller, the application layer, and each of the virtual machines. The virtual machine monitor is used to implement the virtual machine management method.
[0100] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0101] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0102] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for managing virtual machines, characterized in that, Applied to a hypervisor, the hypervisor is in communication connection with a baseboard management controller, an application layer and a plurality of virtual machines respectively, the baseboard management controller is in communication connection with a plurality of physical servers respectively, and the physical server comprises a plurality of components. The method comprises: acquiring a plurality of first information from the application layer, wherein the first information is in one-to-one correspondence with the virtual machines, the first information comprises required resources of a corresponding virtual machine, and the resources comprise the number of a plurality of said components and the capacity of each said component; acquiring corresponding second information from the physical servers through the baseboard management controller, wherein the second information is in one-to-one correspondence with the physical servers, the second information comprises idle resources of a corresponding physical server, the idle resources are the number of idle components and the capacity of the idle components in the physical server, and the idle components are said components that are not fully occupied in the physical server; controlling, according to the first information and the second information, the baseboard management controller to allocate the idle components to each said virtual machine; acquiring corresponding second information from the physical server through the baseboard management controller comprises: sending third information and a callback function to the baseboard management controller by adopting a user datagram protocol, wherein the third information is used for requesting the baseboard management controller to acquire the second information and execute the callback function, and the callback function is used for enabling the baseboard management controller to send the second information to the hypervisor; and receiving the second information.
2. The method according to claim 1, characterized in that, controlling, according to the first information and the second information, the baseboard management controller to allocate the idle components to each said virtual machine comprises: determining a plurality of resource allocation schemes by adopting a load balancing algorithm according to the first information and the second information, wherein the resource allocation schemes are in one-to-one correspondence with the virtual machines, and the resource allocation schemes comprise the number of the idle components allocated to a corresponding virtual machine and the capacity of the idle components allocated to the corresponding virtual machine; controlling, according to each said resource allocation scheme, the baseboard management controller to allocate the idle components to the corresponding virtual machines.
3. The method according to claim 2, characterized in that, determining a plurality of resource allocation schemes by adopting a load balancing algorithm according to the first information and the second information comprises: configuring a weight for each said physical server according to the second information, wherein the weights are in one-to-one correspondence with the physical servers, the weight of a physical server is positively correlated with the number of the idle components of the physical server, and the weight of the physical server is positively correlated with the capacity of the idle components of the physical server; determining a plurality of said resource allocation schemes according to each said weight, wherein the number of the idle components allocated in the physical server is positively correlated with the weight of the physical server, and the capacity of the idle components allocated in the physical server is positively correlated with the weight of the physical server.
4. The method according to claim 1, characterized in that, after controlling, according to the first information and the second information, the baseboard management controller to allocate the idle components to each said virtual machine, the method further comprises: Multiple pieces of fourth information are obtained through the baseboard management controller. Each piece of fourth information corresponds to a virtual machine. The fourth information includes the operating parameters of the idle component allocated to the corresponding virtual machine. The operating parameters are used to characterize the operating status of the idle component. Based on each of the fourth pieces of information, determine whether the corresponding virtual machine has malfunctioned.
5. The method according to claim 4, characterized in that, The fourth information also includes the data transmission speed between the components. Multiple pieces of fourth information are obtained through the substrate management controller, including: According to each communication protocol, the operating parameters of the corresponding idle component are obtained through the baseboard management controller, and one communication protocol corresponds to one idle component; The baseboard management controller controls the data transmission speed between the idle components via a link.
6. The method according to claim 1, characterized in that, After controlling the baseboard management controller to allocate the idle components to each of the virtual machines based on the first information and the second information, the method further includes: Configuring authentication information for multiple virtual machines and sending the authentication information to the baseboard management controller, so that the baseboard management controller only receives data from the virtual machines with the corresponding authentication information; And / or, The access control list is sent to the baseboard management controller. The access control list includes at least a plurality of target addresses, each target address corresponding to a virtual machine. The target address is the physical address of the network interface of the virtual machine. The baseboard management controller only receives data from the target addresses.
7. A virtual machine monitor, characterized in that, The virtual machine monitor is communicatively connected to the baseboard management controller, the application layer, and multiple virtual machines. The baseboard management controller is communicatively connected to multiple physical servers, each physical server comprising multiple components. The virtual machine monitor includes: The first acquisition module is used to acquire multiple pieces of first information from the application layer. Each piece of first information corresponds to a virtual machine. The first information includes the resources required by the corresponding virtual machine. The resources include the quantity of multiple components and the capacity of each component. The second acquisition module is used to acquire corresponding second information from the physical server through the baseboard management controller. The second information corresponds one-to-one with the physical server. The second information includes the idle resources of the corresponding physical server. The idle resources are the number of idle components and the capacity of the idle components in the physical server. The idle components are the components in the physical server that are not fully occupied. The control module is configured to control the baseboard management controller to allocate the idle components to each of the virtual machines based on the first information and the second information; The second acquisition module includes a first sending submodule and a first receiving submodule. The first sending submodule is used to: send third information and a callback function to the baseboard management controller using the User Datagram Protocol (UDP). The third information is used to request the baseboard management controller to acquire the second information and execute the callback function. The callback function is used to cause the baseboard management controller to send the second information to the virtual machine monitor. The first receiving submodule is used to receive the second information.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 6.
9. A virtual machine system, characterized in that, The virtual machine system includes: Multiple physical servers; A baseboard management controller, which is communicatively connected to each of the physical servers; Application layer; A virtualization layer, comprising a virtual machine monitor and multiple virtual machines, wherein the virtual machine monitor is communicatively connected to the baseboard management controller, the application layer and each of the virtual machines, and the virtual machine monitor is used to implement the steps of the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Virtual machine resource scheduling method and system for server clusters
CN103605574A
Computer system for BMC resource management
CN106980529A