Resource management using hierarchical finite state machines

Hierarchical finite state machines are used to manage complex computing environments, addressing the lack of automation in existing methods by enabling efficient resource allocation and disaster recovery, thus improving scalability and energy management within these environments.

WO2024177628A1PCT designated stage expired Publication Date: 2024-08-29RAKUTEN MOBILE INC +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/US2023/013625
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-29

Smart Images

  • Figure US2023013625_29082024_PF_FP_ABST
    Figure US2023013625_29082024_PF_FP_ABST
Patent Text Reader

Abstract

A system for resource management includes a resource manager, and a lifecycle manager. The lifecycle manager includes a first FSM, and one or more second FSMs under the first FSM. The first FSM includes first states of a set of resources. The set of resources includes one or more subsets of resources. Each second FSM includes second states of a corresponding subset of resources. The resource manager receives information about the set of resources. The resource manager sends, responsive to the received information, at least one trigger to the lifecycle manager to cause a state transition of the first FSM, wherein the state transition of the first FSM further causes a corresponding state transition of each second FSM. The resource manager enables deployment of at least one application in the set of resources based on at least current states of the first and second FSMs.
Need to check novelty before this filing date? Find Prior Art

Description

RESOURCE MANAGEMENT USING HIERARCHICAL FINITE STATEMACHINESTECHNICAL FIELD

[0001] The present disclosure is related to resource management with hierarchical finite state machines (FSMs).BACKGROUND

[0002] Companies or organizations nowadays often require complex computing environments for their operations, customer services, developments, or the like. Design and operation considerations for such complex computing environments include resource management methods for efficiently and / or effectively managing different types, locations, usage of various resources in the computing environments.SUMMARY

[0003] In other approaches, various resource management methods were proposed for managing resources, but without automation intelligence. The other approaches lack many features such as explicit state management for lifecycle operations, proper accounting and automation required for horizontal scaling, and automated disaster recovery.

[0004] In some embodiments, a resource management approach is based on hierarchical finite state machines (also referred to as hierarchical FSMs or HSMs). In at least one embodiment, resource management using hierarchical FSMs is applied to manage lifecycles of one or more clusters, as well as their respective child and / or grandchild entities, such as resource pools, nodes, tenants, or the like. As a result, in one or more embodiments, it is possible to manage clusters more efficiently in terms of infrastructural resources, energy saving and resource reservations. In some embodiments, this resource management approach using hierarchical FSMs improves cluster and / or resource pool scalability.

[0005] In some embodiments, a system for resource management using hierarchical finite state machines comprises a resource manager, and a lifecycle manager coupled to the resource manager. The lifecycle manager comprises a first finite state machine (FSM) at a first level, and one or more second FSMs at a second level under the first level. The firstFSM comprises a plurality of first states of a set of resources. The set of resources comprises one or more subsets of resources. Each second FSM among the one or more second FSMs comprises a plurality of second states of a corresponding subset among the one or more subsets of resources. The resource manager is configured to receive information about the set of resources. The resource manager is further configured to, responsive to the received information, send at least one trigger to the lifecycle manager to cause a state transition of the first FSM among the plurality of first states, wherein the state transition of the first FSM further causes a corresponding state transition of each second FSM of the one or more second FSMs among the plurality of second states. The resource manager is further configured to enable deployment of at least one application in the set of resources based on at least current states of the first FSM and the one or more second FSMs.

[0006] In some embodiments, a computer program product comprises a non-transitory, tangible computer readable storage medium storing a computer program. The program, when executed by at least one processor, causes the at least one processor to execute hierarchical finite state machines (FSMs). The hierarchical FSMs comprise: a cluster FSM, one or more resource pool FSMs under the cluster FSM, and one or more node FSMs under each resource pool FSM among the one or more resource pool FSMs. The cluster FSM comprises states of a cluster of nodes, the cluster comprising one or more resource pools each including one or more nodes of the cluster. The one or more resource pool FSMs correspond to and comprise states of the one or more resource pools. Each of the one or more node FSMs under each resource pool FSM corresponds to and comprises states of a node in the resource pool corresponding to the resource pool FSM. The processor is further caused to, responsive to a state transition in a first FSM, cause a corresponding state transition in at least one second FSM over or under the first FSM, the first FSM and the second FSM being among the hierarchical FSMs. The processor is further caused to enable deployment of an application in a resource pool among the one or more resource pools of the cluster, based on current states of the cluster FSM and the corresponding resource pool FSM.

[0007] In some embodiments, a method performed at least in part by at least one processor comprises executing hierarchical finite state machines (FSMs). The hierarchical FSMs comprise: a cluster FSM, one or more resource pool FSMs under the cluster FSM, and one or more node FSMs under each resource pool FSM among the one or more resource pool FSMs. The cluster FSM comprises states of a cluster of nodes, the cluster comprising one or moreresource pools each including one or more nodes of the cluster. The one or more resource pool FSMs correspond to and comprise states of the one or more resource pools. Each of the one or more node FSMs under each resource pool FSM corresponds to and comprises states of a node in the resource pool corresponding to the resource pool FSM. The method further comprises, responsive to an event detected by an event consumer module, or a change captured by a worker module, at a node of the cluster, causing execution of one or more workflows to update information of the one or more resource pools and the nodes in the cluster, while the one or more workflows being executed, transitioning the cluster FSM to a sync ongoing state and transitioning the one or more resource pool FSMs to an updating state, transitioning the node FSM corresponding to the node to a state corresponding to the detected event or the captured change, based on the updated information of the one or more resource pools and the nodes in the cluster, updating an amount of resources available in each resource pool among the one or more resource pools, and an amount of resources available in the cluster, and upon completion of the execution of the one or more workflows, transitioning the cluster FSM to a sync success state and transitioning the one or more resource pool FSMs to an updated state. The method further comprises enabling deployment of an application in the cluster based on current states of the cluster FSM and the one or more resource pool FSMs, and the available amounts of resources in the cluster and the one or more resource pools.BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Aspects of the present disclosure are best understood from the following detailed description when read with the accompanying FIGS. In accordance with the standard practice in the industry, various features are not drawn to scale. In fact, the dimensions of the various features be arbitrarily increased or reduced for clarity of discussion.

[0009] FIG. 1A is a schematic diagram of a system with resource management using hierarchical finite state machines, in accordance with some embodiments.

[0010] FIG. IB is a schematic diagram of a cluster, in accordance with some embodiments.

[0011] FIG. 2 is a schematic diagram of operations in a cluster finite state machine (FSM), in accordance with some embodiments.

[0012] FIG. 3 is a schematic diagram of operations in a resource pool FSM, in accordance with some embodiments.

[0013] FIG. 4 is a schematic diagram of operations in a node FSM, in accordance with some embodiments.

[0014] FIG. 5 is a schematic diagram of operations in a tenant FSM, in accordance with some embodiments.

[0015] FIGs. 6A-6C are flow charts of various processes for resource management using hierarchical finite state machines, in accordance with some embodiments.

[0016] FIG. 7 is a schematic diagram of a computer system, in accordance with some embodiments.DETAILED DESCRIPTION

[0017] The following disclosure includes many different embodiments, or examples, for implementing different features of the subject matter. Specific examples of components, values, operations, materials, arrangements, or the like, are described below to simplify the present disclosure. These are, of course, merely examples and are not intended to be limiting. Other components, values, operations, materials, arrangements, or the like, are contemplated. For example, the formation of a first feature over or on a second feature in the description that follows include embodiments in which the first and second features are formed in direct contact, and also include embodiments in which additional features be formed between the first and second features, such that the first and second features not be in direct contact. In addition, the present disclosure repeats reference numerals and / or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and / or configurations discussed. Further, spatially relative terms, such as “beneath,” “below,” “lower,” “above,” “upper” and the like, be usable herein for ease of description to describe one element or feature’s relationship to another element(s) or feature(s) as illustrated in the figures. The spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. The apparatus be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors.

[0018] FIG. 1 A is a schematic diagram of a system 100 with resource management using hierarchical finite state machines, in accordance with some embodiments.

[0019] The system 100 comprises a resource manager 110, a lifecycle manager (LCM) 120 coupled to the resource manager 110, and a policy engine 130 coupled to the lifecycle manager 120. As described in more detail herein, in one or more embodiments, hierarchical FSMs corresponding to the resources to be managed are stored in or implemented by the lifecycle manager 120. The lifecycle manager 120 transitions (switches or moves) the hierarchical FSMs through multiple states in response to inputs or triggers received from the resource manager 110. The lifecycle manager 120 further controls or causes execution of one or more workflows 140 in accordance with states of one or more of the hierarchical FSMs and / or in accordance with one or more policies managed by the policy engine 130. The execution of one or more workflows 140 is performed in one or more clusters 150 which include the resources to be managed. The workflow execution causes states, data or information of one or more clusters 150 to be reported to or captured by the resource manager 110. Additionally or alternatively, one or more events occurring in one or more clusters 150 are captured by the resource manager 110. In some embodiments, one or more states, data, information, or events of the clusters 150 are reported or captured from an observability framework (OBF) 160 which is configured to cooperate with the clusters 150. Based on the states, data, information, or events reported or captured from the one or more clusters 150 directly and / or through the OBF 160, the resource manager 110 provides corresponding inputs or triggers to the lifecycle manager 120 to cause one or more state transitions in one or more of the hierarchical FSMs. In at least one embodiment, the described process is performed in one or more iterations to obtain updated states or information of the resources in the clusters 150, as well as corresponding updated states of the hierarchical FSMs. Based on the updated states or information of the resources in the clusters 150 and / or the updated states of the hierarchical FSMs, the resource manager 110 enables deployment of at least one application in one or more clusters 150. Other features and / or operations and / or configurations are within the scopes of various embodiments, as described herein.

[0020] The resource manager 110 comprises a plurality of components including an application programming interface (API) server 112, a transaction manager 113, one or more worker modules 114, one or more event consumer modules 115, and a database 116. In some embodiments, the resource manager 110 comprises computer hardware, and one or more software applications which, when executed on the computer hardware, cause the computer hardware to perform one or more operations and / or processing described herein. An example of computer hardware comprises at least one computer system described with respect to FIG.7. In some embodiments, the resource manager 110 comprises multiple computer systems coupled to each other via one or more networks. For example, one or more embodiments, each of the API server 112, transaction manager 113, worker modules 114, event consumer modules 115, and database 116 is implemented by, or on, one or more computer systems and / or coupled with each other via one or more buses and / or networks as described with respect to FIG. 7, and / or via one or more software buses. In some embodiments, functions and / or operations described herein for the components of the resource manager 110 are implemented by one or more hardware processors executing corresponding software or programs.

[0021] The API server 112 is configured to be coupled to user equipment (not shown) of a remote user and / or to provide a user interface (UI) such as a graphical UI (GUI) on a display screen for a local user, as schematically indicated by the double-arrow in FIG. 1 A. The API server 112 enable users to perform one or more resource management operations, including, but not limited to, controlling, configuring, scaling, monitoring, or the like, through interactions with the resource manager 110. In at least one embodiment, the user is a service provider or business that uses the system 100 to manage one or more clusters 150 to provide and / or handle services, e.g., communication services, data center or data warehouse services, to / for consumers (also referred to as clients or end users) of the service provider or business. For example, the API server 112 receives inputs from a user regarding registering, configuring, reserving or managing one or more clusters 150 or subsets thereof, provides recommendations regarding a cluster 150 and / or a subset thereof for deployment or execution of the user’s application, and causes execution of the application in response to the user’s instruction.

[0022] The transaction manager 113 is configured to manage the worker modules 114, and / or to make sure that the worker modules 114 are running properly. For example, when a worker module 114 stops working, the transaction manager 113 causes the worker module 114 to be restarted. Further, in a reconciliation or sync or resync process described herein, the transaction manager 113 is configured for ensuring that the current task is completed properly end to end. In some embodiments, the transaction manager 113 provides inputs or triggers to the lifecycle manager 120 for causing one or more state transitions in one or more hierarchical FSMs in the lifecycle manager 120. Example state transitions described herein include, but are not limited to, cluster and / or tenant registration, tenant reservation, or the like. In at least oneembodiment, user inputs are provided through the API server 112 and transaction manager 113 to the lifecycle manager 120, and / or feedback from the lifecycle manager 120 is provided through the transaction manager 113 and API server 112 to the user.

[0023] The worker modules 114 are distributed at various locations in the clusters 150 to be managed. In some embodiments, one or more worker modules 114 comprise software modules executed on computer hardware of the clusters 150. For example, for a cluster 150, various worker modules 114 are executed on different nodes of the cluster 150, on a cluster manager of the cluster 150, and / or on other computer hardware of the cluster 150. For a further example, one or more clusters 150 are executed on the OBF 160. In some embodiments, the worker modules 114 are configured to collect, periodically or on user demand, states and / or information about the clusters 150 to make sure that the states and / or information about the clusters 150 in the resource manager 110 are up-to-date. This process is referred to in one or more embodiments as reconciliation. In a reconciliation process, the worker modules 114 reconcile with the corresponding cluster 150 to update information such as the amount of resources that are consumed, the amount of resources that are available for usage, or the like. Information and / or states of the clusters 150 captured by the worker modules 114 are stored in the database 116. In some embodiments, the worker modules 114 are configured as monitoring entities executed in the background to fetch information about the clusters 150 and keep the records of the clusters 150 up-to-dated in the database 116. In some embodiments, one or more worker modules 114 are built-in one or more clusters 150, and are considered parts of the clusters 150 instead of the resource manager 110.

