CN111338758A - Resource management method and device and electronic equipment - Google Patents

Resource management method and device and electronic equipment Download PDF

Info

Publication number
CN111338758A
CN111338758A CN202010115431.8A CN202010115431A CN111338758A CN 111338758 A CN111338758 A CN 111338758A CN 202010115431 A CN202010115431 A CN 202010115431A CN 111338758 A CN111338758 A CN 111338758A
Authority
CN
China
Prior art keywords
request
metadata
resource
node
target node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010115431.8A
Other languages
Chinese (zh)
Inventor
邹盼霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chinac Data Xiamen Network Co ltd
Original Assignee
Chinac Data Xiamen Network Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chinac Data Xiamen Network Co ltd filed Critical Chinac Data Xiamen Network Co ltd
Priority to CN202010115431.8A priority Critical patent/CN111338758A/en
Publication of CN111338758A publication Critical patent/CN111338758A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a resource management method, a resource management device and electronic equipment, which are applied to a resource scheduler, wherein the method comprises the following steps: receiving a request which is sent by a metadata manager and represents that a virtual machine and/or a container needs to be created, wherein the request comprises the size of resources needed for creating the virtual machine and/or the container; responding to the request, and acquiring metadata of all nodes in the same cluster from a metadata manager; determining a target node from all nodes based on the metadata and the size of the required resource, wherein the target node is a node matched with the size of the required resource; and generating and sending a resource allocation request to the metadata manager based on the unique identifier and the request of the target node so that the metadata manager sends the resource allocation request to the node manager corresponding to the target node, wherein the resource allocation request is used for indicating the node manager to create a virtual machine and/or a container in the target node, so that the unified management of the virtual machine and/or the container is realized, and the management cost is reduced.

Description

