CN114168253A - Resource control method and device, electronic equipment, storage medium and cloud platform - Google Patents

Resource control method and device, electronic equipment, storage medium and cloud platform Download PDF

Info

Publication number
CN114168253A
CN114168253A CN202010850075.4A CN202010850075A CN114168253A CN 114168253 A CN114168253 A CN 114168253A CN 202010850075 A CN202010850075 A CN 202010850075A CN 114168253 A CN114168253 A CN 114168253A
Authority
CN
China
Prior art keywords
resource
type
node
nodes
adjusting
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
CN202010850075.4A
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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies 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 Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202010850075.4A priority Critical patent/CN114168253A/en
Publication of CN114168253A publication Critical patent/CN114168253A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

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

An embodiment of the application provides a resource control method, a resource control device, an electronic device, a storage medium, a program product and a cloud platform, and the method comprises the following steps: the method comprises the steps of obtaining attribute information of each resource node, adjusting the resource type of at least one resource node according to the attribute information, and adjusting the resource type of the resource node based on the attribute information, so that on one hand, switching of the resource type is realized through adjustment of the resource type, and the problems that resources of part of resource types are excessive and resources of part of resource types are insufficient are avoided, thereby realizing reasonable utilization and configuration of the resources, improving flexibility of resource control, and improving the technical effect of utilization rate of the resources; on the other hand, the resource type is adjusted according to the attribute information without manual setting, so that the automation and the intellectualization of the resource adjustment are realized, and the technical effect of the efficiency of the resource adjustment is improved.

Description