[0024] The event consumer modules 115 are distributed at various locations in the clusters 150 to be managed. In some embodiments, one or more event consumer modules 115 comprise software modules executed on computer hardware of the clusters 150. For example, for a cluster 150, various event consumer modules 115 are executed on different nodes of the cluster 150, on a cluster manager of the cluster 150, and / or on other computer hardware of the cluster 150. For a further example, one or more clusters 150 are executed on the OBF 160. In some embodiments, while the worker modules 114 are configured to collect states and / or information about the clusters 150 periodically or on demand, the event consumer modules 115 are configured to detect events occurring in the clusters 150 in real time. In at least one embodiment, each worker module 114 is configured to listen to, or detect, a specific event in a cluster 150. Example events include, but are not limited to, a failed node (e.g., Node Down),a unreachable node (Node Unreachable), a certification that has stopped working, abnormal statuses of one or more software modules, or the like. Like the worker modules 114, a purpose of the event consumer modules 115 is to make sure that the states and / or information about the clusters 150 in the resource manager 110 are up-to-date. Information about events captured by the event consumer modules 115 are stored in the database 116. In some embodiments, one or more event consumer modules 115 are built-in one or more clusters 150, and are considered parts of the clusters 150 instead of the resource manager 110. For example, one or more events are emitted by a data center management tool, e.g., a cluster manager of a cluster 150. In at least one embodiment, by using both worker modules 114, which provide periodic or user- triggered (on demand) updates, and event consumer modules 115, which detect real time events, it is possible to ensure that information and / or states about the clusters 150 stay up-to-dated in the database 116.

[0025] The database 116 stores configurations of the clusters 150 and their subsets as described herein. The database 116 further stores states, information and / or events captured by the worker modules 114 and / or event consumer modules 115 in the clusters 150. In some embodiments, the database 116 also stores inputs or triggers sent to the lifecycle manager 120, and / or stores states of various hierarchical FSMs managed by the lifecycle manager 120. In at least one embodiment, by storing information, states and / or events of multiple cluster 150 in the database 116 of the resource manager 110, it is possible to enable a user to manage multiple clusters 150 through a single, centralized tool or UI provided at the resource manager 110. In one or more embodiments, the resource manager 110 is configured to consider information and / or states of all clusters 150 stored in the database 116, and recommend an optimal cluster 150 or a subset thereof for a user to deploy an application.

[0026] The lifecycle manager 120 is configured to implement the hierarchical FSMs as described herein. For example, the lifecycle manager 120 stores states of the hierarchical FSMs, and causes state transitions of the hierarchical FSMs in response to inputs or triggers received from the resource manager 110. The lifecycle manager 120 further controls or causes execution of one or more workflows 140 in accordance with states of one or more of the hierarchical FSMs and / or in accordance with one or more policies managed by the policy engine 130. In some embodiments, the lifecycle manager 120 causes one or more state transitions in one or more hierarchical FSMs in response to feedback from one or more workflows 140. In some embodiments, the lifecycle manager 120 comprises computer hardware, and one or moresoftware applications which, when executed on the computer hardware, cause the computer hardware to perform one or more operations and / or processing described herein. An example of computer hardware comprises at least one computer system described with respect to FIG. 7. In some embodiments, the lifecycle manager 120 comprises multiple computer systems coupled to each other via one or more networks. In at least one embodiment, the resource manager 110 and the lifecycle manager 120 are implemented on the same computer hardware.

[0027] The policy engine 130 is configured to manage, e.g., to receive, store, update, one or more policies applicable to one or more clusters 150. Example policies include, but are not limited to, business policies, technical policies, or the like. In some embodiments, business policies are related to consumers, e.g., business rules that define or constrain how a business or service operates. In at least one embodiment, technical policies are related to a technical layer that is concerned with technical details of one or more databases, data centers, system infrastructures, software parts, or the like. In some embodiments, the policy engine 130 comprises computer hardware, and one or more software applications which, when executed on the computer hardware, cause the computer hardware to perform one or more operations and / or processing described herein. An example of computer hardware comprises at least one computer system described with respect to FIG. 7. In some embodiments, the policy engine 130 comprises multiple computer systems coupled to each other via one or more networks. In at least one embodiment, the policy engine 130 is omitted, or incorporated in the lifecycle manager 120.

[0028] A workflow comprises a series of tasks to be executed. In the system 100, the workflows 140 include various series of tasks to be executed in the clusters 150 to obtain information and / or states of the clusters 150 and / or their subsets. In at least one embodiment, the workflows 140 are managed by a workflow engine running on computer hardware, such as a computer system described with respect to FIG. 7. An example workflow engine includes Multi Data Center Automation Platform (MDCAP). Other workflow engine configurations are within the scopes of various embodiments. In some embodiments, the workflow engine managing the workflows 140 is incorporated in the lifecycle manager 120, or in one or more clusters 150. For example, the workflow engine is incorporated, in one or more embodiments, in the cluster manager of a cluster 150.

[0029] The clusters 150 include the resources to be managed. Examples of the resources to be managed include, but are not limited to, numbers and / or speeds of central processingunit (CPU) cores, numbers and / or speeds of virtual CPU (vCPU) cores, numbers and / or speeds of graphics processing unit (GPU) cores, amounts of memory, amounts of storage, or the like. Examples of memory comprise cache, random-access memory (RAM), video RAM (VRAM), or the like. Examples of storage include, but are not limited to, hard disk drive (HDD), solid-state drive (SSD), or the like. An example configuration of a cluster 150 is described with respect to FIG. IB.

[0030] The OBF 160 is configured to generate more events related to one or more applications deployed in the clusters 150, i.e., the applications that are running (or executed) on computer hardware at various nodes of the clusters 150. In some embodiments, events generated by the OBF 160 are application-related, rather than hardware-related. Examples of application-related events include, but are not limited to, an application going down, an application being deleted due to an error, or the like. In at least one embodiment, the OBF 160 comprises multiple software modules distributed and executed at different nodes in various clusters 150. The OBF 160 is configured as a single source or aggregation point of application-related events captured at various locations or nodes in the clusters 150. The OBF 160 reports the captured events to the resource manager 110, e.g., through the event consumer modules 115. As a result, it is possible, in one or more embodiments, to simply collect application-related events for all clusters 150 at the OBF 160, instead of having to acquire such events from the clusters 150 individually. In some embodiments, the OBF 160 is omitted, and / or functionality of the OBF 160 is incorporated in the clusters 150, e.g., at their respective cluster managers.

[0031] FIG. IB is a schematic diagram of a cluster 150, in accordance with some embodiments.

[0032] The cluster 150 in FIG. IB is an example of one or more of the clusters 150 in FIG. 1 A. The cluster 150 comprises a plurality of nodes interconnected, e.g., by a network 157, and configured to work in cooperation. Examples of nodes include, but are not limited to, physical computer systems as described with respect to FIG. 7, virtual machines (VMs) executed on physical computer systems, or the like.

[0033] The nodes in the cluster 150 are grouped into one or more resource pools, such as the resource pools 151, 152, 153 illustrated in FIG. IB. The resources in a resource pool are usable for deployment of one or more applications. In an example, an application is deployedon two or more nodes of a resource pool. In some embodiments, an application may not be deployed on nodes of multiple resource pools. In other words, resource pools are configured to provide resource isolation between different applications or users within the cluster. In some embodiments, a node belongs to only one resource pool. In other words, resource pools are non-overlapping groups of nodes inside a cluster. The numbers of resource pools in the cluster 150 and / or the numbers of nodes in the resource pools are not limited to the example configuration in FIG. IB. For example, it is possible, in one or more embodiments, for a cluster to include a single resource pool. For another example, it is possible in one or more embodiments that a resource pool includes a single node, i.e., an individual node may be considered as a resource pool. The nodes in the resource pools 151, 152, 153 are examples of in-use nodes, empty nodes, or backup nodes. An in-use node is an active node (or pooled node, or pooled-in node) on which at least one application is deployed or executed. An empty node is an active node (i.e., a node immediately available for application deployment) but has no application deployed thereon. A backup node is not currently active, but is ready to become available for application deployment as an empty node.

[0034] Besides the nodes included in the resource pools 151, 152, 153, the cluster 150 also comprises nodes 154, 155 which are not included in a resource pool. The nodes 154 are examples of an out-of-pool node, or a under-maintenance node. An out-of-pool node is not included in a resource pool, but remains coupled to the network 157. The out-of-pool node is shutdown or in a sleep mode to save power. When a demand for more resources arises, an out- of-pool node may be quickly restarted, or waken up, and included in a resource pool for application deployment. The node 155 is an example of a failed node, or a decommissioned node. A failed node is a node at which a failure, e.g., a hardware failure, has been detected, e.g., by an event consumer modules 115. The failed node is disconnected from the network 157 for service or repair. A decommissioned node is a node which is disconnected from the network 157 in accordance with a user’s decision. A decommissioned node may be a failed node, or may be a healthy node that is no longer needed or required by the user and / or demand. The described types of nodes are examples. Other type of nodes are within the scopes of various embodiments.

[0035] In some embodiments, a resource pool includes one or more tenants. In at least one embodiment, while resource pools are configured to provide resource isolation between different applications or users within a cluster, tenants are configured to provide resourceisolation between different applications or users within a resource pool. In at least one embodiment, a tenant, depending on an application deployed therein, consumes the resources from the resource pool as long as the cumulative resources in the resource pool are still within the resource limits set for that particular tenant. In some embodiments, a tenant for an application (or user) means that the application (or user) is given a specific amount of resources for deployment. For example, the resource pool 152 includes a tenant 158 which is an amount of resources specified for at least one particular application or user. In the example configuration in FIG. IB, the tenant 158 comprises some resources 158A of a node 159A, and some resources 158B of a node 159B. Other resource allocations for the tenant 158 among various nodes of the resource pool 152 are possible, provided that the amount of resources is at least as specified by a configuration or profile of the tenant 158. In some embodiments, another application not specified in the configuration or profile of the tenant 158 may not be deployed in the amount of resources specified for the tenant 158.

[0036] In some embodiments, the clusters 150 is an example of a set of resources to be managed, and the resource pools 151, 152, 153 are examples of subsets of resources to be managed. In at least one embodiment, one of the resource pools 151, 152, 153 is an example of a set of resources to be managed, and each node or tenant in the resource pool is an example of a subset of resources to be managed.

[0037] The cluster 150 further comprises a cluster manager 156 coupled to the network 157 and configured to manage the nodes in the cluster 150. The cluster manager 156 is further configured to communicate with other computer systems and / or applications outside the cluster 150, as schematically indicated by the double-arrow in FIG. IB. In some embodiments, the cluster manager 156 comprises computer hardware, and one or more software applications which, when executed on the computer hardware, cause the computer hardware to perform one or more operations and / or processing described herein. An example of computer hardware comprises at least one computer system described with respect to FIG. 7. In some embodiments, the cluster manager 156 is implemented on a node (e.g., a Master node) of the cluster 150. In at least one embodiment, the cluster manager 156 is implemented by a separate computer system. In one or more embodiments, the cluster manager 156 is implemented as a Kubemetes endpoint. Other cluster manager configurations are within the scopes of various embodiments. The cluster manager 156 is configured to provide states and / or information about the cluster 150 itself, as well as states and / or information about various nodes, resource pools and / ortenants in the cluster 150, in response to the execution of one or more workflows 140 in or with respect to the cluster 150. In some embodiments, the states and / or information provided by the cluster manager 156 are captured by one or more worker modules 114 and / or event consumer modules 115 in the cluster 150. The cluster manager 156 is further configured to perform other tasks in accordance with user instructions and / or instructions from other computer systems, e.g., to switch a node among various states or modes as described herein, e.g., to put a node to the sleep mode, trigger the maintenance of a node, disconnect a failed node, or the like.

[0038] As described herein, the lifecycle manager 120 comprises or is configured to implement a plurality of hierarchical FSMs. The hierarchical FSMs are arranged in various hierarchical levels corresponding to hierarchical levels in which the resources to be managed are organized. In the example configuration in FIG. IB, the cluster 150 represents a first level of resources, the resource pools 151-153 represent a second level of resources, the nodes (e.g., 159A, 159B, other nodes are not individually numbered) and the tenant 158 represent a third level of resources to be managed. The lifecycle manager 120 comprises, at a first level, a cluster FSM corresponding to the cluster 150. The lifecycle manager 120 further comprises, at a second level, resource pool FSMs each corresponding to one of the resource pools 151- 153. The lifecycle manager 120 further comprises, at a third level, node FSMs each corresponding to a node in the cluster 150, and a tenant FSM corresponding to the tenant 158. Examples of cluster FSM, resource pool FSM, node FSM and tenant FSM are correspondingly described with respect to FIGs. 2-5. Detailed descriptions below are given with respect to one cluster 150, such as the cluster 150 in FIG. IB. Similar descriptions are applicable to other clusters 150 managed by the system 100.

[0039] FIG. 2 is a schematic diagram of operations in a cluster FSM 200, in accordance with some embodiments.

[0040] The cluster FSM 200 is implemented in the lifecycle manager 120, and comprises states of a cluster, such as the cluster 150 in FIG. IB. In the example configuration in FIG. 2, the cluster FSM 200 comprises states 210, 220, 230, 240, 250, 260, and state transitions 212, 223, 232, 224, 245, 254, 256, 265 among the states 210, 220, 230, 240, 250, 260. At a given time, a current state of the cluster FSM 200 is one of the states 210, 220, 230, 240, 250, 260. The lifecycle manager 120 is configured to cause the cluster FSM 200 to move, or transition, to another state among the states 210, 220, 230, 240, 250, 260 by a corresponding state transition between the two states. A state transition is caused by the lifecycle manager 120 inresponse to an input, or trigger, from the resource manager 110, from a workflow 140 being executed, or from a resource pool FSM under the cluster FSM 200. Several example scenarios of state transitions in the cluster FSM 200 in accordance with some embodiments are described herein.