Resource management method and device and electronic equipment
Technical Field
The application relates to the technical field of cloud computing, in particular to a resource management method and device and electronic equipment.
Background
With the popularity and deployment of cloud computing, computer applications are beginning to be deployed in large numbers in the infrastructure provided by cloud computing. These infrastructures contain virtual machines and also containers. Traditional applications are suitable for migration and running in virtual machines, micro-service or native cloud applications are suitable for running in containers. The virtual machine and the container have respective management control platforms. For example, the virtual machine has an OpenStack management control platform, and the container has a Docker Swarm, Kubernetes management control platform.
The management control platform is a complex system, and the managed content comprises calculation, network and the like. The virtual machine management control platform manages metadata of the virtual machine cluster, the metadata comprises resource use conditions on statistical nodes and management network information, the management network information comprises an Interconnection Protocol (IP) address, a network and a subnet, and the virtual machine management control platform allocates resources such as the network to the virtual machine according to the management network information. Similarly, the container management control platform manages the metadata of the container cluster itself, and allocates resources such as network to the container based on the metadata.
In the prior art, the part of the application that can be deployed in the virtual machine is typically deployed in a virtual machine cluster, and the micro-service or native cloud application is deployed in a container cluster, but this approach may increase the management burden.
Content of application
In view of this, an object of the present invention is to provide a resource management method, device and electronic device, so as to reduce the management cost of a virtual machine and a container.
In a first aspect, an embodiment of the present application provides a resource management method, which is applied to a resource scheduler, and the method includes: receiving a request sent by a metadata manager and used for representing that a virtual machine and/or a container needs to be created, wherein the request comprises the size of resources needed for creating the virtual machine and/or the container; responding to the request, and acquiring metadata of all nodes in the same cluster from the metadata manager; determining a target node from all the nodes based on the metadata and the size of the required resource, wherein the target node is a node matched with the size of the required resource; and generating and sending a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, wherein the resource allocation request is used for instructing the node manager to create the virtual machine and/or the container in the target node.
In the implementation process, by creating the virtual machines and the containers in the nodes in the same cluster, the virtual machines and the containers in the same cluster can directly communicate, but also enables the resource scheduler to retrieve the metadata of all nodes in the same cluster from the metadata manager, and based on the request sent by the metadata manager to characterize the need to create a virtual machine and/or container, and the metadata, determining a target node from all the nodes, and generating and sending a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, and the metadata manager sends the resource allocation request to the node manager corresponding to the target node, so that unified management of the virtual machine and/or the container is realized, and the management cost is reduced.
Based on the first aspect, in one possible design, determining a target node from the all nodes based on the metadata and the size of the required resource includes: determining a first node matched with the size of the required resource from all the nodes based on the metadata and the size of the required resource; when the number of the matched first nodes is at least two, determining a node with the most residual resources from the matched first nodes based on the metadata of the matched first nodes; and the node with the most residual resources is the target node.
In the implementation process, when the number of the matched first nodes is at least two, the node with the most remaining resources is determined from the matched first nodes to create the virtual machine and/or the container, and then load balancing of the nodes is implemented.
Based on the first aspect, in one possible design, determining a target node from the all nodes based on the metadata and the size of the required resource includes: determining a second node matched with the size of the required resource from all the nodes based on the metadata and the size of the required resource; when the number of the matched second nodes is at least two, determining a node which has created the network to be accessed from the matched second nodes based on the metadata of the matched second nodes and the network information of the network to be accessed in the request; wherein the node where the network to be accessed exists is the target node.
In the implementation process, when the number of the matched second nodes is at least two, the nodes which have created the network to be accessed are determined from the matched second nodes to create the virtual machines and/or the containers based on the metadata of the matched second nodes and the network information of the network to be accessed in the request, so that the cost for creating the network is reduced.
In a second aspect, an embodiment of the present application provides a resource management method, which is applied to a node manager, and the method includes: receiving a request sent by a metadata manager and representing that a virtual machine and/or a container needs to be created, wherein the request comprises: a unique identification of a target node, configuration information of the virtual machine and/or the container; creating the virtual machine and/or the container in the target node based on the request; and sending the metadata of the target node to the metadata manager.
In the prior art, the virtual machines are usually deployed in different virtual machine clusters, and the containers are deployed in the container clusters, which not only increases the management cost for managing the virtual machines and the containers, but also causes the virtual machines and the containers to be unable to communicate directly, because when the virtual machines and the containers communicate, they usually need to establish communication with the cluster gateway of the other party after establishing communication with the router and the gateway in their own cluster, which may cause heavy pressure on network components of the cluster for applications with large amount of traffic transmission among the components, and some applications may be limited by the network bandwidth across the cluster, and at the same time, a lengthy network transmission chain may also increase the time delay and reduce the performance of the applications, so, in order to solve the above problems, in the implementation process, because the metadata manager can uniformly manage the metadata of the nodes in the same cluster, and the node manager receives a request which is sent by the metadata manager and represents that a virtual machine and/or a container needs to be created, and creates the virtual machine and the container in the nodes in the same cluster, so that the virtual machine and the container can be directly communicated, the metadata manager can uniformly manage the virtual machine and the container in the same cluster, and the management cost is reduced.
In a possible design based on the first aspect, the request further includes: creating the virtual machine and/or the container in the target node based on the request, wherein the network segment and the network number of the network to be created comprise: sending the request to a network manager located on the target node to cause the network manager to create the network in the target node based on the network segment and the network number; receiving prompt information which is sent by the network manager and represents that the network is established; creating the virtual machine and/or the container in the target node in response to the hint information to enable the virtual machine and/or the container to access the network.
In the implementation process, before the virtual machine and/or the container are created in the target node, the network manager located on the target node is controlled to create a network for the virtual machine and/or the container based on the network segment and the network number of the network to be created in the request, so that the virtual machine and/or the container can successfully access the network.
In a third aspect, an embodiment of the present application provides a resource management method, which is applied to a metadata manager, and the method includes: receiving a creation request which is sent by a request end and represents that a virtual machine and/or a container needs to be created; wherein, the creating request comprises the size of the resource required by the virtual machine and/or the container; sending the creation request to a resource scheduler; receiving a metadata acquisition request sent by the resource scheduler; responding to the acquisition request, and sending pre-stored metadata of all nodes in the same cluster to the resource scheduler so that the resource scheduler generates a resource allocation request based on the metadata and the creation request; wherein the resource allocation request includes: the unique identification of the target node and the creation request; receiving the resource allocation request returned by the resource scheduler; sending the resource allocation request to a node manager corresponding to the target node, wherein the resource allocation request is used for instructing the node manager to create the virtual machine and/or the container in the target node.
In the implementation process, by creating the virtual machines and the containers in the nodes in the same cluster, the virtual machines and the containers in the same cluster can directly communicate, but also enables the resource scheduler to retrieve the metadata of all nodes in the same cluster from the metadata manager, and based on the request sent by the metadata manager to characterize the need to create a virtual machine and/or container, and the metadata, determining a target node from all the nodes, and generating and sending a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, and the metadata manager sends the resource allocation request to the node manager corresponding to the target node, so that the unified management of the virtual machine and/or the container is realized, and the management cost is reduced.
In a fourth aspect, an embodiment of the present application provides a resource management apparatus, which is applied to a resource scheduler, and the apparatus includes: a request receiving unit, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes a size of a resource needed to create the virtual machine and/or the container; a response unit, configured to respond to the request, and obtain metadata of all nodes located in the same cluster from the metadata manager; a target node determining unit, configured to determine a target node from the all nodes based on the metadata and the size of the required resource, where the target node is a node that matches the size of the required resource; an allocation request sending unit, configured to generate and send a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
Based on the fourth aspect, in a possible design, the target node determining unit is specifically configured to determine, based on the metadata and the size of the required resource, a first node that matches the size of the required resource from all the nodes; when the number of the matched first nodes is at least two, determining a node with the most residual resources from the matched first nodes based on the metadata of the matched first nodes; and the node with the most residual resources is the target node.
In a possible design based on the fourth aspect, the target node determining unit is further configured to determine, based on the metadata and the size of the required resource, a second node that matches the size of the required resource from all the nodes; when the number of the matched second nodes is at least two, determining a node which has created the network to be accessed from the matched second nodes based on the metadata of the matched second nodes and the network information of the network to be accessed in the request; wherein the node where the network to be accessed exists is the target node.
In a fifth aspect, an embodiment of the present application provides a resource management apparatus, which is applied to a node manager, and the apparatus includes: an allocation request receiving unit, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes: a unique identification of a target node, configuration information of the virtual machine and/or the container; a creating unit, configured to create the virtual machine and/or the container in the target node based on the request; and the target node metadata sending unit is used for sending the metadata of the target node to the metadata manager.
In a possible design based on the fifth aspect, the request further includes: the creating unit is specifically configured to send the request to a network manager located on the target node, so that the network manager creates the network in the target node based on the network segment and the network number; receiving prompt information which is sent by the network manager and represents that the network is established; creating the virtual machine and/or the container in the target node in response to the hint information to enable the virtual machine and/or the container to access the network.
In a sixth aspect, an embodiment of the present application provides a resource management apparatus, which is applied to a metadata manager, and the apparatus includes: the system comprises a creation request receiving unit, a virtual machine creating unit and a container creating unit, wherein the creation request receiving unit is used for receiving a creation request which is sent by a request end and indicates that a virtual machine and/or a container needs to be created; wherein, the creating request comprises the size of the resource required by the virtual machine and/or the container; a creation request sending unit, configured to send the creation request to a resource scheduler; an acquisition request receiving unit, configured to receive a metadata acquisition request sent by the resource scheduler; a metadata sending unit, configured to send, in response to the acquisition request, metadata of all nodes located in the same cluster, which are stored in advance, to the resource scheduler, so that the resource scheduler generates a resource allocation request based on the metadata and the creation request; wherein the resource allocation request includes: the unique identification of the target node and the creation request; a resource allocation request receiving unit, configured to receive the resource allocation request returned by the resource scheduler; a resource allocation request sending unit, configured to send the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
In a seventh aspect, an embodiment of the present application provides an electronic device, including a processor and a memory connected to the processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device is caused to perform the method of the first aspect, the second aspect, or the third aspect.
In an eighth aspect, the present application provides a storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the method of the first aspect, the second aspect, or the third aspect.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic structural diagram of a resource management system according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a resource management method according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a resource management device according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of another resource management device according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of another resource management apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a resource management system according to an embodiment of the present application, where the system includes: the metadata manager is respectively in communication connection with the resource scheduler and the node manager, in this embodiment of the application, the number of the at least one node is two, the at least one node is located in the same cluster, each of the at least one node may be configured with a virtual machine or a container, the metadata manager and the resource scheduler operate on one node other than the at least one node, and each of the at least one node has one node manager operating thereon.
In other embodiments, the number of the at least one node may also be one, three, and the like, the metadata manager, the resource scheduler, and the node manager may also run on one node of the at least one node, and the metadata manager, the resource scheduler, and the node manager may also run on different nodes.
In the prior art, the virtual machines are usually deployed in different virtual machine clusters, and the containers are deployed in the container clusters, which not only increases the management cost for managing the virtual machines and the containers, but also causes the virtual machines and the containers to be unable to communicate directly, because when the virtual machines and the containers communicate, they usually need to establish communication with the cluster gateway of the other party after establishing communication with the router and the gateway in their own cluster, which may cause heavy pressure on network components of the cluster for applications with large amount of traffic transmission among the components, and some applications may be limited by the network bandwidth across the cluster, and meanwhile, a lengthy network transmission chain may also increase latency and reduce performance of the applications, so, in order to solve the above problems, please refer to fig. 2, fig. 2 is a flowchart of a resource management method provided by the embodiment of the present application, and is applied to the resource management system, the flow shown in fig. 2 will be explained in detail below, and the method includes the steps of: s21, S22, S23, S24, S25, S26, S27, S28, S29, S30, S31, S32, and S33.
S21: the method comprises the steps that a metadata manager receives a creation request which is sent by a request end and represents that a virtual machine and/or a container needs to be created; wherein the creation request includes the size of the resource required for creating the virtual machine and/or the container.
S22: the metadata manager sends the creation request to a resource scheduler.
S23: the resource scheduler receives the creation request.
S24: and the resource scheduler responds to the creation request and sends a metadata acquisition request to the metadata manager.
S25: and the metadata manager receives the metadata acquisition request.
S26: and the metadata manager responds to the metadata acquisition request and sends the prestored metadata of all nodes in the same cluster to the resource scheduler.
S27: a resource scheduler receives the metadata.
S28: and the resource scheduler determines a target node from all the nodes based on the metadata and the size of the required resource, wherein the target node is a node matched with the size of the required resource.
S29: the resource scheduler generates and sends a resource allocation request to the metadata manager based on the unique identifier of the target node and the request; wherein the resource allocation request includes: a unique identification of a target node, configuration information of the virtual machine and/or the container.
S30: and the metadata manager sends the resource allocation request to a node manager corresponding to the target node.
S31: the corresponding node manager receives the resource allocation request.
S32: the corresponding node manager creates the virtual machine and/or the container in the target node based on the resource allocation request.
S33: and the corresponding node manager sends the metadata of the target node to the metadata manager.
The above method is described in detail below.
S21: the method comprises the steps that a metadata manager receives a creation request which is sent by a request end and represents that a virtual machine and/or a container needs to be created; wherein the creation request includes the size of the resource required for creating the virtual machine and/or the container.
In an actual implementation, S21 may be implemented in such a manner that, when the request receiver receives a creation request sent by the user terminal and indicating that a virtual machine and/or a container needs to be created, the request receiver sends the creation request to the metadata manager.
As an implementation manner, when receiving the creation request, the request receiving end determines whether the creation request satisfies a preset condition, and when determining that the creation request satisfies the preset condition, the request receiving end sends the creation request to the metadata manager, otherwise, sends a prompt message indicating that the preset condition is not satisfied to the user terminal, it may be understood that, for example, when the creation request indicates that a virtual machine needs to be created, if the creation request does not include configuration information required for creating the virtual machine, such as the size of a resource required for creating the virtual machine, the creation request does not satisfy the preset condition, if the creation request includes the configuration information required for creating the virtual machine, the creation request satisfies the preset condition, and similarly, the creation request for the container is the same, therefore, the description is omitted.
The configuration information required for creating the virtual machine or the container is well known in the art and is not described herein again.
After the metadata manager acquires the creation request, the metadata manager performs step S22.
S22: the metadata manager sends the creation request to a resource scheduler.
The metadata manager listens for the creation request with listening software to send the creation request to a resource scheduler in real time as the creation request is received.
As one embodiment, the metadata manager sends the creation request to the resource scheduler at irregular times.
After the metadata manager sends the creation request to the resource scheduler, the resource scheduler performs step S23.
S23: the resource scheduler receives the creation request.
S24: and the resource scheduler responds to the creation request and sends a metadata acquisition request to the metadata manager.
S25: and the metadata manager receives the metadata acquisition request.
S26: and the metadata manager responds to the metadata acquisition request and sends the prestored metadata of all nodes in the same cluster to the resource scheduler.
It can be understood that, for a same node, when the node sends new metadata of the node, the metadata manager updates the metadata of the node, which is stored in advance, by using the metadata of the node, so as to ensure that the metadata received by the metadata manager is the latest metadata, where the metadata includes metadata such as the size of the remaining resource of each node in all the nodes, a network deployed in each node, and the name and size of each virtual machine and/or container running in each node.
After the metadata manager transmits the metadata to the resource scheduler, step S27 is performed.
S27: a resource scheduler receives the metadata.
S28: and the resource scheduler determines a target node from all the nodes based on the metadata and the size of the required resource, wherein the target node is a node matched with the size of the required resource.
In order to implement load balancing of nodes, so as to avoid that some nodes in the same cluster have much load pressure and some nodes have little load pressure, therefore, as an embodiment, S28 includes the steps of: a1 and a 2.
A1: and the resource scheduler determines a first node matched with the required resource size from all the nodes based on the metadata and the required resource size.
In an actual implementation, a1 may be implemented in such a way that, after receiving the metadata, the resource scheduler determines, based on the metadata, sizes of remaining resources of nodes located in the same cluster, compares, for each node, the size of the remaining resource of the node with the size of the required resource, determines, when the remaining resource of the node is greater than the required resource, that the node is a first node matching the size of the required resource, and otherwise determines that the node does not match the size of the required resource, and then determines, from all the nodes, all the first nodes matching the size of the required resource.
After the resource scheduler has determined all first nodes that match the required resource size, the resource scheduler performs step a 2.
A2: when the number of the matched first nodes is at least two, the resource scheduler determines a node with the most residual resources from the matched first nodes based on the metadata of the matched first nodes; and the node with the most residual resources is the target node.
When the number of the matched first nodes is at least two, the resource scheduler then sorts the sizes of the remaining resources of all the first nodes based on the metadata of the matched first nodes, or compares the sizes of the remaining resources of all the first nodes, so as to determine the node with the most remaining resources from the first nodes; and the node with the most residual resources is the target node.
As another embodiment, S28 includes the steps of: b1 and B2.
B1: and determining a second node matched with the required resource size from all the nodes based on the metadata and the required resource size.
The specific implementation of step B1 can refer to step a1, and therefore, is not described herein again.
B2: when the number of the matched second nodes is at least two, determining a node which has created the network to be accessed from the matched second nodes based on the metadata of the matched second nodes and the network information of the network to be accessed in the request; wherein the node where the network to be accessed exists is the target node.
And when the number of the matched second nodes is at least two, the resource scheduler extracts the network information of the network to be accessed from the request, determines whether the metadata of each second node comprises the network information of the network to be accessed or not aiming at each second node in all the second nodes, and determines that the second node is the target node when the metadata in the second node comprises the network information of the network to be accessed.
As an implementation manner, when the number of the second nodes having the network information of the network to be accessed is at least two, the second node having the most remaining resources is determined as the target node from the second nodes having the network information of the network to be accessed, or one second node may be arbitrarily selected from the second nodes having the network information of the network to be accessed as the target node.
After determining the target node, the resource scheduler performs step S29.
S29: the resource scheduler generates and sends a resource allocation request to the metadata manager based on the unique identifier of the target node and the request; wherein the resource allocation request includes: a unique identification of a target node, configuration information of the virtual machine and/or the container.
Each node has a unique identifier for distinguishing each node.
And the resource scheduler extracts the unique identifier of the target node from the metadata of the target node, generates a resource allocation request based on the unique identifier of the target node and the configuration information required by the virtual machine and/or the container in the request, and sends the resource allocation request to a metadata manager.
After the resource scheduler sends the resource allocation request to the metadata manager, step S30 is performed.
S30: and the metadata manager sends the resource allocation request to a node manager corresponding to the target node.
After the metadata manager acquires the resource allocation request, according to the unique identifier of the target node in the resource allocation request and the corresponding relation between the predetermined identifier and the node manager, the resource allocation request is sent to the manager corresponding to the unique identifier of the target node.
As an embodiment, when the number of the node managers is only one, the metadata manager sends the resource allocation request to a predetermined node manager.
After the metadata manager transmits the resource allocation request to the corresponding node manager, the corresponding node manager performs step S31.
S31: the corresponding node manager receives the resource allocation request.
S32: the corresponding node manager creates the virtual machine and/or the container in the target node based on the resource allocation request.
It will be appreciated that both virtual machines and containers may be created in the target node.
The request further comprises: as an embodiment, the S32 includes the following steps: c1, C2, and C3.
C1: the corresponding node manager sends the resource allocation request to a network manager located on the target node to cause the network manager to create the network in the target node based on the network segment and the network number.
After receiving the resource allocation request, the corresponding node manager extracts the identifier of the target node from the resource allocation request, sends the resource allocation request to a network manager running on the target node, the network manager receives the resource allocation request, the network manager extracts a network segment and a network number required for creating the virtual machine and/or the container from the resource allocation request, and the network manager confirms whether the network segment and the network number exist on the target node or not, after a network manager confirms that the network segment and network number are not present on the target node, the network manager creates the network on the target node based on the network segment and the network number, after the network manager finishes establishing the network, the network manager sends prompt information representing that the network is established to the corresponding node manager.
In one embodiment, when the network manager confirms that the network segment and the network number exist on the target node, the network manager directly performs step C2.
C2: and the corresponding node manager receives prompt information which is sent by the network manager and represents that the network is created.
C3: and the corresponding node manager responds to the prompt message and creates the virtual machine and/or the container in the target node so as to enable the virtual machine and/or the container to access the network.
After the corresponding node manager receives the prompt message, the corresponding node manager creates the virtual machine and/or the container in the target node based on the configuration information required by the virtual machine and/or the container in the request, so that the virtual machine and/or the container can access the network during operation.
As an embodiment, the request does not include: when a network segment and a network number of a network are to be created, the corresponding node manager creates the virtual machine and/or the container in the target node based on the configuration information required for creating the virtual machine and/or the container in the resource allocation request, so that the virtual machine and/or the container is accessed to one network in the target node during operation.
S33: and the corresponding node manager sends the metadata of the target node to the metadata manager.
Wherein the metadata includes: the residual resources of the target node, the configuration information of the virtual machine and/or the container running in the target node, and the metadata of the virtual machine and/or the container, such as a network accessed in the target node.
And the corresponding node manager acquires the metadata of the target node at the current moment and sends the metadata of the target node at the current moment to the metadata manager, and the metadata manager updates the metadata stored in advance by using the metadata.
As an implementation manner, when a metadata manager receives a deletion request sent by a request end and representing that a virtual machine and/or a container needs to be deleted, according to identification information of the virtual machine and the container in the deletion request, identification information of a third node where the virtual machine and/or the container is located is determined from prestored metadata located in the same cluster, and then the deletion request is sent to a node manager corresponding to the identification information of the third node, where the corresponding node manager deletes the virtual machine and/or the container in the third node based on the identification information of the virtual machine and/or the container in the deletion request.
As an implementation manner, when a metadata manager receives a modification request sent by a request end and indicating that a virtual machine and/or a container needs to be modified, according to identification information of the virtual machine and the container in the modification request, identification information of a fourth node where the virtual machine and/or the container are located is determined from prestored metadata located in the same cluster, and then the modification request is sent to a node manager corresponding to the identification information of the fourth node, where the corresponding node manager deletes the virtual machine and/or the container in the fourth node based on the identification information of the virtual machine and/or the container in the modification request.
As an implementation manner, when receiving a query request which is sent by a request end and represents metadata that needs to query a virtual machine and/or a container, according to identification information of the virtual machine and/or the container in the query request, a metadata manager queries the needed virtual machine and/or the container based on prestored metadata located in the same cluster.
As an implementation manner, when receiving a deletion, modification, and query request sent by a user terminal, a request end determines whether the request satisfies a format condition, and if so, sends the request to a metadata manager, otherwise, does not send the request to the metadata manager, and sends a prompt message indicating that the request does not satisfy the format condition to the user terminal.
Referring to fig. 3, fig. 3 is a block diagram of a resource management device 300 according to an embodiment of the present disclosure. The apparatus is applied to a resource scheduler, and the structural block diagram shown in fig. 3 will be described below, and the apparatus includes:
a request receiving unit 310, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes a size of a resource needed to create the virtual machine and/or the container.
A responding unit 320, configured to, in response to the request, obtain metadata of all nodes located in the same cluster from the metadata manager.
A target node determining unit 330, configured to determine a target node from the all nodes based on the metadata and the size of the required resource, where the target node is a node matching the size of the required resource.
An allocation request sending unit 340, configured to generate and send a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
In an embodiment, the target node determining unit 330 is specifically configured to determine, based on the metadata and the size of the required resource, a first node matching the size of the required resource from all the nodes; when the number of the matched first nodes is at least two, determining a node with the most residual resources from the matched first nodes based on the metadata of the matched first nodes; and the node with the most residual resources is the target node.
As an embodiment, the target node determining unit 330 is further configured to determine, based on the metadata and the size of the required resource, a second node matching the size of the required resource from all the nodes; when the number of the matched second nodes is at least two, determining a node which has created the network to be accessed from the matched second nodes based on the metadata of the matched second nodes and the network information of the network to be accessed in the request; wherein the node where the network to be accessed exists is the target node.
Referring to fig. 4, fig. 4 is a block diagram of a resource management device 400 according to an embodiment of the present disclosure. The apparatus is applied to a node manager, and the structural block diagram shown in fig. 4 will be described below, and the apparatus includes:
an allocation request receiving unit 410, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes: a unique identification of a target node, configuration information of the virtual machine and/or the container.
A creating unit 420, configured to create the virtual machine and/or the container in the target node based on the request.
A target node metadata sending unit 430, configured to send metadata of the target node to the metadata manager.
As an embodiment, the request further includes: a network segment and a network number of a network to be created, where the creating unit 420 is specifically configured to send the request to a network manager located on the target node, so that the network manager creates the network in the target node based on the network segment and the network number; receiving prompt information which is sent by the network manager and represents that the network is established; creating the virtual machine and/or the container in the target node in response to the hint information to enable the virtual machine and/or the container to access the network.
Referring to fig. 5, fig. 5 is a block diagram of a resource management device 500 according to an embodiment of the present disclosure. The apparatus is applied to a metadata manager, and the structural block diagram shown in fig. 5 will be explained below, and the apparatus includes:
a creation request receiving unit 510, configured to receive a creation request sent by a request end and indicating that a virtual machine and/or a container needs to be created; wherein the creation request includes the size of the resource required for creating the virtual machine and/or the container.
A creation request sending unit 520, configured to send the creation request to the resource scheduler.
An obtaining request receiving unit 530, configured to receive a metadata obtaining request sent by the resource scheduler;
a metadata sending unit 540, configured to send, in response to the obtaining request, metadata of all nodes located in the same cluster, which are stored in advance, to the resource scheduler, so that the resource scheduler generates a resource allocation request based on the metadata and the creation request; wherein the resource allocation request includes: a unique identification of the target node and the create request.
A resource allocation request receiving unit 550, configured to receive the resource allocation request returned by the resource scheduler.
A resource allocation request sending unit 560, configured to send the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
For the process of implementing each function by each functional unit in this embodiment, please refer to the content described in the embodiment shown in fig. 1-2, which is not described herein again.
Referring to fig. 6, an embodiment of the present application provides a schematic structural diagram of an electronic device 100, where the electronic device may be each node in the above embodiments, and the electronic device 100 may be a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or the like.
The electronic device 100 may include: memory 102, process 101, communication interface 103, and a communication bus for enabling the connection communications of these components.
The Memory 102 is used for storing various data such as a computer program instruction corresponding to the resource management method and apparatus provided in the embodiment of the present application, where the Memory 102 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 101 is configured to read and execute computer program instructions corresponding to the resource management method and apparatus stored in the memory.
The processor 101 may be an integrated circuit chip having signal processing capability. The Processor 101 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The communication interface 103 is used for acquiring data for receiving data sent by other devices and/or sending data to other devices.
In addition, a storage medium is provided in an embodiment of the present application, and a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer is caused to execute the method provided in any embodiment of the present application.
To sum up, in the prior art, the virtual machines are usually deployed in different virtual machine clusters, and the containers are deployed in the container cluster, which not only increases the management cost for managing the virtual machines and the containers, but also causes the virtual machines and the containers to be unable to communicate directly, because when the virtual machines and the containers communicate, it is usually required to establish communication with the cluster gateway of the other party after establishing communication with the router and the gateway in their own cluster, which may cause heavy pressure on network components of the cluster for applications with large traffic transmission among the components, and some applications may be limited by the network bandwidth across the cluster, and meanwhile, a lengthy network transmission chain may also increase latency and reduce performance of the applications, so to solve the above problems, the resource management method, apparatus and electronic device proposed in the embodiments of the present application, by creating the virtual machines and the containers in nodes in the same cluster, not only enabling direct communication between virtual machines and containers located in the same cluster, but also enabling a resource scheduler to obtain metadata of all nodes in the same cluster from a metadata manager, determine a target node from all nodes based on a request sent by the metadata manager and for representing that a virtual machine and/or a container needs to be created, and the metadata, and generate and send a resource allocation request to the metadata manager based on a unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, wherein the resource allocation request is used for instructing the node manager to create the virtual machine and/or the container in the target node, thereby realizing unified management of the virtual machine and/or the container, and the management cost is reduced.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