Resource control method and device, electronic equipment, storage medium and cloud platform
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a resource control method, an apparatus, an electronic device, a storage medium, a program product, and a cloud platform.
Background
With the development of internet technology, the related technology of the cloud platform has new breakthroughs.
In the related art, in order to enable resources of a cloud platform to meet business requirements, resource nodes corresponding to the business requirements can be added, when resource nodes of a certain resource type need to be added, a new server is added in a manual mode, and the new server becomes the resource nodes of the resource type through manual configuration of a network of the new server.
However, the inventors found that the prior art has at least the following problems: the manual addition mode may cause resource waste of other resource nodes, that is, a problem of low resource utilization rate.
Disclosure of Invention
In order to solve the technical problem, embodiments of the present application provide a resource control method, device, electronic device, storage medium, program product, and cloud platform.
According to an aspect of an embodiment of the present application, an embodiment of the present application provides a resource control method, which is applied to a cloud platform, where the cloud platform includes multiple resource types, and each resource type includes at least one resource node, and the method includes:
acquiring attribute information of each resource node;
and adjusting the resource type of at least one resource node according to the attribute information.
That is to say, in the embodiment of the present application, the adjustment operation on the resource type may be automatically triggered according to the attribute information, without manual intervention.
The adjustment of the resource type can be based on a time period, for example, the attribute information of each resource node in a preset time period is collected, and the adjustment operation of the resource type is automatically triggered based on the attribute information; of course, the adjustment of the resource type may also be based on the current attribute information, such as collecting the current attribute information of each resource node, and automatically triggering the adjustment operation of the resource type based on the current attribute information, and so on.
In the embodiment of the application, on one hand, the switching of the resource types is realized through the adjustment of the resource types, and the problems that the resources of part of the resource types are excessive and the resources of part of the resource types are insufficient are avoided, so that the reasonable utilization and configuration of the resources are realized, the flexibility of resource control is improved, and the technical effect of the utilization rate of the resources is improved; on the other hand, the resource type is adjusted according to the attribute information without manual setting, so that the automation and the intellectualization of the resource adjustment are realized, and the technical effect of the efficiency of the resource adjustment is improved.
In some embodiments, adjusting the resource type of at least one of the resource nodes according to the attribute information comprises:
determining the utilization rate of each resource node according to the attribute information;
determining a target resource type according to the utilization rate;
and adjusting at least one resource node of an initial resource type into a resource node of the target resource type according to the attribute information, wherein the target resource type and the initial resource type are different resource types in the multiple resource types.
In the embodiment of the application, the target resource type can be automatically determined according to the utilization rate, so that the intelligence of resource adjustment is improved.
In some embodiments, the target resource type may be determined according to a size relationship between the usage rate and the usage rate threshold by presetting the usage rate threshold, and certainly, the initial resource type may also be determined according to a size relationship between the usage rate and the usage rate threshold.
Of course, in other embodiments, the target resource type may also be determined based on the size relationship between the utilization rates of the resource types, and similarly, the initial resource type may also be determined based on the size relationship between the utilization rates of the resource types.
It should be noted that the initial resource type may also be determined by human participation, and the determination of the initial resource type is not limited in the embodiment of the present application.
In some embodiments, the adjusting the resource node of the at least one initial resource type to the resource node of the target resource type according to the attribute information includes:
determining configuration information of the target resource type;
and adjusting at least one resource node of the initial resource type into a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
In some embodiments, if the target resource type is a resource type to be expanded, the configuration information of the resource type to be expanded includes a specification of the resource type to be expanded, network link information, and a mirror image file stored in a preset mirror image warehouse.
In the embodiment of the application, on one hand, the mirror image is generated by acquiring and downloading the mirror image file from the mirror image warehouse, so that the repeated process that the resource node of the initial resource type needs to mount and install the operating system, install the distributed client software and then carry out system configuration is avoided during each expansion, the operation steps and the manual operation content are reduced, the expansion efficiency is improved, and the reasonable utilization of resources, such as the reuse of the mirror image file, is improved; on the other hand, the resource node of the initial resource type is automatically adjusted to the resource node of the target resource type based on the attribute information and the configuration information, so that manual configuration and/or network switching are avoided, the automation capacity of network management is improved, and the capacity expansion efficiency is improved; on the other hand, by reading the automatic configuration in the mirror image file, the manual configuration operation after capacity expansion is reduced, and the capacity expansion efficiency is improved.
In some embodiments, if the target resource type is a resource type to be reduced, the configuration information of the resource type to be reduced includes a specification of the resource type to be reduced and network link information.
In the embodiment of the application, because the configuration information of the resource type to be reduced comprises the specification of the resource type to be reduced and the network link information, the manual configuration and/or network switching can be avoided during the reduction, and the automation capability of network management is improved.
In some embodiments, adjusting at least one resource node of the initial resource type to a resource node of the target resource type according to the attribute information and the configuration information of the target resource type includes:
and cleaning the data of the resource node of the initial resource type started based on the specification of the resource type to be contracted and the network link information.
In the embodiment of the application, the data cleaning of the resource nodes of the initial resource type can be automatically completed, manual operation is not needed, the automation of capacity reduction can be realized, and the capacity reduction efficiency can be improved.
In some embodiments, the resource types include a free resource type, the method further comprising:
and adding the resource nodes after cleaning the data into a preset free resource list.
In the embodiment of the application, the resource nodes after the capacity reduction are added to the idle resource list, so that the available resources can be increased, and the utilization rate of the resources is improved.
In some embodiments, when capacity expansion needs to be performed on any of the resource types, the method further includes:
and selecting a resource node for capacity expansion from the free resource list according to a preset condition.
In some embodiments, the preset condition includes attribute information and/or a preset priority of each resource node in the free resource list.
In the embodiment of the application, the resource nodes for capacity expansion are selected from the idle resource list through the attribute information and/or the preset priority of each resource node in the idle resource list, so that the reliability and effectiveness of resource recovery and reutilization can be realized, and the utilization rate of resources and the flexibility of resource adjustment can be improved.
In some embodiments, said adjusting a resource type of at least one of said resource nodes according to said attribute information comprises at least one of:
adjusting the resource nodes of the storage type into the resource nodes of the calculation type;
adjusting the resource nodes of the storage type into resource nodes of an idle type;
adjusting the resource nodes of the calculation type into resource nodes of the storage type;
adjusting the resource nodes of the calculation type into resource nodes of an idle type;
adjusting the idle type resource node into a storage type resource node;
and adjusting the idle type resource nodes into the calculation type resource nodes.
In some embodiments, the method further comprises:
determining the resource type and specification of the resource node to be accessed according to the attribute information;
selecting a mirror image file corresponding to the resource type of the resource node to be accessed from a preset mirror image warehouse;
and performing access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, and the specification of the resource type of the resource node to be accessed and the network link information.
In the embodiment of the application, on one hand, the automation and the intellectualization of the new addition can be realized by performing the new addition operation based on the attribute information; on the other hand, the new addition is realized by acquiring the corresponding image file from the image warehouse, so that the repeated process that the resource node of the initial resource type needs to mount and install the operating system, then install the distributed client software and then carry out system configuration during each expansion can be avoided, the operation steps and the manual operation content are reduced, the flexibility and the efficiency of the new addition are improved, and the reuse of the image file is improved; on the other hand, the new addition is realized through the network link information of the resource type of the resource node to be accessed, so that the manual configuration can be avoided, the automation capacity of network management is improved, and the efficiency of the new addition is improved.
According to another aspect of the embodiments of the present application, there is also provided a resource control apparatus, where the apparatus is applied to a cloud platform, the cloud platform includes multiple resource types, and each resource type includes at least one resource node, the apparatus includes:
the acquisition module is used for acquiring the attribute information of each resource node;
and the adjusting module is used for adjusting the resource type of at least one resource node according to the attribute information.
In some embodiments, the adjusting module is configured to determine a usage rate of each resource node according to the attribute information, determine a target resource type according to the usage rate, and adjust at least one resource node of an initial resource type to be a resource node of the target resource type according to the attribute information, where the target resource type and the initial resource type are different resource types of the multiple resource types.
In some embodiments, the adjusting module is configured to determine configuration information of the target resource type, and adjust at least one resource node of the initial resource type to a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
In some embodiments, if the target resource type is a resource type to be expanded, the configuration information of the resource type to be expanded includes a specification of the resource type to be expanded, network link information, and a mirror image file stored in a preset mirror image warehouse.
In some embodiments, if the target resource type is a resource type to be reduced, the configuration information of the resource type to be reduced includes a specification of the resource type to be reduced and network link information.
In some embodiments, the adjusting module is configured to clean up data of the resource node of the initial resource type that is started based on the specification of the resource type to be condensed and the network link information.
In some embodiments, the apparatus further comprises:
and the adding module is used for adding the resource nodes after the data are cleaned into a preset idle resource list.
In some embodiments, the apparatus further comprises:
and the selection module is used for selecting the resource nodes for capacity expansion from the free resource list according to preset conditions when the capacity expansion of any one resource type is required.
The preset conditions comprise attribute information and/or preset priority of each resource node in the free resource list.
In some embodiments, the adjustment module is configured to perform at least one of:
adjusting the resource nodes of the storage type into the resource nodes of the calculation type;
adjusting the resource nodes of the storage type into resource nodes of an idle type;
adjusting the resource nodes of the calculation type into resource nodes of the storage type;
adjusting the resource nodes of the calculation type into resource nodes of an idle type;
adjusting the idle type resource node into a storage type resource node;
and adjusting the idle type resource nodes into the calculation type resource nodes.
In some embodiments, the apparatus further comprises:
the determining module is used for determining the resource type and specification of the resource node to be accessed according to the attribute information;
the selecting module is used for selecting a mirror image file corresponding to the resource type of the resource node to be accessed from a preset mirror image warehouse;
and the access module is used for performing access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, and the specification of the resource node to be accessed and the network link information of the resource type.
According to another aspect of the embodiments of the present application, there is also provided a computer storage medium having stored thereon computer instructions, which, when executed by a processor, cause the method of any of the above embodiments to be performed.
According to another aspect of embodiments of the present application, there is also provided a computer program product, which when run on a processor, causes the method of any of the above embodiments to be performed.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the method of any of the above embodiments to be performed.
According to another aspect of the embodiments of the present application, there is also provided a cloud platform, including: the method includes the steps of obtaining a plurality of resource types, wherein each resource type includes at least one resource node, and further includes the resource control apparatus in any of the above embodiments, or includes the electronic device in the above embodiment.
In some embodiments, the cloud platform further comprises:
the mirror image warehouse is used for storing mirror image files corresponding to the resource types;
the software defined network controller is used for executing the configuration instruction sent to the switch by the resource manager;
and the switch is used for executing communication between the resource nodes according to the configuration instruction and executing communication between the resource nodes and the components of the platform.
Drawings
The drawings are included to provide a further understanding of the embodiments of the application and are not intended to limit the application. Wherein the content of the first and second substances,
fig. 1 is a schematic diagram of a cloud platform according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a resource control method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a resource control method according to another embodiment of the present application;
FIG. 4 is an interaction diagram of a resource control method according to an embodiment of the present application;
FIG. 5 is an interaction diagram of a resource control method according to another embodiment of the present application;
FIG. 6 is a flowchart illustrating a resource control method according to another embodiment of the present application;
FIG. 7 is a diagram illustrating a resource control apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The resource control method provided by the embodiment of the application can be applied to a cloud platform shown in fig. 1.
As shown in fig. 1, a cloud platform is provided with a mirror repository, a resource manager, a database, a Software Defined Network (SDN) controller, a distributed storage manager, switches (such as switch 1 and switch 2 shown in fig. 1), a computing pool, unallocated nodes (such as unallocated node 1, unallocated node 2, and unallocated node 3 shown in fig. 1), and a distributed storage pool, where the computing pool includes at least one computing node, such as computing node 1, computing node 2, and computing node 3 shown in fig. 1, and the distributed storage pool includes at least one storage node, such as storage node 1, storage node 2, and storage node 3 shown in fig. 1.
Wherein, the mirror image warehouse stores the mirror image file, specifically, the mirror image file can be created by adopting a mode that the host machine issues a virtual machine, and the host machine can adopt an open source Linux operating system supporting virtualization technology, the virtual machine selects an operating system required by each resource node (such as a computing node and/or a storage node), after the virtual machine is created, the time zone, network, security option and the like of the virtual machine are configured, hardware drivers such as RAID card driver, network card driver and the like are installed, and closed-init is installed, client software of each resource node (such as a computing node and/or a storage node) is installed on the virtual machine, after the installation is completed, the virtual machine is closed, the mirror image file is obtained from the corresponding directory of the host machine, such as KVM virtual machine created by using virt-manager, the qcow2 mirror image file can be obtained from/var/lib/libvirt/images directory, and storing the image file to an image repository arranged on the cloud platform, and setting different identifiers for different image files, so that when a resource node is newly added (for example, a computing node and/or a storage node is added) and/or type adjustment (for example, a computing node is adjusted to be a storage node), the image file is determined based on the identifier.
The cloud-init is a tool for performing initialization configuration on a virtual machine or a bare metal server in a cloud platform, network configuration, hostname, hosts files, user names and passwords of the server (namely all resource nodes) can be customized when the virtual machine or the bare metal server is created by using a mirror image, and after the cloud-init is installed, when the resources are newly increased and/or type adjusted, the newly increased and/or adjusted nodes do not need to be logged in for repeated configuration work.
The resource manager can control power Management operations such as power-on, power-off or restart of each resource node through an Intelligent Platform Management Interface (IPMI) Interface, and can also acquire information such as a server CPU, a memory, a network card and the like through a Redfish Interface. Specifically, the resource manager may be an execution main body of the resource control method according to the embodiment of the present application, and is configured to perform at least one of capacity expansion, capacity reduction, and new addition on resources of the cloud platform, which will be described in detail later and will not be described herein again.
The database is used for storing relevant information of each resource node, such as an identifier of each resource node, CPU, memory, hard disk, physical Access Control (MAC) address, port link information, and the like.
Wherein the SDN controller is connected to the resource manager and the switch (e.g., switch 1 and switch 2 shown in fig. 1) for implementing information transmission of both the resource manager and the switch.
Wherein a distributed storage manager connects a switch (such as switch 2 shown in fig. 1) to the database and resource manager, may be used to manage each storage node in the distributed storage pool.
The switches (such as switch 1 and switch 2 shown in fig. 1) may be configured to process each resource node under the control of the SDN controller, and implement communication and traffic forwarding between each resource node.
Each resource node may be configured to perform a corresponding task, for example, a compute node may perform a task related to computation, and a storage node may perform a task related to storage.
By the resource control method of the embodiment of the application, the resource types of the resource nodes shown in fig. 1 can be converted, for example, a computing node is converted into a storage node, a storage node is converted into a computing node, and the like.
It should be appreciated that fig. 1 is merely exemplary to illustrate components that a cloud platform may include and the number of components that may be included, and should not be construed as limiting the cloud platform. For example, in some embodiments, the cloud platform may increase components accordingly based on business requirements and the like, and may also decrease components accordingly based on business requirements and the like.
And the above examples are only used for exemplarily illustrating the resource types that the cloud platform may include and the number of resource nodes that each resource type may include, but are not to be construed as a limitation on the resource types and/or the number of resource nodes.
In the related art, when a resource node of a certain resource type needs to be added, a new server is added in a manner that the new server becomes the resource node of the resource type by manually configuring a network of the new server.
However, the resource waste of other resource nodes, that is, the resource utilization rate is low, may be caused by the new adding manner.
The inventor of the application obtains the inventive concept of the embodiment of the application through creative work: and adjusting the resource types of one or more resource nodes based on the attribute information of each resource node.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
In one aspect, an embodiment of the present application provides a resource control method applicable to the above application scenario, where the method may be applied to a cloud platform, where the cloud platform includes multiple resource types, for example, the cloud platform includes three resource types shown in fig. 1, that is, a computing resource, a storage resource, and an idle resource, and each resource type includes at least one resource node, the computing resource shown in fig. 1 includes three computing nodes, the storage resource includes three storage nodes, and the idle resource includes three unallocated nodes.
Referring to fig. 2, fig. 2 is a flowchart illustrating a resource control method according to an embodiment of the present application.
As shown in fig. 2, the method includes:
s101: and acquiring the attribute information of each resource node.
The execution main body in the embodiment of the application can be a server, a controller, a chip and the like arranged on a cloud platform.
For example, in a cloud platform as shown in fig. 1, an execution subject of the resource control method of the embodiment of the present application may be a resource manager as shown in fig. 1.
The attribute information may be used for characterizing, configuring and/or operating related information of the resource node.
Specifically, the configuration-related information may include information such as an identifier of a resource node, an MAC address, a CPU, a memory, and a hard disk; the operation-related information may include port link information and operation parameters.
S102: and adjusting the resource type of at least one resource node according to the attribute information.
In this step, the resource type of the resource node or the resource nodes is adjusted based on the attribute information.
Adjusting the resource type of a resource node is equivalent to adjusting a certain resource node, and specifically, adjusting the resource node from a certain resource type to another resource type.
For example, one compute node (e.g., compute node 1) as shown in FIG. 1 is adapted as a storage node; as another example, one storage node (e.g., storage node 1) as shown in FIG. 1 is adapted as a compute node; as another example, one unassigned node (e.g., unassigned node 1) as shown in fig. 1 is tuned to be a compute node; as another example, an unallocated node (e.g., unallocated node 1) as shown in FIG. 1 is adapted to be a storage node; as another example, a compute node such as that shown in FIG. 1 (e.g., compute node 1) is adjusted to be an unallocated node, and so on.
Wherein adjusting the resource type of the plurality of resource nodes may include at least one of:
the resource nodes for adjusting the resource types are nodes of the same resource type;
the resource nodes for adjusting the resource types are nodes of different resource types;
the resource types of the plurality of resource nodes obtained through resource type adjustment are the same;
the resource types of the resource nodes obtained through the resource type adjustment are different.
The first case and the third case are taken as an example to be described as follows:
for example, two compute nodes (e.g., compute node 1 and compute node 2) as shown in FIG. 1 are each adapted as storage nodes; as another example, two storage nodes (e.g., storage node 1 and storage node 2) as shown in fig. 1 are each adapted as a compute node; as another example, two unallocated nodes (e.g., unallocated node 1 and unallocated node 2) as shown in fig. 1 are each adjusted to a compute node; as another example, two unallocated nodes (e.g., unallocated node 1 and unallocated node) as shown in FIG. 1 are each adapted to be a storage node; as another example, two compute nodes (e.g., compute node 1 and compute node 2) as shown in FIG. 1 are each adapted as unallocated nodes, and so on.
The first case and the fourth case are taken as an example to be described as follows:
for example, one compute node (e.g., compute node 1) as shown in FIG. 1 is adapted as a storage node and another compute node (e.g., compute node 2) is adapted as an unallocated node; for another example, one storage node (e.g., storage node 1) as shown in fig. 1 is adjusted to be a compute node, and another storage node (e.g., storage node 2) is adjusted to be an unallocated node; as another example, one unassigned node as shown in FIG. 1 (e.g., unassigned node 1) is adapted as a compute node, another unassigned node (e.g., unassigned node 2) is adapted as a storage node, and so on.
The second case and the third case are taken as an example to be described as follows:
for example, one compute node (e.g., compute node 1) as shown in FIG. 1 is adjusted to be a storage node, and one unallocated node (e.g., unallocated node 1) as shown in FIG. 1 is adjusted to be a storage node; as another example, one storage node (e.g., storage node 1) as shown in fig. 1 is adjusted to be a compute node, and one unallocated node (e.g., unallocated node 1) as shown in fig. 1 is adjusted to be a compute node; as another example, one storage node (e.g., storage node 1) as shown in FIG. 1 is adjusted to be an unallocated node, and one compute node (e.g., compute node 1) as shown in FIG. 1 is adjusted to be an unallocated node, and so on.
The second case and the fourth case are taken as an example to be described as follows:
for example, when the resource types include four types, which are respectively a first resource type, a second resource type, a third resource type and a fourth resource type, the resource node of the first resource type may be adjusted to be a resource node of the fourth resource type, and the resource node of the second resource type may be adjusted to be a resource node of the third resource type, and so on.
In this embodiment of the present application, a manner of adjusting a resource type of at least one resource node according to attribute information is not limited, for example, in some embodiments, the adjusted resource type may be determined based on a part of parameters in the attribute information, or may be determined based on all parameters in the attribute information, and when the adjusted resource type is determined based on multiple parameters, the resource type may be implemented based on weights of the parameters, and so on.
Based on the above analysis, an embodiment of the present application provides a resource control method, including: the method comprises the steps of obtaining attribute information of each resource node, adjusting the resource type of at least one resource node according to the attribute information, and adjusting the resource type of the resource node based on the attribute information, so that on one hand, switching of the resource type is realized through adjustment of the resource type, and the problems that resources of part of resource types are excessive and resources of part of resource types are insufficient are avoided, thereby realizing reasonable utilization and configuration of the resources, improving flexibility of resource control, and improving the technical effect of utilization rate of the resources; on the other hand, the resource type is adjusted according to the attribute information without manual setting, so that the automation and the intellectualization of the resource adjustment are realized, and the technical effect of the efficiency of the resource adjustment is improved.
In order to make the reader more clearly understand how to adjust the resource types of one or more resource nodes according to the attribute information, a resource control method according to an embodiment of the present application is described in detail with reference to fig. 3. Fig. 3 is a schematic flowchart of a resource control method according to another embodiment of the present application.
As shown in fig. 3, the method includes:
s201: and acquiring the attribute information of each resource node.
For the description of S201, reference may be made to S101, which is not described herein again.
S202: and determining the utilization rate of each resource node according to the attribute information.
The utilization rate can be used for representing the percentage of the used resources in the total resources, and the utilization rate can be calculated on the basis of the resource nodes and can also be calculated on the basis of the resource types. If the utilization rate is higher, the resources which can be utilized are less; conversely, if the usage rate is smaller, the more resources that can be utilized.
S203: and determining the target resource type according to the utilization rate.
In the embodiment of the present application, since the resource type of the resource node before the adjustment and the resource type of the resource node after the adjustment are related, in order to distinguish the two types and avoid confusion, the resource type of the resource node before the adjustment is referred to as an initial resource type, and the resource type of the resource node after the adjustment is referred to as a target resource type. For example, if compute node 1 shown in FIG. 1 is tuned as a storage node, then the initial resource type is a compute resource and the target resource type is a storage resource.
In some embodiments, the step may specifically include: and determining the type of the target resource according to the utilization rate and a preset utilization rate threshold.
Specifically, if the usage rate of a certain resource type is greater than or equal to the usage rate threshold, it indicates that the usage rate of the resource type is relatively high, and in order to ensure fast and effective operation of the resource node of the resource type, the resource node of the resource type may be subjected to capacity expansion, and the resource type is determined as the target resource type.
The initial resource type may also be determined based on the usage rate and the usage rate threshold.
Specifically, if the usage rate of a certain resource type is less than or equal to the usage rate threshold, it indicates that the usage rate of the resource type is relatively low, and the resource type may be determined as the initial resource type.
It should be noted that, in the embodiment of the present application, the determination of the initial resource type is not limited, and the initial resource type and the target resource type may be different resource types.
Wherein the usage threshold may be set based on demand, experience, experimentation, and the like.
The setting of the usage threshold based on demand is explained as follows:
to meet the high operating efficiency of each resource node, such as to meet the high computational efficiency of the compute nodes, the usage threshold may be set relatively small.
The setting of the usage threshold based on experience is explained as follows:
based on the history, when the utilization rate of a certain resource type reaches a certain value, for example, when the utilization rate of a calculation type reaches a certain value, the calculation efficiency of a calculation node shows a descending trend, and the value is set as a utilization rate threshold.
The setting of the usage threshold based on the experiment is explained as follows:
the method comprises the steps of collecting operation information of resource nodes of a certain resource type under the condition of different utilization rates, for example, collecting computing efficiency of each computing node under the condition of different utilization rates of computing resources, selecting the maximum utilization rate corresponding to the requirement of the computing efficiency from the different utilization rates, and setting the maximum utilization rate as a utilization rate threshold.
It should be noted that the above examples are only used for exemplarily illustrating the setting of the usage threshold, and are not to be construed as a limitation for setting the usage threshold, such as the usage threshold may be set by a person in some embodiments.
S204: and adjusting the resource node of at least one initial resource type into the resource node of the target resource type according to the attribute information.
In some embodiments, S204 may include:
s2041: configuration information for the target resource type is determined.
In this embodiment of the present application, resource control on a cloud platform may be divided into three types, one type is to perform capacity expansion on resources (hereinafter, capacity expansion for short), the other type is to perform capacity reduction on resources (hereinafter, capacity reduction for short), and the other type is to perform resource increase (hereinafter, capacity increase for short).
The capacity expansion can be used for representing, increasing resource nodes of a certain resource type, and realizing the capacity expansion by adjusting resource nodes of other resource types. Taking fig. 1 as an example, when capacity expansion needs to be performed on the storage type resource, the compute node and/or the unallocated node may be adjusted to be the storage node.
The capacity reduction can be used for representing, reducing resource nodes of a certain resource type, adjusting the resource nodes of the resource type to be an unallocated resource type, or deleting the resource nodes of the resource type.
The new addition is used for representing, resource nodes of a certain resource type are added, and the method is realized by adding new nodes (namely, deploying new servers on the cloud platform). Taking fig. 1 as an example, when resources of storage types need to be added, a new node may be added, and the newly added node is configured as a storage node.
It should be noted that the three types of partitions are only used for exemplary illustration, and the resource control in the embodiment of the present application may exist, and from the commonality of the resource control, the three types are summarized and cannot be understood as a specific limitation on the resource control.
For example, when capacity expansion is realized by means of resource node adjustment, a resource node of a certain resource type is added, and when a new node is added to add a resource, a resource node of a certain resource type is also added, so in some embodiments, capacity expansion and new addition may also be divided into the same type.
For another example, capacity expansion is an adjustment of a resource type of a resource node, and capacity reduction is an adjustment of a resource type of a resource node, so in some embodiments, capacity expansion and capacity reduction may also be divided into the same type.
In the embodiment of the present application, in order to make the reader understand the scheme of the resource control method in the embodiment of the present application more thoroughly, the resource control is divided into the above three types.
If the resource control is capacity expansion, in this step, the configuration information may be used to represent the configuration information of the image file of the target resource type and the configuration information of the network link information, and the network link information includes information such as the vlan id and the MAC address of the installation and deployment network.
S2042: and adjusting at least one resource node of the initial resource type into a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
To make readers more deeply understand how to adjust a resource node of an initial resource type to a resource node of a target resource type during capacity expansion, the following description is made with reference to fig. 1 and 4 (fig. 4 is an interaction schematic diagram of a resource control method according to an embodiment of the present application), taking the resource node of the initial resource type as a computing node 1, and taking the resource node of the target resource type as a storage node as an example:
s1: the resource manager determines the configuration information of the storage node, i.e. the resource manager determines the configuration information of the storage node and the network link information.
S2: the resource manager sends a first message to the SDN controller, wherein the first message is used for indicating the SDN controller to open an installation and deployment network of the computing node, and the first message carries network link information of the computing node 1.
In particular, the network link information includes switch port MAC addresses and vlan ids so that the SDN controller and the switches can determine at which port how to configure to the installation deployment network.
S3: the SDN controller sends the first message to the switch.
Specifically, the SDN controller may issue, through an OpenFlow protocol, a flow table including the first message to the switch.
S4: the switch switches the computing node 1 to the installation deployment network according to the first message.
Specifically, the switch determines the MAC address of the network port of the computing node 1 according to the network link information of the computing node 1, and switches the network port of the computing node 1 to the vlan id of the installation deployment network.
S5: the resource manager sends an instruction to the compute node 1 to restart.
S6: compute node 1 reboots (if the node of the initial resource type is an unallocated node, this step is to power up the unallocated node).
S7: the computing node 1 acquires and installs the image file from the image repository according to the configuration information of the storage node (specifically, the configuration information of the image file of the storage node).
S8: the resource manager sends a message to the SDN controller to switch the storage network.
S9: and the SDN controller sends a configuration instruction for switching the computing network to the storage network to the switch.
S10: the switch switches the computing node 1 to the storage network.
S11: the resource manager sends an instruction to restart to the computing node 1 that switches to the storage network.
The networks corresponding to different resource types are different, for example, the storage type corresponds to a storage network, the computing type corresponds to a computing network, and different networks can be distinguished by using different network link information, that is, the network link information corresponding to different resource types is different.
In some embodiments, after the computing node 1 is restarted, the node agent program may be loaded, thereby implementing the acquisition and installation of the image file. The node agent program can be used for representing, downloading the mirror image file from the mirror image warehouse, automatically installing the mirror image file and generating a mirror image program.
Specifically, after the computing node 1 is powered on, the IP address may be automatically obtained through a Dynamic Host Configuration Protocol (DHCP) service, a system for starting the node agent program is booted from the network through a Pre-boot Execution Environment (PXE), and the real-time operating system kernel and the virtual memory disk ramdisk are loaded to the memory of the computing node 1, so that the operating system for starting the node agent program may automatically run the node agent program after being started. On one hand, the node agent program may perform acquisition and installation of the image file, and on the other hand, the node agent program may also collect attribute information of the compute node 1, such as information of a CPU, a memory, a hard disk, a network link information, and the like of the compute node, and send the attribute information to the resource manager and/or the database.
S12: the computing node 1 is started from the local, and when the computing node is started, the initial configuration corresponding to the closed-init, such as network configuration, hostname, hosts files, user name and password, is read, so that automatic configuration is realized, the computing node becomes a storage node, and therefore capacity expansion operation is completed.
In the embodiment of the application, on one hand, the mirror image is generated by acquiring and downloading the mirror image file from the mirror image warehouse, so that the repeated process that the resource node of the initial resource type needs to mount and install the operating system, install the distributed client software and then carry out system configuration is avoided during each expansion, the operation steps and the manual operation content are reduced, the expansion efficiency is improved, and the reasonable utilization of resources, such as the reuse of the mirror image file, is improved; on the other hand, the resource node of the initial resource type is automatically adjusted to the resource node of the target resource type based on the attribute information and the configuration information, so that manual configuration and/or network switching are avoided, the automation capacity of network management is improved, and the capacity expansion efficiency is improved; on the other hand, automatic configuration is carried out through reading and based on initialization configuration, manual configuration operation after capacity expansion is reduced, and capacity expansion efficiency is improved.
Based on the above example, the resource control type may further include a capacity reduction, and if the resource control is the capacity reduction, the configuration information in S2041 may be used to characterize the network link information of the unallocated node.
To make the reader understand more deeply, how to adjust the resource node of the initial resource type to the resource node of the target resource type during the reduction, the following description is given with reference to fig. 1 and fig. 5 (fig. 5 is an interaction schematic diagram of a resource control method according to another embodiment of the present application), and taking the resource node of the initial resource type as the computing node 1, and taking the resource node of the target resource type as the unallocated node as an example:
s21: the resource manager determines configuration information of the computing node 1, i.e. the resource manager determines network link information of the computing node 1.
S22: the resource manager sends a second message to the SDN controller, where the second message is used to instruct the SDN controller to open an installation and deployment network of the computing node 1, and the second message carries network link information of the computing node 1.
In particular, the network link information includes switch port MAC addresses and vlan ids so that the SDN controller and the switches can determine at which port how to configure to the installation deployment network.
S23: the SDN controller sends network link information of the computing node 1 to the switch.
Similarly, the SDN controller may issue the flow table including the second message to the switch through an OpenFlow protocol.
S24: the switch switches the computing node 1 to the installation deployment network.
Specifically, the switch determines the MAC address of the network port of the computing node 1 according to the network link information of the computing node 1, and switches the network port of the computing node 1 to the vlan id of the installation deployment network.
S25: the resource manager sends an instruction to the compute node 1 to restart.
S26: and the computing node 1 is restarted, and carries out formatting processing on the data stored in the disk thereof, thereby completing the capacity reduction operation.
Similarly, in some embodiments, after the computing node 1 is started, the node agent program may be loaded, so as to implement formatting processing on the data stored in the disk of the computing node 1 by the node agent program. For the description of the node broker, reference may be made to the above example, which is not described herein again.
In some embodiments, after the capacity reduction operation is completed, the resource manager may add the reduced computing node (i.e., the new unallocated node) to a preset free resource list, so that when there is a capacity expansion demand, a resource node may be selected from the free resource list for capacity expansion, thereby improving the reasonable utilization of resources and the utilization rate of resources.
In the embodiment of the application, on one hand, the capacity reduction is performed based on the attribute information and the configuration information, so that manual operation is avoided, data cleaning can be automatically completed, the automation of the capacity reduction can be realized, and the capacity reduction efficiency is improved; on the other hand, the resource nodes after capacity reduction are added to the free resource list, so that the available resources can be increased, and the utilization rate of the resources is improved.
Based on the above example, the resource control type may further include an addition, and an embodiment of the resource control type when the resource control type is an addition is now described with reference to fig. 6.
Referring to fig. 6, fig. 6 is a flowchart illustrating a resource control method according to another embodiment of the present application.
As shown in fig. 6, the method includes:
s301: and acquiring the attribute information of each resource node.
For the description of S301, reference may be made to S101, which is not described herein again.
S302: and determining the resource type and specification of the resource node to be accessed according to the attribute information.
As can be appreciated from the above examples, the attribute information can be used to characterize, configure, and/or run-related information for the resource node. For example, the configuration-related information may include the identifier of the resource node, the CPU, the memory, the hard disk, and the like; the operation-related information may include port link information, operation parameters, and the like.
The specification of the resource node to be accessed can be used for representing information of a CPU, a memory, a hard disk and the like of the resource node to be accessed.
In some embodiments, S302 may include: and determining the utilization rate of each resource node according to the attribute information, and determining the resource type and specification of the resource node to be accessed according to the utilization rate and the utilization rate threshold value.
For the explanation of the usage rate and the usage rate threshold, reference may be made to the above examples, which are not described herein again.
However, in the embodiment of the present application, the resource type and the specification of the resource node to be accessed may also be determined based on the size between the utilization rates of the resource types.
For example, if the usage rate of the storage type is greater than that of the calculation type, the resource node to be accessed is determined as the resource node of the storage type, that is, the newly added storage node.
Of course, as can be known from the above examples, the usage rate thresholds of different resource types may be different, and therefore, in this embodiment of the application, the usage rate of the storage type may also be compared with the usage rate threshold of the storage type, and the usage rate of the computation type may also be compared with the usage rate threshold of the computation type, and if the usage rate of the storage type is greater than the usage rate threshold of the storage type and the usage rate of the computation type is less than the usage rate threshold of the computation type, the resource node to be accessed is determined as the resource node of the storage type, that is, the new storage node.
Of course, in other embodiments, the newly added priority of each resource type may also be preset, and the resource type of the newly added resource node may also be determined based on the priority. The setting of the priority may be set based on the needs, experience, and the like.
S303: and selecting a mirror image file corresponding to the resource type of the resource node to be accessed from a preset mirror image warehouse.
Based on the above example, in the embodiment of the present application, a mirror image warehouse is arranged on the cloud platform, mirror images of resource types are stored in the mirror image warehouse, and when the resource type of the resource node to be accessed is determined, a mirror image corresponding to the resource type of the resource node to be accessed may be obtained from the mirror image warehouse.
For example, if the resource type of the resource node to be accessed is a storage type, acquiring a mirror image file of the storage type from a mirror image warehouse; for another example, if the resource type of the resource node to be accessed is a calculation type, acquiring a calculation type image file from an image warehouse.
S304: and performing access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, and the specification and the network link information of the resource type of the resource node to be accessed.
Based on the above example, the networks corresponding to different resource types are different, for example, the storage type corresponds to a storage network, the computing type corresponds to a computing network, and different networks are distinguished by using different network link information, that is, the network link information corresponding to different resource types is different.
For example, if the resource type of the resource node to be accessed is a storage type, S304 may include: acquiring a mirror image file (hereinafter referred to as a storage mirror image file) corresponding to the storage type from a mirror image warehouse, determining a network of the resource node to be accessed as a storage network according to the specification of the storage type and the network link information, and performing access processing on the storage node to be accessed according to the storage mirror image file and the storage network.
For another example, if the resource type of the resource node to be accessed is a calculation type, S304 may include: acquiring a mirror image file (hereinafter referred to as a calculation mirror image file) corresponding to the calculation type from a mirror image warehouse, determining a network of the resource node to be accessed as a calculation network according to the specification of the calculation type and the network link information, and performing access processing on the calculation node to be accessed according to the calculation mirror image file and the calculation network.
For the principle of access processing of the resource node to be accessed, reference may be made to the above description of the capacity expansion embodiment, and details are not described here again.
In the embodiment of the application, on one hand, the automation and the intellectualization of the new addition can be realized by performing the new addition operation based on the attribute information; on the other hand, the new addition is realized by acquiring the corresponding image file from the image warehouse, so that the repeated process that the resource node of the initial resource type needs to mount and install the operating system, then install the distributed client software and then carry out system configuration during each expansion can be avoided, the operation steps and the manual operation content are reduced, the flexibility and the efficiency of the new addition are improved, and the reuse of the image file is improved; on the other hand, the new addition is realized through the network link information of the resource type of the resource node to be accessed, so that the manual configuration can be avoided, the automation capacity of network management is improved, and the efficiency of the new addition is improved.
According to another aspect of the embodiments of the present application, there is also provided a resource control apparatus, configured to perform the method according to any of the embodiments described above, such as the method shown in any of fig. 2 to 6.
Referring to fig. 7, fig. 7 is a schematic diagram of a resource control device according to an embodiment of the present application.
As shown in fig. 7, the apparatus is applied to a cloud platform, the cloud platform includes a plurality of resource types, and each resource type includes at least one resource node, the apparatus includes:
an obtaining module 11, configured to obtain attribute information of each resource node;
and an adjusting module 12, configured to adjust a resource type of at least one resource node according to the attribute information.
In some embodiments, the adjusting module 12 is configured to determine a usage rate of each resource node according to the attribute information, determine a target resource type according to the usage rate, and adjust at least one resource node of an initial resource type to be a resource node of the target resource type according to the attribute information, where the target resource type and the initial resource type are different resource types of the multiple resource types.
In some embodiments, the adjusting module 12 is configured to determine configuration information of the target resource type, and adjust at least one resource node of the initial resource type to a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
In some embodiments, if the target resource type is a resource type to be expanded, the configuration information of the resource type to be expanded includes a specification of the resource type to be expanded, network link information, and a mirror image file stored in a preset mirror image warehouse.
In some embodiments, if the target resource type is a resource type to be reduced, the configuration information of the resource type to be reduced includes a specification of the resource type to be reduced and network link information.
In some embodiments, the adjusting module 12 is configured to clean up data of the resource node of the initial resource type, which is started based on the specification of the resource type to be condensed and the network link information.
As can be seen in conjunction with fig. 7, in some embodiments, the apparatus further comprises:
and an adding module 13, configured to add the resource node after the data is cleaned to a preset free resource list.
As can be seen in conjunction with fig. 7, in some embodiments, the apparatus further comprises:
and the selecting module 14 is configured to select a resource node for capacity expansion from the free resource list according to a preset condition when the capacity expansion needs to be performed on any one of the resource types.
In some embodiments, the preset condition includes attribute information and/or a preset priority of each resource node in the free resource list.
In some embodiments, the adjustment module 12 is configured to perform at least one of:
adjusting the resource nodes of the storage type into the resource nodes of the calculation type;
adjusting the resource nodes of the storage type into resource nodes of an idle type;
adjusting the resource nodes of the calculation type into resource nodes of the storage type;
adjusting the resource nodes of the calculation type into resource nodes of an idle type;
adjusting the idle type resource node into a storage type resource node;
and adjusting the idle type resource nodes into the calculation type resource nodes.
As can be seen in conjunction with fig. 7, in some embodiments, the apparatus further comprises:
a determining module 15, configured to determine a resource type and a specification of a resource node to be accessed according to the attribute information;
a selecting module 16, configured to select, from a preset mirror image warehouse, a mirror image file corresponding to the resource type of the resource node to be accessed;
and the access module 17 is configured to perform access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, and the specification of the resource type of the resource node to be accessed and the network link information.
According to another aspect of the embodiments of the present application, there is also provided a computer storage medium having stored thereon computer instructions, which, when executed by a processor, cause the method according to any of the above embodiments to be performed, such that the method according to any of fig. 2 to 6 is performed.
According to another aspect of the embodiments of the present application, there is also provided a computer program product, which when run on a processor, causes the method according to any of the above embodiments to be performed, such that the method according to any of the embodiments of fig. 2 to 6 is performed.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to cause the method of any of the above embodiments to be performed, such as the method of any of the embodiments of fig. 2-6.
Referring to fig. 8, fig. 8 is a block diagram of an electronic device according to an embodiment of the present application.
The electronic device is intended to represent, among other things, various forms of digital computers, such as workstations, servers, blade servers, mainframes, and other suitable computers. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
In particular, the electronic device comprises at least one processor 101, a communication bus 102, a memory 103 and at least one communication interface 104. The electronic device may be a general purpose computer or server or a special purpose computer or server.
The processor 101 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of programs in accordance with the present invention.
The communication bus 102 may include a path that conveys information between the aforementioned components.
The communication interface 104 may be any transceiver or IP port or bus interface, etc. for communicating with internal or external devices or apparatuses or communication networks, such as ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc. If the electronic device is a functional unit integrated inside the cloud platform, the communication interface 104 includes one or more of a transceiver for communication with a network outside the cloud platform, a bus interface for communication with other internal units inside the cloud platform, and the like.
The memory 103 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 103 is a non-transitory computer readable storage medium provided herein, and the memory stores instructions executable by at least one processor to cause the at least one processor to execute the resource control method provided herein. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the formation control method provided by the present application.
Memory 103, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules. The processor 101 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 103, that is, implements the resource control method in the above-described method embodiments.
The memory 103 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 103 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 103 may optionally include memory located remotely from the processor 101, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
In particular implementations, processor 101 may include one or more CPUs such as CPU0 and CPU1 in fig. 8 for one embodiment.
In particular implementations, an electronic device may include multiple processors, such as processor 101 and processor 108 in FIG. 8, for example, as an embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, the electronic device may further include an output device 105 and an input device 106, as an embodiment. The output device 105 is in communication with the processor 101 and may display information in a variety of ways (e.g., the display interfaces shown in fig. 4 and 6). For example, the output device 105 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 106 is in communication with the processor 101 and can accept user input in a variety of ways. For example, the input device 106 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
When the electronic device shown in fig. 8 is a chip, the function/implementation process of the communication interface 104 may also be implemented by pins or circuits, and the memory is a storage unit in the chip, such as a register, a cache, and the like, and the storage unit may also be a storage unit located outside the chip.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of the present application can be achieved, and the present invention is not limited thereto.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (27)