[0041] In some embodiments, the cluster FSM 200 has the Start state 210 when the cluster FSM 200 is initialized. In response to user input through the API server 112 to register a new cluster, such as the cluster 150, in the resource manager 110, a trigger is sent by the resource manager 110 to the lifecycle manager 120. The trigger causes the lifecycle manager 120 to perform the state transition 212 in the cluster FSM 200 from the Start state 210 to the Add_Started state 220.

[0042] In response to the cluster FSM 200 having the Add_Started state 220, the lifecycle manager 120 sends a trigger 281 to start one or more resource pool FSMs for the user to register corresponding one or more resource pools in the cluster 150. A detailed description of an example resource pool FSM is given herein with respect to FIG. 3.

[0043] Also in response to the cluster FSM 200 having the Add_Started state 220, the lifecycle manager 120 further causes execution of one or more workflows 140 in the cluster 150 to collect various states and / or information of the cluster 150, for example, how many resources of each type (e.g., CPU corers, GPU cores, memory, storage, or the like) are available for application deployment within the cluster 150, what are the types of nodes (e.g., physical nodes, VMs) in the cluster 150, how many nodes of each type are there, how many resources of each type are available at each and every node, or the like. In at least one embodiment, the workflows 140 are executed to have the required states and / or information obtained from the cluster manager 156 of the cluster 150, captured through one or more worker modules 114 and / or event consumer modules 115, and reported to the resource manager 110. The captured states and / or information of the cluster 150 are stored in the database 116. The described process is referred to in one or more embodiments as a sync or reconciliation process.

[0044] In response to the reconciliation process being unsuccessful, the lifecycle manager 120 causes the state transition 223 in the cluster FSM 200 from the Add_Started state 220 to the Add_F ailed state 230. In some embodiments, the reconciliation process is considered unsuccessful when the states and / or information captured from the cluster 150 are incomplete, e.g., when one or more workflows 140 failed or were not completely executed, and / or whenthe cluster manager 156 and / or one or more worker modules 114 and / or one or more event consumer modules 115 were unresponsive. In at least one embodiment, the trigger that causes the state transition 223 to the Add Failed state 230 comes from one or more workflows 140 that failed. In some embodiments, in the Add Failed state 230, the resource manager 110 provides, e.g., through the API server 112, a notice to the user that the reconciliation process was unsuccessful.

[0045] In at least one embodiment, the user is provided, e.g., through the API server 112, with an option to restart the reconciliation process. In response to user input provided to restart the reconciliation process, the lifecycle manager 120 causes the state transition 232 in the cluster FSM 200 from the Add Failed state 230 back to the Add Started state 220 to perform the reconciliation process again. In some embodiments, the decision to restart the reconciliation process is automatically performed by the lifecycle manager 120 and / or the resource manager 110, e.g., after a predetermined waiting time. In some embodiments, the lifecycle manager 120 and / or the resource manager 110 keep restarting the reconciliation process, and / or the user is given the option to manually do so, until it becomes successful. In at least one embodiment, when a number, or a time period, of unsuccessful reconciliations reached a predetermined threshold, the process of adding a new cluster in the system 100 is aborted.

[0046] In response to the reconciliation process being successful, the lifecycle manager 120 causes the state transition 224 in the cluster FSM 200 from the Add_Started state 220 to the Sync Succes state 240. In at least one embodiment, each of the workflows 140 that were triggered by the lifecycle manager 120 to collect states and / or information of the cluster 150 sends a trigger reporting a success when the workflow is completed without fail. When all of such workflows 140 report successes, the state transition 224 to the Sync_Succes state 240 is triggered. The cluster FSM 200 having the Sync_Succes state 240 indicates that all states and / or information of the cluster 150 are currently up-to-dated. In this state of the cluster FSM 200, the resource manager 110, is configured to enable application deployment in the cluster 150, as described further herein.

[0047] When the cluster FSM 200 is at the Sync_Succes state 240 and in response to a trigger 285 received from the resource manager 110, the lifecycle manager 120 causes the state transition 245 in the cluster FSM 200 from the Sync_Succes state 240 to the Sync_Ongoing state 250. This also triggers the underlying resource pool FSMs, tenant FSMs, and node FSMsas described herein. In some embodiments, the trigger 285 comes from the API server 112 when a user wishes to obtain on demand the current states and / or information of the cluster 150. In one or more embodiments, the trigger 285 comes from an event consumer module 115 which captured, e.g., in real time, an event in the cluster 150 that requires updating the current states and / or information of the cluster 150. An example event includes, but is not limited to, a failed node, a unreachable node, or the like. In at least one embodiment, the trigger 285 comes from the resource manager 110 when it is time for periodically updating the current states and / or information of the cluster 150.

[0048] In response to the cluster FSM 200 having the Sync_Ongoing state 250, the lifecycle manager 120 sends a trigger 286 to the one or more resource pool FSMs under the cluster FSM 200 to cause a state transition in each of the resource pool FSM and updating of each of the corresponding resource pools in the cluster 150. A detailed description of an example updating of a resource pool FSM and the corresponding resource pool in response to the trigger 286 is given herein with respect to FIG. 3.

[0049] Also in response to the cluster FSM 200 having the Sync_Ongoing state 250, the lifecycle manager 120 further causes execution of one or more workflows 140 in the cluster 150 to update the current states and / or information of the cluster 150. For example, the states and / or information obtained by executing one or more workflows 140 and captured through one or more worker modules 114 and / or event consumer modules 115, as described with respect to the Add Started state 220 are updated at the Sync Ongoing state 250, and the updated states and / or information are stored in the database 116. This process is referred to in one or more embodiments as a resync or reconciliation process.

[0050] In response to the resync process being unsuccessful, the lifecycle manager 120 causes the state transition 256 in the cluster FSM 200 from the Sync Ongoing state 250 to the Sync Failed state 260. In some embodiments, the resync process is considered unsuccessful when the states and / or information updated from the cluster 150 are incomplete, as described with respect to the Add_F ailed state 230. In some embodiments, the resync process is restarted by the user input through the API server 112, and / or automatically by the resource manager 110 and / or lifecycle manager 120, and the lifecycle manager 120 moves the cluster FSM 200 by the state transition 265 back to the Sync Ongoing state 250 to perform the resync process again. In some embodiments, the resource manager 110 and / or lifecycle manager 120 keep restarting the resync process until it becomes successful. Further operations of the cluster FSM200 are described herein in conjunction with one or more of resource pool FSMs, node FSMs, or tenant FSMs.

[0051] FIG. 3 is a schematic diagram of operations in a resource pool FSM 300, in accordance with some embodiments.

[0052] The resource pool FSM 300 is implemented in the lifecycle manager 120, is at a level under the cluster FSM 200, and comprises states of a corresponding resource pool, e.g., 151, 152, or 153, in the cluster 150. The number of resource pool FSMs 300 under the cluster FSM 200 is the same as the number of resource pools set in the clusters 150. For the example configuration in FIG. IB, the lifecycle manager 120 comprises, under the cluster FSM 200, three resource pool FSMs corresponding to three resource pools 151-153. In FIG. 3, the resource pool FSM 300 comprises states 310, 320, 330, 340, 350, 360, and state transitions 312, 323, 334, 345, 346, 363 among the states 310, 320, 330, 340, 350, 360. At a given time, a current state of the resource pool FSM 300 is one of the states 310, 320, 330, 340, 350, 360. The lifecycle manager 120 is configured to cause the resource pool FSM 300 to move, or transition, to another state among the states 310, 320, 330, 340, 350, 360 by a corresponding state transition between the two states. A state transition in the resource pool FSM 300 is caused by the lifecycle manager 120 in response to an input, or trigger, from the resource manager 110, from a workflow 140 being executed, from a node FSM under the resource pool FSM 300, or from the cluster FSM 200. Several example scenarios of state transitions in the resource pool FSM 300 in accordance with some embodiments are described herein.

[0053] In some embodiments, the resource pool FSM 300 has the Start state 310 when the resource pool FSM 300 is initialized, e.g., by a user registering a new resource pool through the API server 112. In some embodiments, the resource pool FSM 300 is initialized in response to the trigger 281 from the cluster FSM 200 when the cluster 150 is first registered with the resource manager 110. The lifecycle manager 120 causes the state transition 312 to move the resource pool FSM 300 to the Added state 320. At the Added state 320, the resource manager 110 prompts the user, through the API server 112, to enter information for registering one or more resource pools in the cluster 150 which is being registered with respect to the cluster FSM 200 as described herein. In some embodiments, multiple resource pool FSMs 300, each for a corresponding resource pool, are started and executed in parallel. In an example, information for registering one or more resource pools and entered by the user through the API server 112 include, but are not limited to, the number of resource pools to be registered, one or morepartitions between the resource pools, the size and / or number of each type of resources to be included in each resource pool, or the like. When the user input specifies that one resource pool is to be registered in the cluster 150, there will be one corresponding resource pool FSM 300 registered under the cluster FSM 200. When the user input specifies that two resource pools are to be registered in the cluster 150, there will be two corresponding resource pool FSMs 300 registered under the cluster FSM 200, and so on.

[0054] In response to user input through the API server 112 to enter the information for registering a corresponding resource pool, the lifecycle manager 120 sends a trigger 382 to start one or more node FSMs each corresponding to a node in the resource pool registered through the resource pool FSM 300. For the example configuration in FIG. IB, when the resource pool FSM 300 corresponds to the resource pool 151 having four nodes, the lifecycle manager 120 will start, under the resource pool FSM 300, four node FSMs each corresponding to one node of the resource pool 151. For a further resource pool FSM which corresponds to the resource pool 152 having eight nodes, the lifecycle manager 120 will start, under the further resource pool FSM, eight node FSMs each corresponding to one node of the resource pool 152, and so on. A detailed description of an example node FSM is given herein with respect to FIG. 4.

[0055] Also in response to user input through the API server 112 to enter the information for registering a corresponding resource pool, the lifecycle manager 120 causes the state transition 323 to move the resource pool FSM 300 to the Updating state 330. When the resource pool FSM 300 is at the Updating state 330, the lifecycle manager 120 causes execution of one or more workflows 140 in the corresponding resource pool to update the current states and / or information of the resource pool. For example, when the resource pool FSM 300 corresponds to the resource pool 151, one or more workflows 140 will be executed in the resource pool 151 to capture the current states and / or information of the resource pool 151. In at least one embodiment, each of the workflows 140 that were triggered by the lifecycle manager 120 to collect states and / or information of a resource pool sends a trigger reporting a success when the workflow is completed without fail. When all workflows 140 triggered for a resource pool of the cluster 150 report successes, in the corresponding resource pool FSM 300, the state transition 334 to the Updated state 340 is triggered. When all resource pool FSMs 300 under the cluster FSM 200 are at the Updated state 340, a trigger is generated in the cluster FSM 200 to move to the Sync Succes state 240. The captured states and / or information of the resource pools in the cluster 150 are stored in the database 116.

[0056] From the Updated state 340, the resource pool FSM 300 is moveable to either the Deleted state 350 or the Running state 360. In at least one embodiment, when a user, e.g., an administrator of the cluster 150, decides that a resource pool is no longer required in the cluster 150, the user may instruct, through the API server 112, to delete the corresponding resource pool FSM. As a result, a trigger is sent from the resource manager 110 to the lifecycle manager 120 to trigger the state transition 345 to move the corresponding resource pool FSM from the Updated state 340 to the Deleted state 350. The current states and / or information of the deleted resource pool FSM are removed from the database 116. An example situation where one or more resource pool FSMs are deleted is when the user wants to combine two resource pools into one resource pool. For this purpose, the two corresponding resource pool FSMs are deleted, and a new resource pool FSM is registered to include the resources or nodes of the deleted resource pools.

[0057] Alternatively, in at least one embodiment, the state transition 346 is triggered, e.g., when the user decides to deploy one or more applications in the corresponding resource pool, to move the resource pool FSM 300 from the Updating state 330 to the Running state 360. In a situation where the resource pool includes one or more tenants, the state transition 346 also causes a trigger 391 to be sent to the corresponding one or more tenant FSMs. A detailed description of an example tenant FSM is given herein with respect to FIG. 5. In situations where the resource pool does not include a tenant, the trigger 391 and / or related operations in a tenant FSM are omitted.

[0058] When the resource pool FSM 300 is at the Running state 360 and in response to a trigger 286 received from the cluster FSM 200 being in the Sync_Ongoing state 250, the lifecycle manager 120 executes the state transition 363 to move the resource pool FSM 300 to the Updating state 330. As described herein, with the resource pool FSM 300 being at the Updating state 330, the lifecycle manager 120 causes execution of one or more workflows 140 in the corresponding resource pool to update the current states and / or information of the resource pool, in a resync or reconciliation process. When the current states and / or information of the resource pool are successfully updated, the resource pool FSM 300 is moved to the Updated state 340 with further operations in the cluster FSM 200 and / or the resource pool FSM 300 as described herein. Further operations of the resource pool FSM 300 are described herein in conjunction with one or more of the cluster FSM, node FSMs, or tenant FSMs.

[0059] FIG. 4 is a schematic diagram of operations in a node FSM 400, in accordance with some embodiments.