Claims (10)

1. A resource management method applied to a resource scheduler, the method comprising:
receiving a request sent by a metadata manager and used for representing that a virtual machine and/or a container needs to be created, wherein the request comprises the size of resources needed for creating the virtual machine and/or the container;
responding to the request, and acquiring metadata of all nodes in the same cluster from the metadata manager;
determining a target node from all the nodes based on the metadata and the size of the required resource, wherein the target node is a node matched with the size of the required resource;
and generating and sending a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, wherein the resource allocation request is used for instructing the node manager to create the virtual machine and/or the container in the target node.
2. The method of claim 1, wherein determining a target node from the total number of nodes based on the metadata and the size of the required resources comprises:
determining a first node matched with the size of the required resource from all the nodes based on the metadata and the size of the required resource;
when the number of the matched first nodes is at least two, determining a node with the most residual resources from the matched first nodes based on the metadata of the matched first nodes; and the node with the most residual resources is the target node.
3. The method of claim 1, wherein determining a target node from the total number of nodes based on the metadata and the size of the required resources comprises:
determining a second node matched with the size of the required resource from all the nodes based on the metadata and the size of the required resource;
when the number of the matched second nodes is at least two, determining a node which has created the network to be accessed from the matched second nodes based on the metadata of the matched second nodes and the network information of the network to be accessed in the request; wherein the node where the network to be accessed exists is the target node.
4. A resource management method is applied to a node manager, and comprises the following steps:
receiving a resource allocation request sent by a metadata manager and representing that a virtual machine and/or a container needs to be created, wherein the resource allocation request comprises: a unique identification of a target node, configuration information of the virtual machine and/or the container;
creating the virtual machine and/or the container in the target node based on the resource allocation request;
and sending the metadata of the target node to the metadata manager.
5. The method of claim 4, wherein the request further comprises: creating the virtual machine and/or the container in the target node based on the request, wherein the network segment and the network number of the network to be created comprise:
sending the resource allocation request to a network manager located on the target node to cause the network manager to create the network in the target node based on the network segment and the network number;
receiving prompt information which is sent by the network manager and represents that the network is established;
creating the virtual machine and/or the container in the target node in response to the hint information to enable the virtual machine and/or the container to access the network.
6. A resource management method applied to a metadata manager, the method comprising:
receiving a creation request which is sent by a request end and represents that a virtual machine and/or a container needs to be created; wherein, the creating request comprises the size of the resource required by the virtual machine and/or the container;
sending the creation request to a resource scheduler;
receiving a metadata acquisition request sent by the resource scheduler;
responding to the acquisition request, and sending pre-stored metadata of all nodes in the same cluster to the resource scheduler so that the resource scheduler generates a resource allocation request based on the metadata and the creation request; wherein the resource allocation request includes: the unique identification of the target node and the creation request;
receiving the resource allocation request returned by the resource scheduler;
sending the resource allocation request to a node manager corresponding to the target node, wherein the resource allocation request is used for instructing the node manager to create the virtual machine and/or the container in the target node.
7. A resource management apparatus, applied to a resource scheduler, the apparatus comprising:
a request receiving unit, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes a size of a resource needed to create the virtual machine and/or the container;
a response unit, configured to respond to the request, and obtain metadata of all nodes located in the same cluster from the metadata manager;
a target node determining unit, configured to determine a target node from the all nodes based on the metadata and the size of the required resource, where the target node is a node that matches the size of the required resource;
an allocation request sending unit, configured to generate and send a resource allocation request to the metadata manager based on the unique identifier of the target node and the request, so that the metadata manager sends the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
8. A resource management apparatus, applied to a node manager, the apparatus comprising:
an allocation request receiving unit, configured to receive a request sent by a metadata manager and indicating that a virtual machine and/or a container needs to be created, where the request includes: a unique identification of a target node, configuration information of the virtual machine and/or the container;
a creating unit, configured to create the virtual machine and/or the container in the target node based on the request;
and the target node metadata sending unit is used for sending the metadata of the target node to the metadata manager.
9. An apparatus for resource management, applied to a metadata manager, the apparatus comprising:
the system comprises a creation request receiving unit, a virtual machine creating unit and a container creating unit, wherein the creation request receiving unit is used for receiving a creation request which is sent by a request end and indicates that a virtual machine and/or a container needs to be created; wherein, the creating request comprises the size of the resource required by the virtual machine and/or the container;
a creation request sending unit, configured to send the creation request to a resource scheduler;
an acquisition request receiving unit, configured to receive a metadata acquisition request sent by the resource scheduler;
a metadata sending unit, configured to send, in response to the acquisition request, metadata of all nodes located in the same cluster, which are stored in advance, to the resource scheduler, so that the resource scheduler generates a resource allocation request based on the metadata and the creation request; wherein the resource allocation request includes: the unique identification of the target node and the creation request;
a resource allocation request receiving unit, configured to receive the resource allocation request returned by the resource scheduler;
a resource allocation request sending unit, configured to send the resource allocation request to a node manager corresponding to the target node, where the resource allocation request is used to instruct the node manager to create the virtual machine and/or the container in the target node.
10. An electronic device comprising a memory and a processor, the memory having stored therein computer program instructions that, when read and executed by the processor, perform the method of any of claims 1-6.
CN202010115431.8A 2020-02-24 2020-02-24 Resource management method and device and electronic equipment Pending CN111338758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010115431.8A CN111338758A (en) 2020-02-24 2020-02-24 Resource management method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010115431.8A CN111338758A (en) 2020-02-24 2020-02-24 Resource management method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111338758A true CN111338758A (en) 2020-06-26