1. A resource control method is applied to a cloud platform, the cloud platform comprises a plurality of resource types, and each resource type comprises at least one resource node, the method comprises the following steps:
acquiring attribute information of each resource node;
and adjusting the resource type of at least one resource node according to the attribute information.
2. The method of claim 1, wherein adjusting the resource type of at least one of the resource nodes according to the attribute information comprises:
determining the utilization rate of each resource node according to the attribute information;
determining a target resource type according to the utilization rate;
and adjusting at least one resource node of an initial resource type into a resource node of the target resource type according to the attribute information, wherein the target resource type and the initial resource type are different resource types in the multiple resource types.
3. The method of claim 2, wherein the adjusting the resource node of at least one initial resource type to the resource node of the target resource type according to the attribute information comprises:
determining configuration information of the target resource type;
and adjusting at least one resource node of the initial resource type into a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
4. The method according to claim 3, wherein if the target resource type is a resource type to be expanded, the configuration information of the resource type to be expanded includes a specification of the resource type to be expanded, network link information, and an image file stored in a preset image repository.
5. The method of claim 3, wherein if the target resource type is a resource type to be condensed, the configuration information of the resource type to be condensed comprises a specification of the resource type to be condensed and network link information.
6. The method of claim 5, wherein adjusting at least one resource node of the initial resource type to a resource node of the target resource type according to the attribute information and the configuration information of the target resource type comprises:
and cleaning the data of the resource node of the initial resource type started based on the specification of the resource type to be contracted and the network link information.
7. The method of claim 6, wherein the resource type comprises an idle resource type, and wherein the method further comprises:
and adding the resource nodes after cleaning the data into a preset free resource list.
8. The method according to claim 7, wherein when capacity expansion is required for any of the resource types, the method further comprises:
and selecting a resource node for capacity expansion from the free resource list according to a preset condition.
9. The method according to claim 8, wherein the preset condition comprises attribute information and/or a preset priority of each resource node in the free resource list.
10. The method according to any of claims 1 to 9, wherein said adjusting the resource type of at least one of said resource nodes according to said attribute information comprises at least one of:
adjusting the resource nodes of the storage type into the resource nodes of the calculation type;
adjusting the resource nodes of the storage type into resource nodes of an idle type;
adjusting the resource nodes of the calculation type into resource nodes of the storage type;
adjusting the resource nodes of the calculation type into resource nodes of an idle type;
adjusting the idle type resource node into a storage type resource node;
and adjusting the idle type resource nodes into the calculation type resource nodes.
11. The method according to any one of claims 1 to 10, further comprising:
determining the resource type and specification of the resource node to be accessed according to the attribute information;
selecting a mirror image file corresponding to the resource type of the resource node to be accessed from a preset mirror image warehouse;
and performing access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, and the specification of the resource type of the resource node to be accessed and the network link information.
12. A resource control apparatus, applied to a cloud platform, wherein the cloud platform includes a plurality of resource types, and each resource type includes at least one resource node, the apparatus includes:
the acquisition module is used for acquiring the attribute information of each resource node;
and the adjusting module is used for adjusting the resource type of at least one resource node according to the attribute information.
13. The apparatus according to claim 12, wherein the adjusting module is configured to determine a utilization rate of each resource node according to the attribute information, determine a target resource type according to the utilization rate, and adjust at least one resource node of an initial resource type into the resource node of the target resource type according to the attribute information, wherein the target resource type and the initial resource type are different resource types of the plurality of resource types.
14. The apparatus of claim 13, wherein the adjusting module is configured to determine configuration information of the target resource type, and adjust at least one resource node of the initial resource type to a resource node of the target resource type according to the attribute information and the configuration information of the target resource type.
15. The apparatus according to claim 14, wherein if the target resource type is a resource type to be expanded, the configuration information of the resource type to be expanded includes a specification of the resource type to be expanded, network link information, and an image file stored in a preset image repository.
16. The apparatus of claim 14, wherein if the target resource type is a resource type to be scaled down, the configuration information of the resource type to be scaled down comprises a specification of the resource type to be scaled down and network link information.
17. The apparatus of claim 16, wherein the adjusting module is configured to clean up data of resource nodes of the initial resource type that are started based on the specification of the resource type to be condensed and network link information.
18. The apparatus of claim 17, further comprising:
and the adding module is used for adding the resource nodes after the data are cleaned into a preset idle resource list.
19. The apparatus of claim 18, further comprising:
and the selection module is used for selecting the resource nodes for capacity expansion from the free resource list according to preset conditions when the capacity expansion of any one resource type is required.
20. The apparatus according to claim 19, wherein the preset condition comprises attribute information and/or a preset priority of each resource node in the free resource list.
21. The apparatus of any one of claims 12 to 20, wherein the adjusting module is configured to perform at least one of:
adjusting the resource nodes of the storage type into the resource nodes of the calculation type;
adjusting the resource nodes of the storage type into resource nodes of an idle type;
adjusting the resource nodes of the calculation type into resource nodes of the storage type;
adjusting the resource nodes of the calculation type into resource nodes of an idle type;
adjusting the idle type resource node into a storage type resource node;
and adjusting the idle type resource nodes into the calculation type resource nodes.
22. The apparatus of any one of claims 12 to 21, further comprising:
the determining module is used for determining the resource type and specification of the resource node to be accessed according to the attribute information;
the selecting module is used for selecting a mirror image file corresponding to the resource type of the resource node to be accessed from a preset mirror image warehouse;
and the access module is used for performing access processing on the resource node to be accessed according to the mirror image file corresponding to the resource type of the resource node to be accessed, the specification of the resource type of the resource node to be accessed and the network link information.
23. A computer storage medium having stored thereon computer instructions which, when executed by a processor, cause the method of any of claims 1 to 11 to be performed.
24. A computer program product, characterized in that it causes the method of any of claims 1 to 11 to be performed when run on a processor.
25. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the method of any of claims 1-11 to be performed.
26. A cloud platform, comprising: a plurality of resource types, each resource type comprising at least one resource node, further comprising a resource control apparatus as claimed in any one of claims 12 to 22, or comprising an electronic device as claimed in claim 25.
27. The cloud platform of claim 26, wherein the cloud platform further comprises:
the mirror image warehouse is used for storing mirror image files corresponding to the resource types;
the software defined network controller is used for executing the configuration instruction sent to the switch by the resource manager;
the switch is used for executing communication between the resource nodes according to the configuration instruction and executing communication between the resource nodes and other components of the cloud platform.
CN202010850075.4A 2020-08-21 2020-08-21 Resource control method and device, electronic equipment, storage medium and cloud platform Pending CN114168253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010850075.4A CN114168253A (en) 2020-08-21 2020-08-21 Resource control method and device, electronic equipment, storage medium and cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010850075.4A CN114168253A (en) 2020-08-21 2020-08-21 Resource control method and device, electronic equipment, storage medium and cloud platform