[0060] The node FSM 400 is implemented in the lifecycle manager 120, is at a level under a resource pool FSM 300, and comprises states of a corresponding node in the resource pool corresponding to the resource pool FSM 300. The number of node FSMs 400 under a resource pool FSM 300 is the same as the number of nodes in the corresponding resource pool. In an example for the configuration in FIG. IB, the lifecycle manager 120 comprises, under a resource pool FSM 300 corresponding to the resource pool 151, four node FSMs 400 corresponding to the four nodes in the resource pool 151. In another example, the lifecycle manager 120 comprises, under a resource pool FSM 300 corresponding to the resource pool 152, eight node FSMs 400 corresponding to the eight nodes in the resource pool 152, as well as a tenant FSM corresponding to the tenant 158. A detailed description of an example tenant FSM is given herein with respect to FIG. 5.

[0061] In FIG. 4, the node FSM 400 comprises states 410, 420, 430, 440, 450, 460, 470, 480 and state transitions 412, 413, 414, 423, 434, 435, 436, 437, 438, 443, 447, 453, 463, 467 among the states 410, 420, 430, 440, 450, 460, 470, 480. At a given time, a current state of the node FSM 400 is one of the states 410, 420, 430, 440, 450, 460, 470, 480. The lifecycle manager 120 is configured to cause the node FSM 400 to move, or transition, to another state among the states 410, 420, 430, 440, 450, 460, 470, 480 by a corresponding state transition between the two states. A state transition in the node FSM 400 is caused by the lifecycle manager 120 in response to an input, or trigger, from the resource manager 110, from a workflow 140 being executed, or from the corresponding resource pool FSM 300. Several example scenarios of state transitions in the node FSM 400 in accordance with some embodiments are described herein.

[0062] In some embodiments, the node FSM 400 has the Start state 410 when the node FSM 400 is initialized, e.g., by a user registering a new node through the API server 112. In some embodiments, the node FSM 400 is initialized in response to the trigger 382 from the corresponding resource pool FSM 300 when the corresponding resource pool is first registered with the resource manager 110. The lifecycle manager 120 causes one or more workflows 140 to be executed to obtain information of nodes in a resource pool corresponding to the resource pool FSM 300 that generates the trigger 382. The information obtained for each node is associated with the corresponding node FSM 400, and is stored in the database 116. Based onthe obtained information for each node, the corresponding node FSM 400 is moved, by a corresponding one of the state transition 412, 413, or 414, to one of the Backup state 420, Empty state 430, or In use state 440. In at least one embodiment, the Backup state 420 of a node is registered by the user explicitly from the start, and the node FSM 400 is moved to the Backup state 420. When the corresponding node is an empty node, the node FSM 400 is moved to the Empty state 430. When the corresponding node is an in-use node, the node FSM 400 is moved to the In use state 440. The Backup state 420, Empty state 430, or In use state 440 of each node FSM 400 is reported, e.g., by executing a workflow 140, to the corresponding resource pool FSM 300. When all node FSMs and tenant FSMs under a resource pool FSM 300 have successfully reported their current states and / or information, the resource pool FSM 300 is moved to the Updated state 340. When all resource pool FSMs 300 under the cluster FSM 200 have successfully reported their current states and / or information, the cluster FSM 200 is moved to the Sync_Succes state 240, as described herein.

[0063] As described herein, in-use nodes and empty nodes are pooled nodes. An in-use node is a pooled node on which at least one application is deployed or executed. An empty node is a pooled node (i.e., a node immediately available for application deployment) but has no application deployed thereon. A backup node is not currently pooled, but is ready to become available for application deployment as an empty node, by executing the state transition 423 in the node FSM 400, and executing one or more corresponding workflows 140 in the cluster 150. When nodes are first registered, depending on the capacity or resources of each node, the nodes are pooled and moved to the Empty state 430 or In use state 440. One or more nodes which are not yet required for application deployment (e.g., the applications to be deployed do not require the resources of such nodes) are moved to the Backup state 420. In some embodiments, the decision to move a node (and the corresponding node FSM 400) to one of the Backup state 420, Empty state 430, or In_use state 440, is automatically made by the resource manager 110 and / or the lifecycle manager 120, based on one or more logics and / or policies managed by the policy engine 130, as well as other factors including, but not limited to, the amount / number of resources available at each node, the amount / number of resources required by the applications to be deployed, or the like. In at least one embodiment, the decision to move a node (and the corresponding node FSM 400) to one of the Backup state 420, Empty state 430, or In use state 440, is made based on user input given from the resource manager 110 through the API server 112.

[0064] Besides the Backup state 420, Empty state 430, and In use state 440, a node and the corresponding node FSM 400 may assume one of the other states including the Maintenance state 450, the Out-of-Pool state 460, the Failed state 470, and the Decommissioned state 480, in response to the updated states and / or information of the cluster 150 and its resource pools, nodes, and tenants captured in a reconciliation process, and / or in response to an event captured by one or more event consumer modules 115, and / or in response to user input, and / or based on one or more logics and / or policies managed by the policy engine 130.

[0065] In an example, when the updated states and / or information captured in a reconciliation process and / or a captured event and / or a policy in the policy engine 130 and / or user input from a user indicate that an empty node is due for maintenance, the empty node is moved or configured to be a under-maintenance node. Specifically, the lifecycle manager 120 causes the state transition 435 to move the corresponding node FSM 400 from the Empty state 430 to the Maintenance state 450. The lifecycle manager 120 further causes one or more workflows 140 to be executed to configure the empty node as a under-maintenance node and / or to cause maintenance to be performed for the node. When the required maintenance has been completed for the node, the corresponding node FSM 400 is moved by the state transition 453 back to the Empty state 430, and one or more corresponding workflows 140 are executed to configure the node that has undergone maintenance as an empty node.

[0066] In a further example, when the updated states and / or information captured in a reconciliation process and / or a captured event and / or a policy in the policy engine 130 and / or user input from a user indicate that an in-use node is due for maintenance, the in-use node is first moved or configured to be an empty node. Specifically, to move or configure an in-use node to be an empty node, the lifecycle manager 120 causes the state transition 443 to move the corresponding node FSM 400 from the In use state 440 to the Empty state 430. The lifecycle manager 120 further causes one or more workflows 140 to be executed to drain applications executed on the in-use node from the node so that the node becomes an empty node. The drained applications are relocated or redeployed or migrated to another node of the same resource pool, or to other resource pool, by executing one or more workflows 140. The empty node is then moved or configured to be a under-maintenance node, as described herein.

[0067] In a further example, when the updated states and / or information captured in a reconciliation process and / or a captured event and / or a policy in the policy engine 130 indicate that the number of empty nodes in a resource pool is higher than a predetermined threshold, atleast one of the empty nodes is moved or configured to be an out-of-pool node. An out-of-pool node is not included in a resource pool, but remains coupled to the network of the cluster. The out-of-pool node is shutdown or in a sleep mode to save power. When a demand for more resources arises, the out-of-pool node may be quickly restarted, or waken up, and included in a resource pool for application deployment. An out-of-pool node may be re-included in the same resource pool it was a part of before, or may be included in a new or different resource pool. Specifically, to move or configure an empty node to be an out-of-pool node, the lifecycle manager 120 causes the state transition 436 to move the corresponding node FSM 400 from the Empty state 430 to the Out-of-Pool state 460. The lifecycle manager 120 further causes one or more workflows 140 to be executed to disable the node, e.g., to shutdown the node or put it in the sleep mode to save power consumption. To rejoin an out-of-pool node in a resource pool, the lifecycle manager 120 causes the state transition 463 to move the corresponding node FSM 400 from the Out-of-Pool state 460 back to the Empty state 430. The lifecycle manager 120 further causes one or more workflows 140 to be executed to enable the out-of-pool node, e.g., to wake it up from sleep, or restart the node. From the empty state, the rejoined node is movable to the in-use state as described herein.

[0068] In a further example, when the updated states and / or information captured in a reconciliation process and / or a captured event and / or a policy in the policy engine 130 indicate that additional resources are needed for executing or deploying applications in a resource pool, one or more backup nodes, under-maintenance nodes and / or out-of-pool nodes are pooled in, i.e., moved or configured as empty nodes in the resource pool to be ready for use as in-use nodes when applications are deployed there on. Specifically, the lifecycle manager 120 performs the corresponding state transition 423, 453, 463 to move the corresponding node FSM 400 from the Backup state 420, Maintenance state 450, or Out-of-Pool state 460 to the Empty state 430. The lifecycle manager 120 further causes one or more workflows 140 to be executed to configure the added empty node for deployment of applications thereon.

[0069] Another example involves a failed node or unreachable node (commonly referred to here as a failed node). In at least one embodiment, a failed node is a node with a failure, e.g., a hardware failure. When a node in the cluster 150 fails or becomes unreachable, one or more event consumer modules 115 capture this event in real time and report in real time to the resource manager 110. The resource manager 110 sends a trigger, as described with respect to the trigger 285, to the lifecycle manager 120 to cause updating of the current states and / orinformation of the cluster 150, as well as its resource pools, nodes and tenants. The cluster FSM 200 is moved to the Sync_Ongoing state 250, which causes the resource pool FSMs 300 under the cluster FSM 200 to be moved to the Updating state 330, with corresponding workflows 140 being executed to obtain the updated current states and / or information of the cluster 150, as well as its resource pools, nodes and tenants. As a result of a workflow 140 executed on or with respect to the failed node, the failed state of the node is captured, e.g., by a worker module 114. The lifecycle manager 120 is triggered to move the node FSM 400 corresponding to the failed node to the Failed state 470 from a previous state of the node (e.g., from the Empty state 430, In use state 440 or Out-of-Pool state 460) by a corresponding state transition 437, 447, or 467. The lifecycle manager 120 further causes one or more workflows 140 to be executed to disconnect the failed node from the network of the cluster for service or repair. The reconciliation process is executed again after disconnecting the failed node. As a result, the current states and / or information of the corresponding resource pool, cluster, node or tenant after disconnecting the failed node are reported to and / or updated in the corresponding resource pool FSM 300, cluster FSM 200, node FSM 400, or any tenant FSM that used the failed node, and are also stored in the database 116. The updated current states and / or information reflect a reduced amount of resources in the resource pool or cluster due to the disconnection of the failed node. If the reduced amount of resources is insufficient for application deployment based on one or more policies, one or more workflows 140 are executed to pool one or more additional nodes in the resource pool, as described herein.

[0070] Yet another example involves a decommissioned node. In at least one embodiment, a failed node is a node disconnected from the resource pool or cluster due to a hardware failure, whereas a decommissioned node is a node disconnected from resource pool or cluster in accordance with a user’s decision. For example, a user decides to take a node out of a resource pool or the cluster, and provides corresponding user input to the resource manager 110 through the API server 112. The resource manager 110 sends a trigger to the lifecycle manager 120 to cause the node FSM 400 corresponding to the node to be moved by the state transition 438 from the Empty state 430 to the Decommissioned state 480. If the node is currently in a state other than the Empty state 430, e.g., in one of the Backup state 420, In use state 440, Maintenance state 450, or Out-of-Pool state 460, the node is first moved to the Empty state 430 as described herein. The lifecycle manager 120 further causes one or more workflows 140 to be executed to disconnect the decommissioned node from the network of the cluster. The current states and / or information of the disconnected node and the corresponding resource poolare reported to and / or updated in the corresponding node FSM 400, resource pool FSM 300 and cluster FSM 200, and stored in the database 116.

[0071] In one or more of the above examples, and / or in any other state transition in the node FSM 400, due to the change at the node level, the resource availability and / or resource usage in the corresponding resource pool and in the cluster are also changed. These changes in the resources, states and / or information are updated by a reconciliation process after the change. The updated states and / or information are captured at the cluster level, resource pool level, tenant level and node level, and are stored in the database 116, as described herein. As a result, in one or more embodiments, the current states and / or information of the cluster 150 as well as all of its resource pools, nodes and tenants are maintained up-to-dated to facilitate efficient and / or accurate resource management.

[0072] In some embodiments, the described operations of the lifecycle manager 120 in state transitions of one or more hierarchical FSMs and / or in execution of one or more workflows 140 are caused by or in cooperation with the policy engine 130 enforcing one or more of its policies. For example, based on the updated current states and / or information of the cluster 150 as well as all of its resource pools, nodes and tenants, and depending on one or more policies set in the policy engine 130 for the cluster and / or resource pool, the resource manager 110, lifecycle manager 120 and / or policy engine 130 calculate the number of nodes for which the states need to be changes, and the lifecycle manager 120 performs corresponding state transitions in one or more of the hierarchical FSMs and / or causes execution of corresponding workflows 140, as described herein.

[0073] An example described herein involves moving one or more empty nodes or underutilized nodes to the out-of-pool state when the number of empty nodes in a resource pool is higher than a predetermined threshold, for the purpose of power saving. A under-utilized node has the percentage of used or consumed resources at or lower than a predetermined threshold, e.g., 10% in one or more embodiments.

[0074] Another example involves pooling in one or more additional nodes, e.g., from the backup state or out-of-pool state, to be empty nodes ready for application deployment, in response to the number of in-use nodes getting filled up with deployed applications becomes greater than a predetermined threshold (or in response to the percentage of available unused resources in the resource pool falling below a predetermined threshold).

[0075] In a further example, before moving a node to the Maintenance state 450 or Out-of- Pool state 460 due to one or more policies managed by the policy engine 130, one or more workflow workflows 140 will be triggered by the lifecycle manager 120 to relocate all pods and migrate all the storage to other nodes (or to detach the storage).

[0076] In a power consolidation example, deployed applications are migrated from one node to another node to obtain an empty node which will then be moved to the out-of-pool state for power saving purposes, by executing one or more state transitions and / or workflows as described herein.