Family

ID=71185660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010115431.8A Pending CN111338758A (en) 2020-02-24 2020-02-24 Resource management method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111338758A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148489A (en) * 2020-09-22 2020-12-29 网易(杭州)网络有限公司 Game resource scheduling method, device, equipment and storage medium
CN115426259A (en) * 2022-08-29 2022-12-02 浪潮电子信息产业股份有限公司 Network access control method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540776A (en) * 2008-03-17 2009-09-23 储彬 Grid middleware system supporting adaptive scheduling
US20100250729A1 (en) * 2009-03-30 2010-09-30 Morris Robert P Method and System For Providing Access To Metadata Of A Network Accessible Resource
CN105138389A (en) * 2015-07-30 2015-12-09 北京京东尚科信息技术有限公司 Method and system for managing virtual devices in cluster
CN105554004A (en) * 2015-12-24 2016-05-04 北京轻元科技有限公司 Authentication system and authentication method for container services in hybrid cloud computing environment
CN107733977A (en) * 2017-08-31 2018-02-23 北京百度网讯科技有限公司 A kind of cluster management method and device based on Docker
US20180173513A1 (en) * 2016-12-19 2018-06-21 International Business Machines Corporation Optimized Creation of Distributed Storage and Distributed Processing Clusters on Demand
CN109885377A (en) * 2018-11-23 2019-06-14 中国银联股份有限公司 The method of unified resource scheduling coordinator and its creation virtual machine and/or container, unified resource dispatch system
CN110633900A (en) * 2019-08-30 2019-12-31 中国人民财产保险股份有限公司 Virtual resource allocation method and device and electronic equipment
CN110752947A (en) * 2019-10-18 2020-02-04 北京浪潮数据技术有限公司 K8s cluster deployment method and device, and deployment platform

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540776A (en) * 2008-03-17 2009-09-23 储彬 Grid middleware system supporting adaptive scheduling
US20100250729A1 (en) * 2009-03-30 2010-09-30 Morris Robert P Method and System For Providing Access To Metadata Of A Network Accessible Resource
CN105138389A (en) * 2015-07-30 2015-12-09 北京京东尚科信息技术有限公司 Method and system for managing virtual devices in cluster
CN105554004A (en) * 2015-12-24 2016-05-04 北京轻元科技有限公司 Authentication system and authentication method for container services in hybrid cloud computing environment
US20180173513A1 (en) * 2016-12-19 2018-06-21 International Business Machines Corporation Optimized Creation of Distributed Storage and Distributed Processing Clusters on Demand
CN107733977A (en) * 2017-08-31 2018-02-23 北京百度网讯科技有限公司 A kind of cluster management method and device based on Docker
CN109885377A (en) * 2018-11-23 2019-06-14 中国银联股份有限公司 The method of unified resource scheduling coordinator and its creation virtual machine and/or container, unified resource dispatch system
CN110633900A (en) * 2019-08-30 2019-12-31 中国人民财产保险股份有限公司 Virtual resource allocation method and device and electronic equipment
CN110752947A (en) * 2019-10-18 2020-02-04 北京浪潮数据技术有限公司 K8s cluster deployment method and device, and deployment platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148489A (en) * 2020-09-22 2020-12-29 网易(杭州)网络有限公司 Game resource scheduling method, device, equipment and storage medium
CN115426259A (en) * 2022-08-29 2022-12-02 浪潮电子信息产业股份有限公司 Network access control method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US20200228405A1 (en) Network slice management method and apparatus
CN107431651B (en) Life cycle management method and equipment for network service
EP3595244B1 (en) Network slice management method, unit and system
US20160277496A1 (en) Method, server and system for application synchronization
CN110908770A (en) Operation and creation method of virtual machine, virtual machine and virtual machine management platform
CN113596191A (en) Data processing method, network element equipment and readable storage medium
CN110716787A (en) Container address setting method, apparatus, and computer-readable storage medium
CN113434249A (en) Mirror image synchronization method and device, docker host and storage medium
CN111338758A (en) Resource management method and device and electronic equipment
CN111752582A (en) Software updating method and device in local area network and electronic equipment
CN113259479A (en) Data processing method and equipment
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN111813529B (en) Data processing method, device, electronic equipment and storage medium
CN111556112A (en) Data transmission method and device, electronic equipment and storage medium
CN110278558B (en) Message interaction method and WLAN system
CN112333284A (en) Data transmission method, system and storage medium based on 5G intelligent gateway
CN113342456A (en) Connection method, device, equipment and storage medium
CN114615285B (en) Physical machine deployment method and device, electronic equipment and storage medium
CN100386726C (en) Method and system for renewing long-distance operation and control of computer platform system programe
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN112131263B (en) Software package acquisition method, system, device, electronic equipment and storage medium
CN114048028A (en) Service calling method and device, storage medium and electronic equipment
CN115550313A (en) Communication method and device of external equipment, electronic equipment and storage medium
CN112559472A (en) File transmission method and device, computer equipment and storage medium
CN107454021B (en) Communication method and device

Legal Events

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