Publications (1)

Publication Number Publication Date
CN114168253A true CN114168253A (en) 2022-03-11

Family

ID=80475484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010850075.4A Pending CN114168253A (en) 2020-08-21 2020-08-21 Resource control method and device, electronic equipment, storage medium and cloud platform

Country Status (1)

Country Link
CN (1) CN114168253A (en)

Similar Documents

Publication Publication Date Title
US9342376B2 (en) Method, system, and device for dynamic energy efficient job scheduling in a cloud computing environment
US9164782B2 (en) Virtual machine administration for data center resource managers
US9288147B2 (en) Dynamically balancing resources in a server farm
US10333865B2 (en) Transformation of peripheral component interconnect express compliant virtual devices in a network environment
US20180157532A1 (en) Methods and apparatus to manage workload domains in virtual server racks
JP5458308B2 (en) Virtual computer system, virtual computer system monitoring method, and network device
CN108369544B (en) Deferred server recovery in a computing system
JP2012094119A (en) Inter-virtual machine communication
JP5770284B2 (en) I / O switch control method, virtual computer control method, and computer system
US9515882B2 (en) Managing imaging of computing devices
US20160275027A1 (en) System and Method to Avoid SMBus Address Conflicts via a Baseboard Management Controller
US20180246772A1 (en) Method and apparatus for allocating a virtual resource in network functions virtualization network
US20200272526A1 (en) Methods and systems for automated scaling of computing clusters
CN115113987A (en) Method, device, equipment and medium for allocating non-uniform memory access resources
JP2014182576A (en) Configuration management device, configuration management method and configuration management program
CN111124437A (en) Bare computer resource configuration information acquisition method, system and equipment based on OpenStack
US9317355B2 (en) Dynamically determining an external systems management application to report system errors
CN109962941B (en) Communication method, device and server
CN114168253A (en) Resource control method and device, electronic equipment, storage medium and cloud platform
CN116010307A (en) Server resource allocation system, method and device
CN114385537A (en) Page slot number dynamic allocation method, device, equipment and medium
CN114448932A (en) Address allocation method and device and electronic equipment
CN109002347B (en) Virtual machine memory allocation method, device and system
WO2012054023A1 (en) Computer system with computers that perform network boots
JP6657910B2 (en) Band setting method, band setting program, information processing apparatus and information processing system

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