[0077] In an example involving a node with a physical or hardware failure, where the node needs to be replaced completely, the failed node cannot be pooled in, and is permanently removed from the resource pool. When the node, after repair or service, needs to be brought back, it can be registered as a new node using the node registration process.

[0078] In a further example, when a node is moved to the Decommissioned state 480 and a backup policy is enabled in the policy engine 130, one or more nodes in the Backup state 420 can be pooled in, by moving to the Empty state 430. One or more new nodes may be added in the resource pool as a backup node later. The described examples do not limit all use cases and / or scenarios to which resource management using hierarchical FSMs in accordance with some embodiments are applicable.

[0079] FIG. 5 is a schematic diagram of operations in a tenant FSM 500, in accordance with some embodiments.

[0080] The tenant FSM 500 is implemented in the lifecycle manager 120, is at a level under a resource pool FSM 300, and comprises states of a corresponding tenant in the resource pool corresponding to the resource pool FSM 300. The number of tenant FSMs 500 under a resource pool FSM 300 is the same as the number of tenants in the corresponding resource pool. In an example for the configuration in FIG. IB, the lifecycle manager 120 comprises, under a resource pool FSM 300 corresponding to the resource pool 152, eight tenant FSMs 500 corresponding to the eight nodes in the resource pool 152, as well as a tenant FSM corresponding to the tenant 158. When there are two tenants in a resource pool, two corresponding tenant FSMs 500 will be running under the corresponding resource pool FSM 300, and so on.

[0081] In FIG. 5, the tenant FSM 500 comprises states 510, 520, 530, 540, 550, and state transitions 512, 513, 514, 524, 525, 534, 535 among the states 510, 520, 530, 540, 550. At a given time, a current state of the tenant FSM 500 is one of the states 510, 520, 530, 540, 550. The lifecycle manager 120 is configured to cause the tenant FSM 500 to move, or transition, to another state among the states 510, 520, 530, 540, 550, by a corresponding state transition between the two states. A state transition in the tenant FSM 500 is caused by the lifecycle manager 120 in response to an input, or trigger, from the resource manager 110, from a workflow 140 being executed, from the corresponding resource pool FSM 300, or from one or more node FSMs 400 corresponding to the one or more nodes that provide resources for the tenant. In an example for the configuration in FIG. IB, a state transition in the tenant FSM 500 corresponding to the tenant 158 is caused by the lifecycle manager 120 in response to an input, or trigger, from the resource manager 110, from a workflow 140 being executed, from the resource pool FSM 300 corresponding to the resource pool 152, or from one or more node FSMs 400 corresponding to the nodes 159A, 159B that provide resources for the tenant 158. Several example scenarios of state transitions in the tenant FSM 500 in accordance with some embodiments are described herein.

[0082] In some embodiments, the tenant FSM 500 has the Start state 510 when the tenant FSM 500 is initialized, e.g., by a user registering a new tenant through the API server 112. In some embodiments, the tenant FSM 500 is initialized in response to the trigger 391 from the corresponding resource pool FSM 300. In some embodiments, the tenant FSM 500 is initialized in response to user input to register or reserve a tenant in a resource pool. In at least one embodiment, the user specifies the amount and / or type of resources to be used by the tenant for application deployment. For example, the user specifies a maximum amount of resources usable by applications deployed in the tenant, e.g., a maximum amount of RAM, and / or a maximum amount of storage, and / or a maximum amount of CPU time / usage / threads.

[0083] When the applications deployed in the tenant use or attempt to use more than the maximum amount(s) of resources specified for the tenant, the applications may no longer be allowed to run in the tenant, and may be deleted, as a result of operations of the resource manager 110, lifecycle manager 120 and / or policy engine 130 with execution of one or more workflows 140 similar to one or more examples described herein. Alternatively, the amounts of resources that are required to be guaranteed for the tenant are reduced by user input given the reduced available resources. The user input to reduce the amounts of resources to beguaranteed for the tenant is sent through the resource manager 110 to the lifecycle manager 120 for execution of one or more workflows 140 and one or more reconciliation processes, as described herein.

[0084] In at least one embodiment, as described herein, when the corresponding resource pool FSM 300 moves from the Updated state 340 to the Running state 360, the tenant FSM 500 corresponding to the tenant in the resource pool is triggered. The tenant FSM 500 is moved by the state transition 514 or 513 correspondingly to the In use state 540 or the Empty state 530, depending on whether one or more applications are currently deployed in the tenant. When the tenant is updated in a reconciliation process, if the tenant has been created by a user due to reservation being enforced, the tenant FSM 500 is moved by the state transition 512 to the Reserved state 520. The Reserved state 520 means that the tenant is empty with no application, and it is being reserved for a particular application and / or user, so that other applications and / or users do not use the reserved resources of the tenant. When the user creates a tenant as a reservation, the corresponding tenant FSM moves to the Reserved state 520 and stays in the Reserved state 520. When applications are deployed in the tenant in the Reserved state 520 or Empty state 530, the tenant FSM 500 will be moved to the In_use state 540, by the corresponding state transition 524 or 534. When the tenant is to be deleted, e.g., due to expiry or preemption, the tenant FSM 500 is moved by the state transition 525 or 535 to the Deleted state 550. In case of reservation migration from one resource pool to another resource pool, the tenant is first deleted as described, and then moved to the Reserved state 520 in the target resource pool. In some embodiments, the deletion and / or migration of a tenant are automatic without user input.

[0085] In at least one embodiment, changes at the node level as described with respect to FIG. 4 lead to changes in the amount of resources available in the corresponding resource pool, tenant or cluster. For example, when the resources in a resource pool are reduced due to one or more changes at the node level and a tenant is using resources in that resource pool, the resource manager 110, lifecycle manager 120 and / or policy engine 130 update the remaining resources of the resource pool to check whether the remaining resources are sufficient to support the tenant. In some embodiments, where the remaining resources (capacity) of the resource pool are insufficient to satisfy the tenant’s requirements for resources, a notification is provided, e.g., through the API server 112, to the user to inform the user that the reservation or tenant is not satisfied. The user is given options to make a new reservation, or to adjust theapplication deployment to the reduced capacity. When the user decides to make a new reservation, a corresponding tenant FSM is initialized from the Start state 510, information regarding the new reservation is received from the user, and the tenant FSM for the new reservation moves to the Reserved state 520. If the user then decides to use the new reservation for application deployment, the tenant FSM will be moved to the In use state 540. A trigger is sent to the lifecycle manager 120 to perform a reconciliation process for updating the cluster and corresponding resource pool with the new tenant reservation.

[0086] Alternatively, where the remaining resources (capacity) of the resource pool are insufficient to provide a minimum guarantee of resources for a tenant in the resource pool, one or more tenants in the resource pool, based on one or more policies managed by the policy engine 130, will be deleted to accommodate reservations or tenants with higher priority. For example, if the sum of all minimum resources limits of the tenants in a resource pool is greater than the resource pool capacity (e.g., greater than the maximum amount of resources of the resource pool), one or more of the tenants in the resource pool will be moved to the Deleted state 550, with execution of one or more corresponding workflows 140, as described herein. In some embodiments, the choice of tenants to be deleted (or maintained in the resource pool) is made based on one or more policies set by the user and managed by the policy engine 130, e.g., based on expiry date, the number of consumed resources, and / or priority. For example, a tenant with the lowest priority will be deleted first, followed by a tenant with the second lowest priority, and so on.

[0087] In some embodiments, when a cluster is registered for the first time with the resource manager 110, the corresponding cluster FSM 200 is moved by the lifecycle manager 120 to the Add Started state 220 where all the information related to the cluster is stored fresh in the database 116 of the resource manager 110. After moving to the Add Started state 220, the lifecycle manager 120 triggers one or more workflows 140 on the corresponding workflow engine, that makes one or more API calls to the cluster manager 156 of the cluster 150 to obtain all the information related to the cluster, including resource pools, nodes and tenants. Since all the entities (i.e., cluster, resource pools, nodes, tenants) are being registered for the first time, depending on the number of tenants, resource pools or the like, a new FSM of a particular type (e.g., resource pool FSM, node FSM or tenant FSM) will be created by the lifecycle manager 120 for each and every entity discovered within the cluster. During execution of the one or more workflows 140 and execution of the children FSMs (i.e., resource pool FSMs, tenantFSMs and node FSMs), the cluster FSM 200 will stay in the Sync_Ongoing state 250. Upon the receiving of a rpool updated trigger corresponding to the Updated state 340 of each and every resource pool FSM under the cluster FSM 200, the lifecycle manager 120 will move the cluster FSM 200 to the Sync_Succes state 240. If the cluster 150 is unreachable, e.g., due to network issues and / or the cluster manager 156 Manager / Master Node being down, the cluster FSM 200 will be moved to the Sync Failed state 260 from which retries are possible, as described herein.

[0088] In some embodiments, for a resource pool FSM 300, when an event or trigger to add a resource pool is received after the storage of necessary information with the resource manager 110, the resource pool FSM 300 is moved by the lifecycle manager 120 to the Added state 320. After successful completion, the lifecycle manager 120 moves the resource pool FSM 300 to the Updating state 330, and triggers one or more workflows 140 that find and register all the nodes in the resource pool. The one or more workflows 140 trigger all instances of a node FSM 400 under the resource pool FSM 300. When the node FSMs are moved into corresponding states, the policy engine 130 is triggered and, based on one or more policies managed by the policy engine 130, controls or instructs the lifecycle manager 120 to move the resource pool FSM 300 to the Updated state 340. Upon exit of the Updated state 340, a tenant FSM is triggered to register new tenants and / or readjust the tenants (e.g., auto-delete one or more tenants) in case of the resource pool’s resource changes, as described herein. As the tenant states are managed, the resource pool FSM is finally moved to the Running state 360.

[0089] In some embodiments, the resource manager 110 enables application deployment based on current states of the hierarchical FSMs. For example, when the cluster FSM 200 is in the Sync Succes state 240 and one or more resource pool FSMs 330 under the cluster FSM 200 are in the Running state 360, the corresponding cluster and resource pools are considered for application deployment and / or reservation. In some embodiments, the resource manager 110 cause applications to be deployed or executed in the cluster and resource pools. In at least one embodiment, the resource manager 110 considers multiple clusters and their resource pools, that are eligible for application deployment, and provide, through the API server 112, to the user a recommendation of a specific cluster and its resource pool for application deployment. In some embodiments, if the cluster FSM 200 of a cluster is in the Sync Failed state 260, the resource manager 110 does not consider using the cluster for application deployment, and / or does not make a recommendation to the user to deploy an application in that cluster. In someembodiments, a recommendation is provided by the transaction manager 113, based on various factors, policies and / or logics embedded in the resource manager 110. In an example, except for backup nodes, under-maintenance nodes and decommissioned nodes, all other nodes in a cluster will be considered to calculate the capacity, or the amount of resources, of each resource pool included in the cluster. In some embodiments, by default, the cluster and / or the resource manager 110 will attempt to deploy an application in the pooled nodes (i.e., empty nodes and in-use nodes). However, if the resources of the pooled nodes are not sufficient, ignoring one or more pooling limit policies, all the nodes will be moved to the Empty state 430 for the time being. Once the application is deployed, all unnecessary nodes will be moved to the Out-of- Pool state 460 for power saving.

[0090] In some embodiments, a reservation for a tenant will be made using the pooled nodes. However, if the resources of the pooled nodes are not sufficient, a necessary number of additional nodes, such as backup nodes, under-maintenance nodes and / or out-of-pool nodes, will be moved to the Empty state 430, i.e., pooled in, to provide further resources.

[0091] In some embodiments, all the associations for reservations, under-maintenance nodes and backup nodes are stored in the database 116. This information is useful in the reconciliation process, because these states may not be directly resolved from the API calls to the cluster manager 156 of the cluster.

[0092] In some embodiments, one or more advantages, which are not achievable in other approaches, are obtainable by the resource management approach implemented in the system 100. Such advantages include, but are not limited to, automated keeping of current states and / or information of a cluster at various levels (e.g., cluster, resource pool, tenant, node levels) up-to-dated both periodically and in real time, efficient application deployment, optimal recommendations for a data center (e.g., cluster and / or resource pool), resource reservation capability for users, energy saving, automated disaster recovery, resource maintenance, scalability, simplified datacenter management and automation, reduced manual labor, centralized resource management and policy enforcement across multiple clusters with through a central user interface.

[0093] In some embodiments, resource management of entities from clusters to nodes is done by hierarchical FSMs. In at least one embodiment, this approach permits automated handling of all the cases that arise in the management of these resources. In terms of resourcemanagement, the states from reconciliation to failure of nodes are all automatically handled by these FSMs. The policies regarding the use cases are handled by a policy engine. In a cluster, the cluster FSM is the top-level FSM that manages the lifecycle of cluster level information held with the resource manager. This cluster FSM further contains one or more children FSMs for one or more resource pools in the cluster. In some embodiments, only when a resource pool FSM and the cluster FSM are in specific states, will the particular resource pool corresponding to that resource pool FSM be considered for recommendation for application deployment. In at least one embodiment, the specific states include the Sync Succes state for the cluster FSM, and the Running state for the resource pool FSM. There are two types of children FSMs under a resource pool FSM, i.e., node FSM and tenant FSM. In some embodiments, when a state transition is triggered in an FSM among the hierarchical FSMs, the other, related FSMs over and under the FSM with the triggered state transition are also triggered for corresponding state transitions and / or workflow execution which update the current states and / or information of the cluster at various levels, such as cluster, resource pool, node, tenant levels. As a result, the current states and / or information and / or available resources in the cluster are automatically kept up-to-dated.

[0094] In some embodiments, resources of multiple clusters are managed by the system 100. When the users want to deploy an application, the system 100 is configured to perform resource management such that sufficient resources are available in a cluster to be consumed by the application. In at least one embodiment, the resources available for the application should not be too little, but they should also not be too much to avoid resource wastage. In a first use case for resource management in accordance with some embodiments, a recommendation is made by the system 100 to the user, to indicate to the user which data center (e.g., which cluster and / or its resource pool) is the suitable for deployment of the user’s application, depending on the resource requirements of the application. In a second use case for resource management in accordance with some embodiments, the system 100 is configured to permit the user to reserve resources for the application. For example, when a recommendation is made and / or the user selects a cluster and / or its resource pool for application deployment, the system 100 enables the user to reserve a certain amount of resources in the recomm ended / selected cluster or resource pool, so that the user may use that reserved mount of resources later for application deployment.

[0095] In some embodiments, it is possible to scall or resize up or down a resource pool in a cluster, or the cluster itself. For example, as described herein, it is possible to scall or size up a resource pool by pooling in one or more nodes (e.g., backup nodes, under-maintenance nodes, and / or out-of-pool nodes) when additional resources are required. It is further possible to scall or size down a resource pool by moving one or more pooled nodes out-of-pool when a demand for resources is reduced, for power saving. It is also possible to delete existing resource pools and combine their resources into a larger resource pool, or to split a larger resource pool into smaller resource pools. In at least one embodiment, similar scaling approaches are applicable to resize a cluster to make it larger or smaller. In some embodiments, the described scaling up or down process, also referred to in one or more embodiments as horizontal scaling, is automatically performed by the system 100, for example, based on the updated current of the cluster, and its resource pools, tenants and nodes, and based on one or more policies managed by the policy engine 130.

[0096] In some embodiments, the current states and / or resource amounts of a cluster at various levels, e.g., cluster, resource pool, tenant and node levels, are automatically kept up- to-dated by executing a reconciliation process, as described herein. In at least one embodiment, the reconciliation process is triggered whenever there is a change in the cluster, e.g., a node is moved to a different state, a tenant is deleted, a new reservation is made, a resource pool is resized with one or more nodes being pooled in or moved out-of-pool, a resource pool is deleted or combined with another resource pool, or the like. In at least one embodiment, a reconciliation process is performed periodically, or on demand from a user who wishes to know the current states and / or information in the cluster. The same or similar reconciliation process is performed as a sync process when an entity, e.g., a cluster, resource pool, tenant, or node, is first registered with the system 100.

[0097] In some embodiments, an automated disaster recovery process is performed in response to an event occurring in the cluster. An example is described herein with respect to a failed node situation, e.g., one or more event consumer modules 115 captures the node-failed event, which triggers the lifecycle manager 120 to perform a reconciliation process to locate the failed node, one or more workflows 140 are executed to disconnect the failed node and / or to check the remaining resources available in the resource pool and / or a tenant that included the failed node. When the remaining resources are sufficient, the states and / or information of the cluster FSM and resource pool FSM are updated to permit application deployment, e.g., thecluster FSM is moved to the Sync Succes state 240 and the resource pool FSM is moved to the Running state 360, and the node FSM of the failed node is moved to the Failed state 470. When the remaining resources not sufficient, the cluster FSM and / or resource pool FSM remain in states that are not recommended for application deployment, e.g., the cluster FSM remains in the Sync Ongoing state 250. Thus, unnecessary application deployment in the cluster is avoidable until the lack of resources is remedied. At the same time, the tenant that lacks resources due to the failed node is deleted or adjusted, or another tenant of a lower priority is deleted to accommodate the tenant, as described herein. In some embodiments, the described disaster recovery process is completely automated, based on one or more policies managed by the policy engine 130.

[0098] In some embodiments, an energy saving feature is automatically implemented in response to an excessive number of empty or underused nodes, as described herein. For example, when a periodical update by a reconciliation process indicates, in accordance with one or more policies managed by the policy engine 130, that there are too many empty or underused nodes, one or more workflows 140 are triggered to move one or more empty or underused nodes to the out-of-pool state, and put them in a sleep mode to save energy. The remaining resources available in the resource pool and / or a tenant that included the now out- of-pool nodes are updated. When additional resources are needed, in accordance with one or more policies, one or more workflows are automatically executed to pool in one or more of the out-of-pool nodes, and the new resources available in the resource pool and / or tenant are updated. Similar policies and / or workflows are automatically enforced / executed to take out nodes for maintenance and then pool them back in.

[0099] In some embodiments, the use of the policy engine 130 provides intelligent management that can be automatically enforced. For example, the policy engine 130 permits a user to set up a policy, and then automatically enforces the policy for the user. In the above example of a failed node, the policy may specify that when a certain node goes down, the cluster containing the node may not be used at all, and the corresponding cluster FSM is put in the Sync F ailed state 260, or the like. Other example policies include power saving policies, automated scaling policies, or the like. For example, a policy may specify that if there are too many nodes that are underused and / or if there are too many nodes that are in the empty state, one or more workflows are executed to place those nodes into the out-of-pool state, to disablethose nodes for now, because they are not being used anyway for a long time. In at least one embodiment, the use of the policy engine 130 involves a closed loop intelligent action.

[0100] The described automation of one or more embodiments is in contrast with other approaches where various states and / or information and / or available resources in a cluster are tracked manually, e.g., using a spread sheet. For example, when a node is to be moved to maintenance or sleep mode in other approaches, a user would have to manually put the node down, then manually do all the accounting (e.g., resource checking) that is needed for making sure that applications and / or tenants in the cluster are not affected by the reduced available resources in the cluster. This manual process would be repeated from time to time to make sure that the cluster perform as intended, and / or to make sure that resource requirements for tenants and reservations in the cluster are met. If a node went down (e.g., failed), a reservation using resources of the failed node might no longer be valid, resulting in a fault. However, the user in the other approaches had no way to know the reason of such a fault. The user would then need to go and manually check each and every entity, e.g., node, tenant, resource pool, in the cluster to figure out what really happened, which would require a large amount of time and / or labor, and slow down the recovery process. These deficiencies of the other approach does not permit efficient and / or timely resource management in multiple clusters from a centralized location.

[0101] In contrast, in one or more embodiments, various use cases are automated, for example, as described herein with respect to energy saving, disaster recovery, node maintenance, periodical update of states and / or information at various levels of a cluster. Accordingly, in at least one embodiment, the resource management approach using hierarchical FSMs is automated and saves unnecessary manual labor and / or time.

[0102] In at least one embodiment, it is possible for a user to check states and / or information of a cluster remotely, e.g., with a simple click or command at a central management control panel (e.g., through API server 112) to trigger a reconciliation process which will then report the states and / or information at all levels of the cluster back to the resource manager 110. In some embodiments, the same central management control panel is configured to manage resources in multiple clusters, with the same or similar advantages.

[0103] In some embodiments, the ability or configuration of the system 100 to perform resource management for multiple clusters is useful in many use cases. An example use caseinvolves a reservation migration in which a particular reservation may be moved from one cluster to another cluster. For such reservation migration to be performed effectively, it is necessary to know, among other things, what the tenants are doing in each and every cluster, how the resources are being consumed in all the different clusters, or the like. With a centralized resource management provided by the system 100, such knowledge is available, e.g., from the database 116 which stores the relevant information of all clusters managed by the system 100, and therefore, effective reservation migration is simple and achievable.

[0104] In some embodiments, the database 116 is configured to store all information captured / updated from the clusters being managed by the system 100, registering information of all entities in the clusters, various limits on resource pools or reservations, updated states and resource amounts of all entities, or the like. Some of these information or states may be available at individual cluster managers of the cluster; however, they are scattered across multiple clusters, i.e., across multiple locations or servers, and may be difficult or inconvenient to retrieve. By storing all necessary information in a single source, such as the database 116, it is possible, in some embodiments, to quickly and accurately provide a global view of the current states of all clusters being managed by the system 100, which facilitates features such as application deployment recommendation, reservation migration, or the like.

[0105] FIG. 6A is a flow chart of a process 600A for resource management using hierarchical finite state machines, in accordance with some embodiments. In at least one embodiment, the process 600A is performed by a system for resource management, such as the system 100.

[0106] As described herein, the system 100 comprises a resource manager 110, and a lifecycle manager 120 coupled to the resource manager 110. The lifecycle manager comprises a first finite state machine (FSM) at a first level, and one or more second FSMs at a second level under the first level. The first FSM comprises a plurality of first states of a set of resources. The set of resources comprises one or more subsets of resources. Each second FSM among the one or more second FSMs comprises a plurality of second states of a corresponding subset among the one or more subsets of resources. In at least one embodiment, the first FSM comprises the cluster FSM 200, one or more second FSMs comprise one or more resource pool FSMs 300, the set of resources comprises a cluster 150, and one or more subsets of resources comprise one or more resource pools 151-153. In some embodiments, the first FSM comprises a resource pool FSM 300, one or more second FSMs comprise one or more node FSMs 400and / or tenant FSMs 500 under the resource pool FSM 300, the set of resources comprises the corresponding resource pool, e.g., resource pool 152, and one or more subsets of resources comprise the nodes and / or tenant(s) in the resource pool.

[0107] At operation 602, the resource manager receives information about the set of resources. For example, the information about the set of resources comprises user input (e.g., through the API server 112), an event detected by an event consumer module, or a change in a state of an entity in the cluster as captured by a worker module 114. As described herein, an entity in a cluster comprises any of the cluster, a resource pool in the cluster, a node in the cluster, or a tenant in a resource pool of the cluster.

[0108] At operation 604, the resource manager, responsive to the received information, sends at least one trigger to the lifecycle manager to cause a state transition of the first FSM. The state transition of the first FSM further causes a corresponding state transition of each second FSM. For example, when the received information comprises user input for registering a cluster, the resource manager 110 sends a trigger to the lifecycle manager 120 to cause a state transition in the cluster FSM 200, and a corresponding state transition is caused in each resource pool FSM 300, as described with respect to states 210, 220 in FIG. 2, and states 310, 320 in FIG. 3. For another example, when the received information is captured by a worker module 114 or event consumer module 115, the resource manager 110 sends a trigger 285 to the lifecycle manager 120 to cause a state transition in the cluster FSM 200, and a corresponding state transition is caused in each resource pool FSM 300, as described with respect to states 240, 250 in FIG. 2, and states 330, 340, 360 in FIG. 3.

[0109] At operation 606, the resource manager enables deployment of at least one application in the set of resources based on at least current states of the first FSM and the one or more second FSMs. For example, when the current state of the cluster FSM is the Sync Succes state 240, and the current state of each of the resource pool FSMs is the Running state 360, application deployment is enabled in the cluster, as described herein. In at least one embodiment, one or more advantages described herein are achievable in the process 600A.

[0110] FIG. 6B is a flow chart of a process 600B for resource management using hierarchical finite state machines, in accordance with some embodiments. In at least one embodiment, the process 600B is performed by a system for resource management, such as the system 100.

[0111] At operation 612, hierarchical finite state machines (FSMs) are executed by at least one processor. For example, the hierarchical FSMs are executed by the lifecycle manager 120. The hierarchical FSMs comprise a cluster FSM, one or more resource pool FSMs under the cluster FSM, and one or more node FSMs under each resource pool FSM, for example, as described with respect to FIGs. 2-4.

[0112] At operation 614, responsive to a state transition in a first FSM, at least one processor causes a corresponding state transition in at least one second FSM over or under the first FSM. In an example, responsive to a state transition in the cluster FSM 200 being a first FSM, the lifecycle manager 120 causes a corresponding state transition in each resource pool FSM 300 being the second FSM under the cluster FSM 200, as described with respect to operation 604. In another example, responsive to a state transition in a resource pool FSM 300 being a first FSM, the lifecycle manager 120 causes a corresponding state transition in each node FSM 400 being the second FSM under the resource pool FSM 300, as described with respect to states 310, 320 in FIG. 3, and state 410 in FIG. 4. In a further example, responsive to a state transition in a resource pool FSM 300 being a first FSM, the lifecycle manager 120 causes a corresponding state transition in the cluster FSM 200 being the second FSM over the resource pool FSM 300. Specifically, when each resource pool FSM 300 moves to the Updated state 340, the cluster FSM 200 is triggered to move from the Sync_Ongoing state 250 to the Sync_Succes state 240, as described herein.

[0113] At operation 616, at least one processor enables deployment of an application in a resource pool among the one or more resource pools of the cluster, based on current states of the cluster FSM and the corresponding resource pool FSM, for example, as described with respect to operation 606. In at least one embodiment, one or more advantages described herein are achievable in the process 600B.

[0114] FIG. 6C is a flow chart of a process 600C for resource management using hierarchical finite state machines, in accordance with some embodiments. In at least one embodiment, the process 600C is performed by a system for resource management, such as the system 100.

[0115] At operation 622, hierarchical finite state machines (FSMs) are executed. For example, the hierarchical FSMs are executed by the lifecycle manager 120. The hierarchical FSMs comprise a cluster FSM, one or more resource pool FSMs under the cluster FSM, andone or more node FSMs under each resource pool FSM, for example, as described with respect to FIGs. 2-4.

[0116] At operation 624, an event detected by an event consumer module, or a change captured by a worker module, at a node of the cluster is received. For example, an event is captured by an event consumer module 115 and indicates that a node has failed. For another example, a change in a resource usage of a node, e.g., from the in-use state to the empty state, is captured by a worker module 114.

[0117] At operation 626, responsive to the detected event or captured change, execution of one or more workflows is caused, to update information of one or more resource pools and the nodes in the cluster. For example, a trigger 285 is sent from the resource manager 110 to the lifecycle manager 120 in response to the detected event or captured change, to start a reconciliation process. In the reconciliation process, the lifecycle manager 120 causes execution of one or more workflows 140 to obtain information of various entities of the cluster 150.

[0118] At operation 628, the cluster FSM is transitioned to a sync ongoing state, e.g., as described with respect to FIG. 2, and the one or more resource pool FSMs are transitioned to an updating state, e.g., as described with respect to FIG. 3.

[0119] At operation 630, a node FSM corresponding to the node with the detected event or the captured change is transitioned. For example, when the detected event indicates that a node has failed, the reconciliation process reports which particular node has failed, and the node FSM corresponding to the failed node is transitioned to the Failed state 470. For another example, when the captured change indicates that a node has changed from being in-use to being empty and, based on one policies managed by the policy engine 130, there is an excessive number of empty nodes in the current resource pool, one or more workflows 140 are executed to move an empty node, and the corresponding node FSM, to the out-of-pool state.

[0120] At operation 632, based on the updated information of the one or more resource pools and the nodes in the cluster, an amount of resources available in each resource pool among the one or more resource pools, and an amount of resources available in the cluster are updated. For example, in the reconciliation process, current states and / or information of all nodes, resource pools and the cluster are updated. The updated states and / or information also include updated available resources at all nodes. Based on this information, it is possible todetermine the amount of resources available in each resource pool and in the whole cluster, e.g., by summing up the updated available resources of the nodes in each resource pool, and in the whole cluster. In the above examples, the failed node or the out-of-pool node will reduce the amount of resources available in the corresponding resource pool and in the whole cluster.

[0121] At operation 634, upon completion of the execution of the one or more workflows, the cluster FSM is transitioned to a sync success state, and the one or more resource pool FSMs are transitioned to an updated state, e.g., as described with respect to operation 614.

[0122] At operation 636, deployment of an application is enabled in the cluster based on current states of the cluster FSM and the one or more resource pool FSMs, and also based on the available amounts of resources in the cluster and the one or more resource pools. For example, application deployment is enabled when the current state of the cluster FSM is the Sync Succes state 240, and the current state of each of the resource pool FSMs is the Running state 360, as described with respect to operation 606. Further, due to the changed (e.g., reduced) available amounts of resources in the cluster and the one or more resource pools, a different resource pool in the same cluster, or a different cluster, may be recommended for application deployment. In at least one embodiment, one or more advantages described herein are achievable in of the process 600C.

[0123] The described methods and algorithms include example operations, but they are not necessarily required to be performed in the order shown. Operations may be added, replaced, changed order, and / or eliminated as appropriate, in accordance with the spirit and scope of embodiments of the disclosure. Embodiments that combine different features and / or different embodiments are within the scope of the disclosure and will be apparent to those of ordinary skill in the art after reviewing this disclosure.

[0124] FIG. 7 is a schematic diagram of a computer system 700, in accordance with some embodiments. In one or more embodiments, the computer system 700 is an example configuration of one or more components as described herein, including, but not limited to, a resource manager, a transaction manager, an API server, a database, a lifecycle manager, a policy engine, nodes, cluster managers, or the like.

[0125] The computer system 700 includes a hardware processor 702 and a non-transitory, computer-readable storage medium 704. Storage medium 704, amongst other things, is encoded with, i.e., stores, computer program code 706, i.e., a set of executable instructions,such as one or more algorithms, programs, applications, sets of executable instructions for various operations as described with respect to one or more of FIGs. 1A-6C. Execution of instructions 706 by hardware processor 702 implements a portion or all of the methods described herein in accordance with one or more embodiments (hereinafter, the noted processes and / or methods).

[0126] Processor 702 is coupled to non-transitory computer-readable storage medium 704 via a bus 708. Processor 702 is also coupled to an VO interface 710 by bus 708. A network interface 712 is connected to processor 702 via bus 708. Network interface 712 is connected to a network 714, so that processor 702 and computer-readable storage medium 704 are connectable to external elements or devices via network 714. Processor 702 is configured to execute computer program code 706 encoded in computer-readable storage medium 704 in order to cause computer system 700 to be usable for performing a portion or all of the noted processes and / or methods. In one or more embodiments, processor 702 comprises a central processing unit (CPU), a multi-processor, a distributed processing system, an application specific integrated circuit (ASIC), and / or a suitable hardware processing unit.

[0127] In one or more embodiments, computer-readable storage medium 704 comprises an electronic, magnetic, optical, electromagnetic, infrared, and / or a semiconductor system (or apparatus or device). For example, computer-readable storage medium 704 includes a semiconductor or solid-state memory, a magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk, and / or an optical disk. In one or more embodiments using optical disks, computer-readable storage medium 704 includes a compact disk-read only memory (CD-ROM), a compact disk- read / write (CD-R / W), and / or a digital video disc (DVD).

[0128] In one or more embodiments, storage medium 704 stores computer program code 706 configured to cause computer system 700 to be usable for performing a portion or all of the noted processes and / or methods. In one or more embodiments, storage medium 704 also stores information or data 707, such as event data, consumer data, business data, policies, component configurations or the like, used in a portion or all of the noted processes and / or methods.

[0129] VO interface 710 is coupled to external circuitry. In one or more embodiments, VO interface 710 includes a keyboard, keypad, mouse, trackball, trackpad, touchscreen, and / orcursor direction keys for communicating information and commands to processor 702. Computer system 700 is configured to receive information through I / O interface 710. The information received through I / O interface 710 includes one or more of instructions, data, policies, configurations and / or other parameters for processing by processor 702. The information is transferred to processor 702 via bus 708. Computer system 700 is configured to receive information related to a user interface through I / O interface 710. The information is stored in computer-readable storage medium 704 as user interface (UI) 742.

[0130] Network interface 712 allows computer system 700 to communicate with network 714, to which one or more other computer systems are connected. Network interface 712 includes wireless network interfaces such as BLUETOOTH, WIFI, WIMAX, GPRS, LTE, 5G, 6G, WCDMA, or the like; or wired network interfaces such as ETHERNET, USB, IEEE-864 or the like. In one or more embodiments, a portion or all of noted processes and / or methods, is implemented in two or more computer system 700.

[0131] In some embodiments, a portion or all of the noted processes and / or methods is implemented as a standalone software application for execution by one or more hardware processors. In some embodiments, a portion or all of the noted processes and / or methods is implemented as a software application that is a part of an additional software application. In some embodiments, a portion or all of the noted processes and / or methods is implemented as a plug-in to a software application.

[0132] In accordance with aspect (1), a system for resource management using hierarchical finite state machines, the system comprising: a resource manager; and a lifecycle manager coupled to the resource manager, wherein the lifecycle manager comprises: a first finite state machine (FSM) at a first level, and one or more second FSMs at a second level under the first level, the first FSM comprises a plurality of first states of a set of resources, the set of resources comprises one or more subsets of resources, each second FSM among the one or more second FSMs comprises a plurality of second states of a corresponding subset among the one or more subsets of resources, the resource manager is configured to: receive information about the set of resources, responsive to the received information, send at least one trigger to the lifecycle manager to cause a state transition of the first FSM among the plurality of first states, wherein the state transition of the first FSM further causes a corresponding state transition of each second FSM of the one or more second FSMs among the plurality of second states, and enabledeployment of at least one application in the set of resources based on at least current states of the first FSM and the one or more second FSMs.

[0133] In accordance with aspect (2), in the system of aspect (1), the lifecycle manager is configured to: responsive to the at least one trigger from the resource manager, cause the state transition in the first FSM, responsive to the state transition in the first FSM, send a further trigger to each second FSM of the one or more second FSMs, and responsive to the further trigger received at each second FSM, cause the corresponding state transition in the second FSM.

[0134] In accordance with aspect (3), in the system of any one of aspects (1) and (2), the resource manager comprises: a plurality of event consumer modules distributed among the set of resources, and configured to capture, in real time, one or more events occurring in the set of resources, and a plurality of worker modules distributed among the set of resources, and configured to capture, periodically or on demand, one or more changes in the set of resources, and the resource manager is configured to, responsive to an event captured by an event consumer module among the plurality of event consumer modules or a change captured by a worker module among the plurality of worker modules, send the at least one trigger to the lifecycle manager.

[0135] In accordance with aspect (4), in the system of aspect (3), the resource manager further comprises: a database configured to store the information about the set of resources, one or more events in the set of resources captured by the plurality of event consumer modules, and one or more changes in the set of resources captured by the plurality of worker modules, a transaction manager configured to control the plurality of worker modules, and an application programming interface (API) server configured to permit control of the resource manager from outside the resource manager.

[0136] In accordance with aspect (5), in the system of any one of aspects (1) to (4), the lifecycle manager is configured to, responsive to a state transition in the first FSM or a second FSM among the one or more second FSMs, cause execution of a corresponding workflow among a plurality of workflows in the set of resources.

[0137] In accordance with aspect (6), the system of any one of aspects (1) to (5) further comprises a policy engine coupled to the lifecycle manager, and configured to manage one or more policies for resource management in the set of resources, wherein the lifecycle manageris configured to, responsive to a state transition in the first FSM or a second FSM among the one or more second FSMs, cause execution of a corresponding workflow among a plurality of workflows in the set of resources, based on a corresponding policy among the one or more policies managed by the policy engine.

[0138] In accordance with aspect (7), a computer program product comprising a non- transitory, tangible computer readable storage medium storing a computer program that, when executed by at least one processor, causes the at least one processor to: execute hierarchical finite state machines (FSMs) comprising: a cluster FSM comprising states of a cluster of nodes, the cluster comprising one or more resource pools each including one or more nodes of the cluster, under the cluster FSM, one or more resource pool FSMs corresponding to and comprising states of the one or more resource pools, and under each resource pool FSM among the one or more resource pool FSMs, one or more node FSMs each corresponding to and comprising states of a node in the resource pool corresponding to the resource pool FSM. The at least one processor is further caused to: responsive to a state transition in a first FSM, cause a corresponding state transition in at least one second FSM over or under the first FSM, the first FSM and the second FSM being among the hierarchical FSMs, and enable deployment of an application in a resource pool among the one or more resource pools of the cluster, based on current states of the cluster FSM and the corresponding resource pool FSM.

[0139] In accordance with aspect (8), in the computer program product of aspect (7), the states of the cluster FSM comprise: a start state corresponding to a start of the cluster FSM, an addition started state corresponding to collecting information about the cluster, an addition failed state corresponding to a failure of collecting the information about the cluster, a sync success state corresponding to a success of collecting the information about the cluster, a sync ongoing state corresponding to updating the information about the cluster, and a sync failed state corresponding to a failure of updating the information about the cluster.

[0140] In accordance with aspect (9), in the computer program product of aspect (8), the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a state transition of the cluster FSM to the addition started state or the sync ongoing state, cause execution of one or more workflows to collect or update information of the one or more resource pools; and responsive to one or more triggers indicating a success of collecting or updating the information about the one or more resource pool FSMs, transition the cluster FSM to the sync success state.

[0141] In accordance with aspect (10), in the computer program product of any one of aspects (7) to (9), the states of a resource pool FSM among the one or more resource pool FSMs comprise: a start state corresponding to a start of the resource pool FSM, an added state corresponding to an addition of the resource pool corresponding to the resource pool FSM, an updating state corresponding to updating information about the corresponding resource pool, an updated state corresponding to a success of updating the information about the corresponding resource pool, a running state corresponding to the resource pool being ready for application deployment, and a deleted state corresponding to the resource pool being deleted.

[0142] In accordance with aspect (11), in the computer program product of aspect (10), the computer program, when executed by the at least one processor, further causes the at least one processor to, in a resource pool FSM among the one or more resource pool FSMs: responsive to a sync trigger, transition the resource pool FSM to the updating state, and cause execution of one or more workflows to update information of the one or more nodes in the corresponding resource pool; and responsive to one or more triggers indicating a success of updating the information about the one or more nodes in the corresponding resource pool, transition the resource pool FSM to the updated state, and cause a trigger corresponding to the updated state of the resource pool FSM to be sent to the cluster FSM.

[0143] In accordance with aspect (12), in the computer program product of any one of aspects (7) to (11), the states of a node FSM corresponding to a node among the nodes of the cluster comprise: a start state corresponding to a start of the node FSM, an empty state corresponding to the corresponding node being currently pooled in, but having no application running thereon, a backup state corresponding to the node being not currently pooled in, but being moveable to the empty state, an in-use state corresponding to the node being currently pooled in, and having at least one application running thereon, a maintenance state corresponding to the node being under maintenance, an out-of-pool state corresponding to the node being disconnected from the resource pool, but being connectable to the resource pool again, a decommissioned state corresponding to the node being disconnected from the resource pool and not connectable to the resource pool again, and a failed state corresponding to the node having a failure.

[0144] In accordance with aspect (13), in the computer program product of aspect (12), the computer program, when executed by the at least one processor, further causes the at least oneprocessor to, in a node FSM among the one or more node FSMs under a resource pool FSM among the one or more resource pool FSMs: responsive to a trigger indicating information collected or updated from the corresponding node, cause the node FSM to have a state corresponding to the collected or updated information of the corresponding node, and cause a trigger corresponding to the state of the node FSM to be sent to the corresponding the resource pool FSM.

[0145] In accordance with aspect (14), in the computer program product of any one of aspects (7) to (13), a resource pool among the one or more resource pools comprises a tenant, the tenant comprises an amount of resources of at least one node among the one or more nodes in the resource pool, and the hierarchical FSMs further comprise a tenant FSM corresponding to and comprising states of the tenant.

[0146] In accordance with aspect (15), in the computer program product of aspect (14), the states of the tenant FSM comprise: a start state corresponding to a start of the tenant FSM, an in-use state corresponding to the tenant hosting at least one application thereon, a reserved state corresponding to the tenant being reserved for an application, but currently not hosting the application, an empty state corresponding to the tenant being not reserved, and having no application running thereon, and a deleted state corresponding to the tenant being deleted.

[0147] In accordance with aspect (16), in the computer program product of aspect (15), the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a state transition of the resource pool FSM from an updated state to a running state, determine whether the amount of resources of the tenant is within an updated amount of resources available in the resource pool.

[0148] In accordance with aspect (17), in the computer program product of any one of aspects (7) to (16), the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a trigger from an event consumer module indicating that a node in the cluster has failed, transition the cluster FSM to a sync ongoing state, cause execution of one or more workflows to update information of the one or more resource pools and the nodes in the cluster, based on the updated information, transition the node FSM corresponding to the failed node to a failed state, update an amount of resources available in the resource pool including the failed node, update an amount of resourcesavailable in the cluster, transition the corresponding resource pool FSM to an updated state, and transition the cluster FSM to a sync success state.

[0149] In accordance with aspect (18), in the computer program product of aspect (17), the computer program, when executed by the at least one processor, further causes the at least one processor to: periodically collect information of the one or more resource pools and the nodes in the cluster, based on the periodically collected information and one or more policies, control at least one empty node in the cluster to shut down, transition the node FSM corresponding to the shutdown node to an out-of-pool state, update an amount of resources available in the resource pool including the shutdown node, and update an amount of resources available in the cluster.

[0150] In accordance with aspect (19), in the computer program product of any one of aspects (7) to (18), the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a trigger to perform maintenance for a node in the cluster, transition the node FSM corresponding to the node to a maintenance state, update an amount of resources available in the resource pool including the node under maintenance, and update an amount of resources available in the cluster.

[0151] In accordance with aspect (20), a method performed at least in part by at least one processor, the method comprising: executing hierarchical finite state machines (FSMs) comprising: a cluster FSM comprising states of a cluster of nodes, the cluster comprising one or more resource pools each including one or more nodes of the cluster, under the cluster FSM, one or more resource pool FSMs corresponding to and comprising states of the one or more resource pools, and under each resource pool FSM among the one or more resource pool FSMs, one or more node FSMs each corresponding to and comprising states of a node in the resource pool corresponding to the resource pool FSM; responsive to an event detected by an event consumer module, or a change captured by a worker module, at a node of the cluster, causing execution of one or more workflows to update information of the one or more resource pools and the nodes in the cluster, while the one or more workflows being executed, transitioning the cluster FSM to a sync ongoing state and transitioning the one or more resource pool FSMs to an updating state, transitioning the node FSM corresponding to the node to a state corresponding to the detected event or the captured change, based on the updated information of the one or more resource pools and the nodes in the cluster, updating an amount of resources available in each resource pool among the one or more resource pools, and an amount ofresources available in the cluster, and upon completion of the execution of the one or more workflows, transitioning the cluster FSM to a sync success state and transitioning the one or more resource pool FSMs to an updated state; and enabling deployment of an application in the cluster based on current states of the cluster FSM and the one or more resource pool FSMs, and the available amounts of resources in the cluster and the one or more resource pools.

[0152] The foregoing outlines features of several embodiments so that those skilled in the art better understand the aspects of the present disclosure. Those skilled in the art should appreciate that they readily use the present disclosure as a basis for designing or modifying other processes and structures for carrying out the same purposes and / or achieving the same advantages of the embodiments introduced herein. Those skilled in the art should also realize that such equivalent constructions do not depart from the spirit and scope of the present disclosure, and that they make various changes, substitutions, and alterations herein without departing from the spirit and scope of the present disclosure.

Claims

WHAT IS CLAIMED IS:

1. A system for resource management using hierarchical finite state machines, the system comprising: a resource manager; and a lifecycle manager coupled to the resource manager, wherein the lifecycle manager comprises: a first finite state machine (FSM) at a first level, and one or more second FSMs at a second level under the first level, the first FSM comprises a plurality of first states of a set of resources, the set of resources comprises one or more subsets of resources, each second FSM among the one or more second FSMs comprises a plurality of second states of a corresponding subset among the one or more subsets of resources, the resource manager is configured to: receive information about the set of resources, responsive to the received information, send at least one trigger to the lifecycle manager to cause a state transition of the first FSM among the plurality of first states, wherein the state transition of the first FSM further causes a corresponding state transition of each second FSM of the one or more second FSMs among the plurality of second states, and enable deployment of at least one application in the set of resources based on at least current states of the first FSM and the one or more second FSMs.

2. The system of claim 1, wherein the lifecycle manager is configured to: responsive to the at least one trigger from the resource manager, cause the state transition in the first FSM, responsive to the state transition in the first FSM, send a further trigger to each second FSM of the one or more second FSMs, and responsive to the further trigger received at each second FSM, cause the corresponding state transition in the second FSM.

3. The system of claim 1, wherein the resource manager comprises:a plurality of event consumer modules distributed among the set of resources, and configured to capture, in real time, one or more events occurring in the set of resources, and a plurality of worker modules distributed among the set of resources, and configured to capture, periodically or on demand, one or more changes in the set of resources, and the resource manager is configured to, responsive to an event captured by an event consumer module among the plurality of event consumer modules or a change captured by a worker module among the plurality of worker modules, send the at least one trigger to the lifecycle manager.

4. The system of claim 3, wherein the resource manager further comprises: a database configured to store the information about the set of resources, one or more events in the set of resources captured by the plurality of event consumer modules, and one or more changes in the set of resources captured by the plurality of worker modules, a transaction manager configured to control the plurality of worker modules, and an application programming interface (API) server configured to permit control of the resource manager from outside the resource manager.

5. The system of claim 1, wherein the lifecycle manager is configured to, responsive to a state transition in the first FSM or a second FSM among the one or more second FSMs, cause execution of a corresponding workflow among a plurality of workflows in the set of resources.

6. The system of claim 1, further comprising: a policy engine coupled to the lifecycle manager, and configured to manage one or more policies for resource management in the set of resources, wherein the lifecycle manager is configured to, responsive to a state transition in the first FSM or a second FSM among the one or more second FSMs, cause execution of a corresponding workflow among a plurality of workflows in the set of resources, based on a corresponding policy among the one or more policies managed by the policy engine.

7. A computer program product comprising a non-transitory, tangible computer readable storage medium storing a computer program that, when executed by at least one processor, causes the at least one processor to: execute hierarchical finite state machines (FSMs) comprising: a cluster FSM comprising states of a cluster of nodes, the cluster comprising one or more resource pools each including one or more nodes of the cluster, under the cluster FSM, one or more resource pool FSMs corresponding to and comprising states of the one or more resource pools, and under each resource pool FSM among the one or more resource pool FSMs, one or more node FSMs each corresponding to and comprising states of a node in the resource pool corresponding to the resource pool FSM, responsive to a state transition in a first FSM, cause a corresponding state transition in at least one second FSM over or under the first FSM, the first FSM and the second FSM being among the hierarchical FSMs, and enable deployment of an application in a resource pool among the one or more resource pools of the cluster, based on current states of the cluster FSM and the corresponding resource pool FSM.

8. The computer program product of claim 7, wherein the states of the cluster FSM comprise: a start state corresponding to a start of the cluster FSM, an addition started state corresponding to collecting information about the cluster, an addition failed state corresponding to a failure of collecting the information about the cluster, a sync success state corresponding to a success of collecting the information about the cluster, a sync ongoing state corresponding to updating the information about the cluster, and a sync failed state corresponding to a failure of updating the information about the cluster.

9. The computer program product of claim 8, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to:responsive to a state transition of the cluster FSM to the addition started state or the sync ongoing state, cause execution of one or more workflows to collect or update information of the one or more resource pools, and responsive to one or more triggers indicating a success of collecting or updating the information about the one or more resource pool FSMs, transition the cluster FSM to the sync success state.

10. The computer program product of claim 7, wherein the states of a resource pool FSM among the one or more resource pool FSMs comprise: a start state corresponding to a start of the resource pool FSM, an added state corresponding to an addition of the resource pool corresponding to the resource pool FSM, an updating state corresponding to updating information about the corresponding resource pool, an updated state corresponding to a success of updating the information about the corresponding resource pool, a running state corresponding to the resource pool being ready for application deployment, and a deleted state corresponding to the resource pool being deleted.

11. The computer program product of claim 10, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to, in a resource pool FSM among the one or more resource pool FSMs: responsive to a sync trigger, transition the resource pool FSM to the updating state, and cause execution of one or more workflows to update information of the one or more nodes in the corresponding resource pool, and responsive to one or more triggers indicating a success of updating the information about the one or more nodes in the corresponding resource pool, transition the resource pool FSM to the updated state, and cause a trigger corresponding to the updated state of the resource pool FSM to be sent to the cluster FSM.

12. The computer program product of claim 7, wherein the states of a node FSM corresponding to a node among the nodes of the cluster comprise: a start state corresponding to a start of the node FSM, an empty state corresponding to the corresponding node being currently pooled in, but having no application running thereon, a backup state corresponding to the node being not currently pooled in, but being moveable to the empty state, an in-use state corresponding to the node being currently pooled in, and having at least one application running thereon, a maintenance state corresponding to the node being under maintenance, an out-of-pool state corresponding to the node being disconnected from the resource pool, but being connectable to the resource pool again, a decommissioned state corresponding to the node being disconnected from the resource pool, and not connectable to the resource pool again, and a failed state corresponding to the node having a failure.

13. The computer program product of claim 12, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to, in a node FSM among the one or more node FSMs under a resource pool FSM among the one or more resource pool FSMs: responsive to a trigger indicating information collected or updated from the corresponding node, cause the node FSM to have a state corresponding to the collected or updated information of the corresponding node, and cause a trigger corresponding to the state of the node FSM to be sent to the corresponding the resource pool FSM.

14. The computer program product of claim 7, wherein a resource pool among the one or more resource pools comprises a tenant, the tenant comprises an amount of resources of at least one node among the one or more nodes in the resource pool, and the hierarchical FSMs further comprise a tenant FSM corresponding to and comprising states of the tenant.

15. The computer program product of claim 14, wherein the states of the tenant FSM comprise: a start state corresponding to a start of the tenant FSM, an in-use state corresponding to the tenant hosting at least one application thereon, a reserved state corresponding to the tenant being reserved for an application, but currently not hosting the application, an empty state corresponding to the tenant being not reserved, and having no application running thereon, and a deleted state corresponding to the tenant being deleted.

16. The computer program product of claim 15, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a state transition of the resource pool FSM from an updated state to a running state, determine whether the amount of resources of the tenant is within an updated amount of resources available in the resource pool.

17. The computer program product of claim 7, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a trigger from an event consumer module indicating that a node in the cluster has failed, transition the cluster FSM to a sync ongoing state, cause execution of one or more workflows to update information of the one or more resource pools and the nodes in the cluster, based on the updated information, transition the node FSM corresponding to the failed node to a failed state, update an amount of resources available in the resource pool including the failed node, update an amount of resources available in the cluster, transition the corresponding resource pool FSM to an updated state, and transition the cluster FSM to a sync success state.

18. The computer program product of claim 7, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to: periodically collect information of the one or more resource pools and the nodes in the cluster, based on the periodically collected information and one or more policies, control at least one empty node in the cluster to shut down, transition the node FSM corresponding to the shutdown node to an out-of-pool state, update an amount of resources available in the resource pool including the shutdown node, and update an amount of resources available in the cluster.

19. The computer program product of claim 7, wherein the computer program, when executed by the at least one processor, further causes the at least one processor to: responsive to a trigger to perform maintenance for a node in the cluster, transition the node FSM corresponding to the node to a maintenance state, update an amount of resources available in the resource pool including the node under maintenance, and update an amount of resources available in the cluster.

20. A method performed at least in part by at least one processor, the method comprising: executing hierarchical finite state machines (FSMs) comprising: a cluster FSM comprising states of a cluster of nodes, the cluster comprising one or more resource pools each including one or more nodes of the cluster, under the cluster FSM, one or more resource pool FSMs corresponding to and comprising states of the one or more resource pools, and under each resource pool FSM among the one or more resource pool FSMs, one or more node FSMs each corresponding to and comprising states of a node in the resource pool corresponding to the resource pool FSM; responsive to an event detected by an event consumer module, or a change captured by a worker module, at a node of the cluster, causing execution of one or more workflows to update information of the one or more resource pools and the nodes in the cluster,while the one or more workflows being executed, transitioning the cluster FSM to a sync ongoing state and transitioning the one or more resource pool FSMs to an updating state, transitioning the node FSM corresponding to the node to a state corresponding to the detected event or the captured change, based on the updated information of the one or more resource pools and the nodes in the cluster, updating an amount of resources available in each resource pool among the one or more resource pools, and an amount of resources available in the cluster, and upon completion of the execution of the one or more workflows, transitioning the cluster FSM to a sync success state and transitioning the one or more resource pool FSMs to an updated state; and enabling deployment of an application in the cluster based on current states of the cluster FSM and the one or more resource pool FSMs, and the available amounts of resources in the cluster and the one or more resource pools.

Citation Information

Patent Citations

  • Lifecycle management of custom resources in a cloud computing environment

    US10362096B2

  • Advanced behavior engine

    US9327403B2

  • System and method for managing resources in virtualized environment based on resource state information and policy information

    US9430264B2