Instance scheduling method and device
By recording application instance information through management nodes and migrating application instances when resource usage reaches a preset value, the problem of limited Pod expansion caused by limited hardware resources of real nodes is solved, achieving efficient utilization of resource pools and cost reduction.
Patent Information
- Application Number
- CN202411098850.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2026-02-10
AI Technical Summary
In a Kubernetes cluster, the limited hardware resources of real nodes lead to limitations in Pod scaling.
The management node records application instance information, allows or prohibits migration to the second resource pool, and migrates the second application instance from the first resource pool to the second resource pool when the resource usage reaches a preset value, releasing hardware resources to support the creation of new application instances and ensuring that the first resource pool has sufficient hardware resources.
This avoids limitations on Pod expansion, ensures the normal operation of application instances, improves resource pool utilization, and reduces deployment costs.
Smart Images

Figure CN121501410A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an instance scheduling method and apparatus. Background Technology
[0002] Elastic scheduling refers to dynamically adjusting the allocation and use of resources (computing resources, storage resources, etc.) based on the load and resource requirements of a cloud computing platform. For Kubernetes clusters, virtual nodes can be added via virtualkubelet. When migrating container groups (Pods) between real nodes and virtual nodes in a Kubernetes cluster, only a single policy is used, such as instructing Pods on real nodes not to migrate to virtual nodes. Due to the limited hardware resources of real nodes, scaling up Pods on real nodes will be limited. Summary of the Invention
[0003] This application provides an instance scheduling method and apparatus to address the problem that limited hardware resources of real nodes restrict Pod scaling on real nodes when a single strategy is adopted.
[0004] The technical solution adopted in this application is as follows.
[0005] Firstly, this application provides an instance scheduling method. This instance scheduling method can be applied to a computer system or to a computing device that supports the implementation of the instance scheduling method within the computer system. The computing device may include servers, terminals, etc. In one possible example, the instance scheduling method is applied to a cloud management platform (also referred to as a management node). The cloud management platform manages a first resource pool and a second resource pool. The first resource pool includes a first server cluster, and the second resource pool includes a second server cluster. Multiple application instances are configured in the first resource pool, including both the first and second application instances. The following description uses the management node executing this aspect as an example. The instance scheduling method includes: the management node recording, based on the application instance information input by the tenant, the first application instance as not allowed to migrate to the second resource pool, and the second application instance as allowed to migrate to the second resource pool. Furthermore, the management node obtains an application instance creation request input by the tenant, requesting the creation of a third application instance with predetermined hardware resource requirements in the first resource pool, and then creates a third application instance in the first resource pool according to the application instance creation request. The management node obtains the resource usage of the first resource pool, and then, if the resource usage is greater than or equal to a first preset value, migrates the second application instance from the first resource pool to the second resource pool. Specifically, the first application instance uses the first hardware resources of the first server cluster, the second application instance uses the second hardware resources of the first server cluster, and the third application instance uses the third hardware resources of the first server cluster, with the third hardware resources matching the predetermined hardware resource requirements. The second application instance uses the fourth hardware resources of the second server cluster, and the fourth hardware resources are identical to the second hardware resources.
[0006] In this application, the management node reserves corresponding hardware resources in the first resource pool to meet the needs of creating new application instances (third application instances) in the first resource pool, avoiding the problem of limited Pod expansion and ensuring the normal operation of the third application instance. Furthermore, when the resource usage of the first resource pool is greater than or equal to a first preset value, the management node migrates the second application instance, which is allowed to migrate to the second resource pool, from the first resource pool to the second resource pool. This releases the first resource pool occupied by the second application instance, ensuring that the first resource pool has sufficient hardware resources when application instances in the first resource pool are expanded, thus allowing the application instances to operate normally. The management node only migrates application instances that are allowed to migrate to the second resource pool, while retaining application instances that are not allowed to migrate to the second resource pool in the first resource pool, realizing migration operations that meet the tenant's needs based on the application instance information configured by the tenant.
[0007] In one possible scenario, the hardware resources of the first server cluster include one or more combinations of computing resources, storage resources, and network resources.
[0008] In one possible scenario, the above application example is used to indicate a container group (Pod) or virtual machine.
[0009] For the first resource pool and the second resource pool, the following three possible scenarios are provided.
[0010] In the first possible scenario, the first resource pool is a local resource pool, and the second resource pool is a remote resource pool.
[0011] In the second possible scenario, the first resource pool is the first remote resource pool, and the second resource pool is the second remote resource pool.
[0012] In one possible example, the latency of an application instance running in the first remote resource pool is less than the latency of an application instance running in the second remote resource pool.
[0013] In one possible example, the cost of using the first remote resource pool is lower than the cost of using the second remote resource pool.
[0014] For example, the billing method for the first resource pool is prepaid, while the payment method for the second resource pool is pay-as-you-go.
[0015] In the third possible scenario, the first resource pool is the first local resource pool, and the second resource pool is the second local resource pool.
[0016] In one possible example, the latency of an application instance running in the first local resource pool is less than the latency of an application instance running in the second local resource pool.
[0017] In one possible implementation, the first application instance has a first field. If the first field has a first value, the first application instance is allowed to migrate to the second resource pool; if the first field has a second value, the first application instance is not allowed to migrate to the second resource pool. Similarly, the second application instance also has a first field. If the first field has a first value, the second application instance is allowed to migrate to the second resource pool; if the first field has a second value, the second application instance is not allowed to migrate to the second resource pool.
[0018] In one possible example, the first field of the above application instance is stored in a database managed by the cloud management platform.
[0019] For example, the database could be an ETCD (Electronic Key-Value Store Database).
[0020] In one possible implementation, the first application instance has a second field. If the second field has a third value, the first application instance is allowed to migrate from the first resource pool to the second resource pool. If the second field has a fourth value, the first application instance is allowed to migrate from the second resource pool to the first resource pool.
[0021] In one possible example, the second field has two characters. If the first character is a third value (such as 1), then the first application instance is allowed to migrate from the first resource pool to the second resource pool. If the second character is a fourth value (such as 1), then the first application instance is allowed to migrate from the second resource pool to the first resource pool.
[0022] Similarly, the second application instance has a second field. If the second field has a third value, the second application instance is allowed to migrate from the first resource pool to the second resource pool. If the second field has a fourth value, the second application instance is allowed to migrate from the second resource pool to the first resource pool.
[0023] In one possible example, the second field of the above application instance is stored in a database managed by the cloud management platform.
[0024] In one possible implementation, a fourth application instance is also set up in the first resource pool, and the fourth application instance uses the fifth hardware resource of the first server cluster. The instance scheduling method further includes: the management node recording that the fourth application instance and the second application instance belong to the same group based on the grouping information input by the tenant. The management node migrates the second application instance from the first resource pool to the second resource pool, including: the management node migrates both the second and fourth application instances from the first resource pool to the second resource pool. The second application instance uses the sixth hardware resource of the second server cluster, and the sixth hardware resource is identical to the fifth hardware resource.
[0025] In this application, the management node migrates the second and fourth application instances, which belong to the same group, to the second resource pool together. As a result, the communication latency between the second and fourth application instances is low during operation, thereby improving the service performance of the second and fourth application instances.
[0026] In one possible scenario, the second application instance and the fourth application instance have the same group identifier.
[0027] In one possible example, the database managed by the management node stores the third field of the second application instance and the third field of the fourth application instance. The value of this third field is used to indicate a group identifier. Application instances with the same value in the third field belong to the same group.
[0028] For example, the value of the third field corresponding to the second application instance is the same as the value of the third field corresponding to the fourth application instance.
[0029] In one possible implementation, the aforementioned multiple instances further include a fifth application instance. The instance scheduling method further includes: the management node obtaining an application instance cancellation request for the fifth application instance input by a tenant, and then, based on the application instance cancellation request, stopping the fifth application instance from running in the first resource pool and releasing the seventh hardware resource occupied by the fifth application instance in the first resource pool. Additionally, the management node obtains the resource idle amount in the first resource pool, and if the resource idle amount is greater than or equal to a second preset value, migrates the second application instance from the second resource pool to the first resource pool. The resource idle amount is used to indicate the total idle amount of hardware resources in the first server cluster.
[0030] In this application, after the management node stops running the fifth application instance and releases the seventh hardware resource occupied by the fifth application instance in the first resource pool, it determines that the amount of idle resources in the first resource pool is greater than or equal to a second preset value. Then, it migrates the second application instance from the second resource pool to the first resource pool, thereby improving the resource utilization rate of the first resource pool. When the first resource pool uses a prepaid billing method and the second resource pool uses a pay-as-you-go billing method, the increased resource utilization rate of the first resource pool reduces the deployment cost of the application instances.
[0031] In one possible implementation, the first application instance includes M containers running in the first server cluster, where M is a positive integer. The instance scheduling method further includes: the management node confirming that the number of M containers in the first application instance is reduced to N containers, and obtaining the available resources of the first resource pool. If the available resources are greater than or equal to a second preset value, the second application instance is migrated from the second resource pool to the first resource pool. Here, N is less than M, N is a positive integer, and the available resources indicate the total available hardware resources of the first server cluster.
[0032] In this application, the management node determines that the first application instance is scaled down. If, after scaling down, the available resources in the first resource pool are greater than or equal to a second preset value, the second application instance is migrated from the second resource pool to the first resource pool, thereby improving the resource utilization of the first resource pool. When the first resource pool uses a prepaid billing method and the second resource pool uses a pay-as-you-go method, the increased resource utilization of the first resource pool reduces the deployment cost of the application instance.
[0033] In one possible implementation, the management node obtains a processing strategy input by the tenant. This processing strategy is used to instruct the application instance to migrate between a first resource pool and a second resource pool when preset conditions are met.
[0034] In one possible example, the processing strategy includes: when the resource usage is greater than or equal to a first preset value, instructing the management node to migrate the second application instance in the first resource pool to the second resource pool; when the resource idle amount is greater than or equal to a second preset value, instructing the management node to migrate the second application instance from the second resource pool to the first resource pool.
[0035] In another possible example, the processing strategy also includes: the first resource pool supports a predetermined resource (hardware resource), and when the amount of available resources is less than or equal to the predetermined hardware resource requirement, the management node is instructed to migrate the application instances in the first resource pool to the second resource pool, so as to ensure that the amount of available resources in the first resource pool is greater than or equal to the predetermined resource amount.
[0036] In another possible example, the processing strategy also includes: multiple application instances belonging to the same group should be located in the first resource pool or the second resource pool at the same time. That is, when the management node migrates the second application instance from the first resource pool to the second resource pool, it should also migrate the fourth application instance belonging to the same group as the second application instance from the first resource pool to the second resource pool.
[0037] For example, the above processing strategy can be a configuration file, which can be represented as a YAML (YAML ain't markuplanguage) file.
[0038] In one possible implementation, the management node migrates the second application instance from the first resource pool to the second resource pool, including: the management node creates a copy of the second application instance in the second resource pool; if the copy of the second application instance meets the running conditions, the management node sends a first instruction to the first resource pool to instruct the second application instance to be taken offline, and sends a second instruction to the second resource pool to run the copy of the second application instance.
[0039] In one possible scenario, the copy of the second application instance has a fourth field, and if the fourth field is a fifth value, then the copy of the first application instance satisfies the operating conditions.
[0040] In one possible example, the fourth field of the copy of the second application instance described above is stored in a database managed by the cloud computing platform.
[0041] For example, the fifth value is ready.
[0042] Secondly, this application provides an instance scheduling apparatus. This instance scheduling apparatus is applied to a computer system or to a computing device that supports the computer system in implementing an instance scheduling method. The apparatus includes modules for executing the instance scheduling method in the first aspect or any optional implementation thereof. In one possible example, the instance scheduling apparatus is applied to a cloud management platform (such as a management node or computing device). The cloud management platform manages a first resource pool and a second resource pool. The first resource pool includes a first server cluster, and the second resource pool includes a second server cluster. Multiple application instances are configured in the first resource pool, including both first and second application instances. Exemplarily, the instance scheduling apparatus includes: a first configuration module, a first acquisition module, a creation module, a second acquisition module, and a migration module.
[0043] The first configuration module is used to record, based on the application instance information input by the tenant, the first application instance as an application instance that is not allowed to be migrated to the second resource pool, and the second application instance as an application instance that is allowed to be migrated to the second resource pool, wherein the first application instance uses the first hardware resources of the first server cluster, and the second application instance uses the second hardware resources of the first server cluster.
[0044] The first acquisition module acquires the application instance creation request input by the tenant. The application instance creation request is used to request the creation of a third application instance with predetermined hardware resource requirements in the first resource pool.
[0045] The module creates a third application instance based on the application instance creation request. The third application instance uses the third hardware resources of the first server cluster, and the third hardware resources match the predetermined hardware resource requirements.
[0046] The second acquisition module acquires the resource usage of the first resource pool, which is used to indicate the total hardware resource usage of the first server cluster.
[0047] The migration module migrates the second application instance from the first resource pool to the second resource pool when the resource usage is greater than or equal to a first preset value. The second application instance uses the fourth hardware resource of the second server cluster, and the fourth hardware resource is consistent with the second hardware resource.
[0048] For more detailed implementation information regarding the instance scheduling device, please refer to the description of any of the implementation methods in the first aspect above, as well as the content of the specific implementation methods below, which will not be repeated here.
[0049] Thirdly, this application provides a chip, including: a processor and a power supply circuit; the power supply circuit is used to supply power to the processor, and the processor is used to execute the method in the first aspect or any possible implementation of the first aspect.
[0050] Fourthly, this application provides a computing device cluster. The computing device cluster includes at least one computing device, which includes a memory and a processor. The memory stores computer instructions; when the processor executes the computer instructions, it implements the method described in the first aspect or any possible implementation of the first aspect.
[0051] Fifthly, this application provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processing device, implement the method described in the first aspect or any possible implementation of the first aspect.
[0052] In a sixth aspect, this application provides a computer program product comprising a computer program or instructions that, when executed by a processing device, implement the method in the first aspect or any possible implementation thereof.
[0053] The beneficial effects of aspects two through six above can be referred to in the first aspect or any possible implementation of the first aspect, and will not be elaborated here. Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. Attached Figure Description
[0054] Figure 1 A schematic diagram of a computer system provided in this application;
[0055] Figure 2 Flowchart of the instance scheduling method provided in this application Figure 1 ;
[0056] Figure 3 Flowchart of the instance scheduling method provided in this application Figure 2 ;
[0057] Figure 4 Flowchart of the instance scheduling method provided in this application Figure 3 ;
[0058] Figure 5 A schematic diagram of the structure of an instance scheduling device provided in this application Figure 1 ;
[0059] Figure 6 A schematic diagram of the structure of an instance scheduling device provided in this application Figure 2 ;
[0060] Figure 7 A schematic diagram of the structure of a computing device provided in this application;
[0061] Figure 8This application provides a schematic diagram of the structure of a computing device cluster;
[0062] Figure 9 This is a schematic diagram of the connection between computing devices provided in this application. Detailed Implementation
[0063] To address the issue of limited Pod scaling on real nodes due to limited hardware resources when using a single strategy, this application provides an instance scheduling method. The management node records a first application instance as not allowed to migrate to the second resource pool, and a second application instance as allowed to migrate to the second resource pool, based on application instance information input by the tenant. Then, the management node obtains an application instance creation request from the tenant requesting the creation of a third application instance with predetermined hardware resource requirements in the first resource pool, and creates the third application instance in the first resource pool according to the request. The management node obtains the resource usage of the first resource pool, and if the resource usage is greater than or equal to a first preset value, migrates the second application instance from the first resource pool to the second resource pool. Specifically, the first application instance uses the first hardware resources of the first server cluster, the second application instance uses the second hardware resources of the first server cluster, and the third application instance uses the third hardware resources of the first server cluster, matching the predetermined hardware resource requirements. The second application instance uses the fourth hardware resources of the second server cluster, and the fourth hardware resources are identical to the second hardware resources.
[0064] In this application, the management node reserves corresponding hardware resources in the first resource pool to meet the needs of creating new application instances (third application instances) in the first resource pool, avoiding the problem of limited Pod expansion and ensuring the normal operation of the third application instance. Furthermore, when the resource usage of the first resource pool is greater than or equal to a first preset value, the management node migrates the second application instance, which is allowed to migrate to the second resource pool, from the first resource pool to the second resource pool. This releases the first resource pool occupied by the second application instance, ensuring that the first resource pool has sufficient hardware resources when application instances in the first resource pool are expanded, thus allowing the application instances to operate normally. The management node only migrates application instances that are allowed to migrate to the second resource pool, while retaining application instances that are not allowed to migrate to the second resource pool in the first resource pool, realizing migration operations that meet the tenant's needs based on the application instance information configured by the tenant.
[0065] To facilitate understanding, the technical terms used in this application will be introduced first.
[0066] A local resource pool refers to a collection of node resources composed of real nodes.
[0067] Elastic resource pools, also known as remote resource pools, refer to the collection of remote resources corresponding to virtual nodes.
[0068] Real nodes refer to nodes that are registered to the Kubernetes cluster by physical machines or virtual machines, including both virtual machine nodes and physical machine nodes.
[0069] Virtual machine nodes refer to virtual machine instances created in a virtualization environment. These virtual machines can also be added to the cluster as Kubernetes nodes, providing computing or storage resources for containers.
[0070] A physical machine node refers to a physical server or bare metal device that is installed as a Kubernetes node, enabling Kubernetes to utilize its computing or storage resources to run containers.
[0071] A virtual node is a node registered by a non-physical machine or virtual machine. For Kubernetes, nodes can be registered using virtual kubelet technology. Virtual nodes can be used to host containers scheduled by the cluster and forward them to real containers in a remote resource pool for execution.
[0072] For example, if a Kubernetes cluster is deployed in a local resource pool, to increase the capacity of pods that can be deployed in the Kubernetes cluster or to expand the local resource pool when resources are exhausted, a remote resource pool can be connected to the Kubernetes cluster via Virtual Kubelet.
[0073] Next, the instance scheduling method provided in this application will be described in detail with reference to the accompanying drawings.
[0074] First, see Figure 1 , Figure 1 A schematic diagram of a computer system provided in this application. For example... Figure 1 As shown, the computer system includes a management node 110, a first resource pool 120, and a second resource pool 130. The management node 110, the first resource pool 120, and the second resource pool 130 can communicate with each other via wired or wireless means.
[0075] In this application, the management node 110 may also be referred to as a cloud management platform. The management node 110 is used to manage the first resource pool 120 and the second resource pool 130.
[0076] For example, management node 110 is used to manage one or more application instances set on the first resource pool 120 and one or more application instances set on the second resource pool 130.
[0077] For example, management node 110 is used to schedule application instances in the first resource pool 120 to the second resource pool 130.
[0078] For example, management node 110 is used to schedule application instances in the second resource pool 130 to the first resource pool 120.
[0079] The first resource pool 120 includes a first server cluster, which provides computing resources, storage resources, network resources, etc., to the first resource pool 120. The second resource pool 130 includes a second server cluster, which provides computing resources, storage resources, network resources, etc., to the second resource pool 130.
[0080] For example, the first server cluster may include worker nodes 121, 122, and 123. The second server cluster may include worker nodes 131, 132, and 133. These worker nodes may also be referred to as computing devices or working devices, which can be used to perform corresponding tasks, such as executing computing tasks or training tasks assigned by management node 110. Management node 110 may also be referred to as a computing device or control device, which can be used to schedule application instances deployed on the worker nodes. For details on computing devices, please refer to the following... Figure 7 The specific wording is omitted here.
[0081] The aforementioned wired communication methods can include: Ethernet, fiber optic, and various peripheral component interconnect express (PCIe) buses installed inside the computer system to connect management node 110, the first resource pool 120, and the second resource pool 130.
[0082] The aforementioned wireless communication methods can include: the Internet, wireless fidelity (WIFI), and ultra-wideband (UWB) technology, etc.
[0083] In one possible example, the computer system described above may also include terminal 140, terminal 150, and terminal 160.
[0084] Terminals 140, 150, and 160 can be mobile phones, tablets, handheld computers, personal computers (PCs), cellular phones, personal digital assistants (PDAs), wearable devices (such as smartwatches), smart home devices (such as televisions), in-vehicle computers, game consoles, and augmented reality (AR) / virtual reality (VR) devices, etc. This application does not impose any special restrictions on the specific device form of terminals 140, 150, and 160.
[0085] In another possible example, terminals 140, 150, and 160 are set up independently and communicate with the computer system.
[0086] It should be noted that, Figure 1 The illustrated computer system architecture is merely an example; the types or number of devices within the system can be configured according to actual needs, and this application embodiment does not limit this. For example, the computer system may also include more management nodes or resource pools.
[0087] The following describes the scenarios in which the instance scheduling method provided in this application may be applied.
[0088] In a first possible scenario, the instance scheduling method provided in this application can be applied to a hybrid cloud. The first resource pool 120 is a local resource pool, and the second resource pool 130 is a remote resource pool. The management node 110 is used to schedule instances between the local resource pool and the remote resource pool.
[0089] Among them, the local resource pool has higher priority than the remote resource pool.
[0090] For example, the cost of using a local resource pool is lower than that of using a remote resource pool. Therefore, to reduce the cost of use, the local resource pool has a higher priority.
[0091] For example, the local resource pool consists of computing equipment components purchased by the tenant, while the remote resource pool is provided by the cloud service provider.
[0092] For example, the local resource pool is charged on an annual / monthly basis, meaning it is billed on a prepaid basis, while the remote resource pool is charged based on resource usage (computing, storage, or network resources), meaning it is billed on a pay-as-you-go basis. The aforementioned local resource pool can be constructed by tenants purchasing worker nodes from cloud service providers.
[0093] In a second possible scenario, the instance scheduling method provided in this application can be applied to a public cloud. The first resource pool 120 is a first remote resource pool, and the second resource pool 130 is a second remote resource pool. The management node 110 is used to schedule instances between the first and second remote resource pools.
[0094] Among them, the priority of the first remote resource pool is higher than that of the second remote resource pool.
[0095] For example, the cost of using the first remote resource pool is lower than that of the second remote resource pool. Therefore, to reduce the cost of use, the first remote resource pool has a higher priority.
[0096] For example, the first remote resource pool is charged on an annual / monthly basis, while the second remote resource pool is charged based on the amount of resources (computing resources, storage resources, or network resources) used.
[0097] In a third possible scenario, the instance scheduling method provided in this application can be applied to a private cloud. The first resource pool 120 is a first local resource pool, and the second resource pool 130 is a second local resource pool. The management node 110 is used to schedule instances between the first and second local resource pools.
[0098] Among them, the priority of the first local resource pool is higher than that of the second local resource pool.
[0099] For example, the cost of using the first local resource pool is lower than that of using the second local resource pool. Therefore, to reduce the cost of use, the first local resource pool has a higher priority.
[0100] For example, the latency of using the first local resource pool is lower than that of the second local resource pool. Therefore, to reduce latency, the first local resource pool has a higher priority.
[0101] The three possible application scenarios described above are merely examples provided in this application and should not be construed as limiting this application. In other possible application scenarios, the worker nodes included in the first and second remote resource pools mentioned above can be worker nodes provided by different cloud service providers.
[0102] The method provided in this application is applicable to container clusters, virtual machine clusters, etc.; container clusters such as Kubernetes, and virtual machine clusters such as OpenStack.
[0103] The following description uses the instance scheduling method provided in this application as an example, applied to the first possible scenario described above, and applicable to Kubernetes. The instance scheduling method provided in this application can be applied to... Figure 1 The computer system shown. Figure 2Flowchart of the instance scheduling method provided in this application Figure 1 , Figure 2 The content shown can be derived from Figure 1 The management node 110 in the system executes the commands; this management node 110 can also be referred to as a cloud computing platform. For example... Figure 2 As shown, the multiple application instances configured in the first resource pool 120 include a first application instance and a second application instance. The instance scheduling method provided in this application may include the following steps S210-S250.
[0104] S210 and management node 110 obtain application instance information input by the tenant.
[0105] In one possible scenario, the application instance information includes: identification information of the application instance in the first resource pool, which is used to indicate whether the application instance is allowed to be scheduled to the second resource pool.
[0106] In one possible example, if the application instance's identification information is a first value, then the application instance is not allowed to be scheduled to the second resource pool. If the application instance's identification information is a second value, then the application instance is allowed to be scheduled to the second resource pool.
[0107] For example, if the identifier information of the first application instance is 0, the first application instance is not allowed to be scheduled to the second resource pool; if the identifier information of the second application instance is 1, the second application instance is allowed to be scheduled to the second resource pool.
[0108] It is worth noting that the first value of 0 and the second value of 1 in the above examples are merely examples and should not be construed as limiting this application. In other examples of this application, the first and second values can be any numerical values.
[0109] In another possible example, if the identification information of an application instance has two characters, if the first character is a third value, then the application instance is allowed to be scheduled from the first resource pool to the second resource pool; if the second character is a fourth value, then the application instance is allowed to be scheduled from the second resource pool to the first resource pool.
[0110] For example, if the identifier of the first application instance is 00, then the first application instance is not allowed to be scheduled from the first resource pool to the second resource pool, nor is it allowed to be scheduled from the second resource pool to the first resource pool. If the identifier of the second application instance is 11, then the second application instance is allowed to be scheduled from the first resource pool to the second resource pool, and also allowed to be scheduled from the second resource pool to the first resource pool.
[0111] In one possible implementation, the management node 110 obtains the application instance information input by the tenant, including: the management node 110 obtains the application instance information input by the tenant based on the application programming interface (API) provided to the outside world.
[0112] In one possible example, the tenant accesses the management node 110 via the API provided by the management node 110 on the terminal 140. That is, the configuration interface provided by the management node 110 is displayed on the terminal 140 (which is a display interface provided by the cloud management platform to the outside world). Then, the tenant can input application instance information on the configuration interface, and the management node 110 obtains the application instance information input by the tenant.
[0113] S220 and management node 110 record the first application instance as an application instance that is not allowed to be migrated to the second resource pool, and record the second application instance as an application instance that is allowed to be migrated to the second resource pool, based on the application instance information.
[0114] The first application instance uses the first hardware resources of the first server cluster, and the second application instance uses the second hardware resources of the first server cluster.
[0115] For details regarding the first and second hardware resources, please refer to the description of the first hardware resource below, which will not be repeated here.
[0116] In one possible implementation, the management node 110 records the first application instance as an application instance that is not allowed to be migrated to the second resource pool, and records the second application instance as an application instance that is allowed to be migrated to the second resource pool, based on the application instance information. This includes: the management node 110 records the above application instance information in ETCD, thereby marking the first application instance as an application instance that is not allowed to be migrated to the second resource pool, and marking the second application instance as an application instance that is allowed to be migrated to the second resource pool.
[0117] ETCD manages application instance configuration information (such as name, tags, annotations, and other metadata), status information (such as running status, ready status, number of restarts, etc.), logs, etc.
[0118] In one possible example, the first field in the ETCD-managed configuration information indicates whether the application instance is allowed to migrate to the second resource pool; that is, the first field represents the aforementioned identification information. If the first field has the first value, the application instance is not allowed to migrate to the second resource pool; if the first field has the second value, the application instance is allowed to migrate to the second resource pool.
[0119] For example, if the identification information of the first application instance in the application instance information is 0, then the management node 110 sets the value of the first field in the configuration information corresponding to the first application instance in the ETCD to 0, indicating that the first application instance is an application instance that is not allowed to be migrated to the second resource pool. If the identification information of the second application instance in the application instance information is 1, then the management node 110 sets the value of the first field in the configuration information corresponding to the second application instance in the ETCD to 1, indicating that the second application instance is an application instance that is allowed to be migrated to the second resource pool.
[0120] In another possible example, the second field in the ETCD-managed configuration information is used to indicate whether the application instance is allowed to migrate to the second resource pool; that is, the first field is used to represent the aforementioned identification information. If the first character in the first field is the third value, the application instance is allowed to migrate from the first resource pool to the second resource pool; if the second character in the first field is the second value, the application instance is allowed to migrate from the second resource pool to the first resource pool.
[0121] For example, if the application instance information includes the identifier information of the first application instance as 00, then the management node 110 sets the value of the second field in the configuration information corresponding to the first application instance in the ETCD to 00, indicating that the first application instance is an application instance that is neither allowed to migrate from the first resource pool to the second resource pool nor from the second resource pool to the first resource pool. If the application instance information includes the identifier information of the second application instance as 11, then the management node 110 sets the value of the first field in the configuration information corresponding to the second application instance in the ETCD to 11, indicating that the second application instance is an application instance that is allowed to migrate from the first resource pool to the second resource pool and from the second resource pool to the first resource pool.
[0122] It is worth noting that the application instance information also includes the application instance's identification information, which is 10 or 01. When the identification information is 10, it means that the application instance is allowed to migrate from the first resource pool to the second resource pool, but is not allowed to migrate from the second resource pool to the first resource pool. When the identification information is 01, it means that the application instance is not allowed to migrate from the first resource pool to the second resource pool, but is allowed to migrate from the second resource pool to the first resource pool.
[0123] S230, Management Node 110 obtains the application instance creation request input by the tenant.
[0124] The above application instance creation request is used to request the creation of a third application instance with predetermined hardware resource requirements in the first resource pool.
[0125] In one possible scenario, a predetermined amount of hardware resources (a pre-defined hardware resource requirement) is reserved in the first resource pool to provide hardware resource support for newly created application samples. The size of this pre-defined hardware resource can be configured by the tenant.
[0126] For example, the first resource pool reserves 5 processors, 50GB of storage space, and 100 gigabits per second (Gbps). The application instance creation request described above is used to request the creation of an application instance that utilizes the aforementioned predetermined hardware resource requirements.
[0127] In one possible implementation, the management node 110 obtains the application instance creation request input by the tenant, including: the management node 110 obtains the application instance creation request based on the API provided to the outside world.
[0128] In one possible example, the tenant accesses the management node 110 via the API provided by the management node 110 on the terminal 140. That is, the application instance creation interface provided by the management node 110 is displayed on the terminal 140 (which is a display interface provided by the cloud management platform). The tenant can then set the parameters of the application instance on the application instance creation interface, generate an application instance creation request based on the application instance parameters, and send it to the management node 110. The management node 110 then receives the application instance creation request.
[0129] The parameters mentioned above may include: Image and Version: Specify the image used to deploy the application instance, as well as the image version or tag; Application Instance Specifications: Such as the type of virtual machine, hardware resource configuration, or the resource limits of the container instance (the size of the required hardware resources); Network and Security Settings: Configure network access rules, security group policies, etc.; Storage Volume Mount: If the application instance requires persistent storage, you can configure the mounting and capacity of the storage volume; Environment Variables and Configuration Parameters: Set the environment variables and configuration parameters required by the application, such as database connection information; Log Query and Log Settings: Configure alarm rules and log collection settings for easy management and troubleshooting.
[0130] In another possible example, the tenant writes a YAML configuration file for the application instance and then sends an application instance creation request carrying the YAML configuration file to the management node 110.
[0131] The configuration file may include the contents of the above parameters, which will not be elaborated here.
[0132] For example, management node 110 can obtain application instance creation requests input by tenants through the apiserver deployed on it.
[0133] It is worth noting that the hardware resources required by the application instance defined in the above parameters should match the reserved hardware resource requirements in the first resource pool, or the hardware resources required by the application instance defined in the above parameters should be less than or equal to the reserved hardware resource requirements in the first resource pool.
[0134] S240 and management node 110 create a third application instance in the first resource pool based on the application instance creation request.
[0135] The third application instance uses the third hardware resources of the first server cluster, and the third hardware resources match the predetermined hardware resource requirements.
[0136] The content of the third hardware resource can be referred to the description of the first hardware resource below, and will not be repeated here.
[0137] In one possible implementation, the management node 110 creates a third application instance in the first resource pool according to the application instance creation request, including: the management node 110 creates a third application instance in the first resource pool that meets the parameter requirements according to the parameters in the application instance creation request.
[0138] For details on this implementation method, please refer to the technical means of creating application instances in this field, which will not be elaborated here.
[0139] In one possible scenario, the third application instance uses the reserved hardware resources of the first server cluster.
[0140] In one possible example, the aforementioned third hardware resource is less than or equal to the predetermined hardware resource requirement.
[0141] S250 and management node 110 obtain the resource usage of the first resource pool.
[0142] The resource usage figures mentioned above are used to indicate the total hardware resource usage of the first server cluster.
[0143] In one possible scenario, the total hardware resource usage of the aforementioned first server cluster includes the total usage of one or more of the following: computing resources, storage resources, and network resources.
[0144] For details on the overall hardware resource usage of the first server cluster, please refer to the following embodiment, which will not be repeated here.
[0145] In one possible implementation, the management node 110 obtains the resource usage of the first resource pool by: obtaining the resource usage of each worker node in the first server cluster and then obtaining the resource usage of the first resource pool based on the resource usage sent by each worker node.
[0146] In one possible example, the management node 110 receives the resource usage data sent by each worker node at each preset time, and then obtains the resource usage data of the first resource pool 120 based on the resource usage data of each worker node.
[0147] Taking hardware resources, including computing resources, and the first server cluster comprising worker nodes 121 and 122 as an example, worker node 121 sends the number of processors used (1) to management node 110 every preset time interval, and worker node 122 sends the number of processors used (2) to management node 110 every preset time interval. Then, management node 110, based on the aforementioned number of processors, calculates the resource usage of the first resource pool 120 as the sum of the number of processors used (1) and the number of processors used (2).
[0148] For example, the aforementioned preset time can be configured by the tenant, such as 1 minute or 20 seconds, and this application does not limit it in this way.
[0149] It is worth noting that if the preset time is short enough, the management node 110 can obtain the resource usage of the first resource pool in real time.
[0150] In one possible implementation, the management node 110 obtains the resource usage of the first resource pool by: after a worker node collects its own resource usage, it can store it in a designated area of the worker node; the management node 110 obtains the resource usage of the worker node from the designated area of the worker node every preset time, thereby obtaining the resource usage of the first resource pool 120 based on the resource usage of each worker node.
[0151] For example, the designated area may be a local storage area of the worker node, or the designated area may be a centralized storage area in the first server cluster.
[0152] In one possible example, management node 110 can obtain the resource usage of the first resource pool through the apiserver deployed on it.
[0153] S260, if the resource usage is greater than or equal to the first preset value, the management node 110 will migrate the second application instance from the first resource pool to the second resource pool.
[0154] The second application instance uses the fourth hardware resource of the second server cluster, and the fourth hardware resource is consistent with the second hardware resource.
[0155] The content of the fourth hardware resource can be referred to the description of the first hardware resource below, and will not be repeated here.
[0156] In one possible implementation, when the resource usage is greater than or equal to a first preset value, the management node 110 migrates the second application instance from the first resource pool to the second resource pool, including: the management node 110 determines the relationship between the resource usage of the first resource pool and the first preset value; if the resource usage is greater than or equal to the first preset value, the management node 110 migrates the second application instance from the first resource pool to the second resource pool.
[0157] In one possible example, if the resource usage is greater than or equal to the first preset value, the management node 110 obtains the first processing strategy from multiple processing strategies based on the first relationship between the resource usage and the first preset value (the resource usage is greater than or equal to the first preset value), and then executes the processing strategy to migrate the second application instance from the first resource pool to the second resource pool.
[0158] The first processing strategy mentioned above is used to instruct that when the resource usage is greater than or equal to a first preset value, the management node 110 should migrate the application instances in the first resource pool that are allowed to be migrated to the second resource pool to the second resource pool.
[0159] For example, management node 110 determines the first processing strategy corresponding to the first relationship from the mapping relationship between the above relationships and processing strategies.
[0160] For example, management node 110 executes a first processing strategy represented by a YAML file to migrate a second application instance from a first resource pool to a second resource pool.
[0161] It is worth noting that the above description uses only the second application instance in the first resource pool as an example and should not be construed as limiting this application. In practice, a large number of application instances can be deployed in the first resource pool, and the management node 110 can migrate multiple application instances from the first resource pool to the second resource pool.
[0162] In one possible scenario, after management node 110 schedules the second application instance in the first resource pool to the second resource pool, if the resource usage of the first resource pool is still greater than or equal to the first preset value, then management node 110 determines the first processing strategy corresponding to the first relationship from the mapping relationship between the above relationship and processing strategy, and schedules the application instance in the first resource pool to the second resource pool until the resource usage of the first resource pool after scheduling is less than the first preset value.
[0163] Regarding the hardware resources mentioned above, five possible scenarios are provided below.
[0164] In the first possible scenario, hardware resources include computing resources, storage resources, and network resources.
[0165] In one possible example, computing resources refer to various types of processors in the first server cluster, such as a central processing unit (CPU), specific integrated circuits, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. In practical applications, the computing resources of the first server cluster may also include multiple processors. A processor may include one or more processor cores.
[0166] Storage resources refer to various types of memory in the first server cluster, such as dynamic random access memory (DRAM). Besides DRAM, other random access memories can also be used, such as static random access memory (SRAM). Additionally, storage resources can also include read-only memory (ROM). For example, read-only memory can be programmable read-only memory (PROM) or erasable programmable read-only memory (EPROM).
[0167] For example, the first hardware resources mentioned above may include two processors, 50G of storage space, and 100Gbps in the first server cluster.
[0168] Network resources are used to indicate the network bandwidth, network latency, etc. of the first server cluster.
[0169] In the second possible scenario, hardware resources include computing resources and network resources.
[0170] In the third possible scenario, hardware resources include computing resources and storage resources.
[0171] In the fourth possible scenario, hardware resources include network resources and storage resources.
[0172] In the fifth possible scenario, hardware resources include any one of computing resources, storage resources, and network resources.
[0173] Furthermore, regarding the overall usage of hardware resources for the aforementioned first server cluster, five possible scenarios are provided below.
[0174] In the first possible scenario, the total hardware resource usage of the first server cluster includes the total usage of computing resources, storage resources, and network resources.
[0175] In one possible example, the total usage of the aforementioned computing resources could be the number of processors or processor cores used in the first server cluster, or the processor utilization rate or occupancy rate. The total usage of the aforementioned storage resources could be the storage capacity occupied in the first server cluster, or the storage utilization rate or occupancy rate. The total usage of the aforementioned network resources could be the network bandwidth used / occupied in the first server cluster, or the network bandwidth utilization rate or occupancy rate.
[0176] For example, such as Figure 1 As shown, the first server cluster includes worker nodes 121, 122, and 123. Each worker node 121, 122, and 123 includes a processor, memory, and a network interface. The network interface supports up to Gigabit Ethernet and 10 Gigabit Ethernet.
[0177] For example, the total computing resource usage of the first server cluster is the sum of the number of processors used by worker node 121, worker node 122, and worker node 123. The total storage resource usage of the first server cluster is the sum of the storage capacity occupied by worker node 121, worker node 122, and worker node 123. The total network resource usage of the first server cluster is the sum of the network bandwidth occupied by worker node 121, worker node 122, and worker node 123.
[0178] In the second possible scenario, the total hardware resource usage of the first server cluster includes the total usage of computing resources and storage resources.
[0179] In the third possible scenario, the total hardware resource usage of the first server cluster includes the total usage of computing resources and network resources.
[0180] In the fourth possible scenario, the total hardware resource usage of the first server cluster includes: the total usage of storage resources and network resources.
[0181] In the fifth possible scenario, the total hardware resource usage of the first server cluster includes the total usage of any one of computing resources, storage resources, and network resources.
[0182] In one possible embodiment, a fourth application instance is further configured in the first resource pool, which uses the fifth hardware resource of the first server cluster. The above instance scheduling method further includes: the management node 110 records that the fourth application instance and the second application instance belong to the same group according to the grouping information input by the tenant, and then migrates the second application instance and the fourth application instance belonging to the same group from the first resource pool to the second resource pool.
[0183] The second application instance uses the sixth hardware resource of the second server cluster, and the sixth hardware resource is identical to the fifth hardware resource.
[0184] The descriptions of the fifth and sixth hardware resources can be found in the content of the first hardware resource mentioned above, and will not be repeated here.
[0185] In one possible scenario, the grouping information includes the group identifier of the application instance, and application instances with the same group identifier belong to the same group.
[0186] In one possible example, the grouping information includes: group identifier for application instance A: 1, group identifier for application instance B: 1, and group identifier for application instance C: 2. That is, application instance A and application instance B belong to the same group.
[0187] In one possible implementation, the management node 110 records that the fourth application instance and the second application instance belong to the same group based on the grouping information input by the tenant. This includes: the management node 110 records the above grouping information into ETCD, thereby marking the fourth application instance and the second application instance as belonging to the same group.
[0188] In one possible example, the configuration information managed by ETCD has a third field. The value of this third field indicates a group identifier, and application instances with the same group identifier belong to the same group. Management node 110 assigns a value to the third field in the configuration information of the corresponding application instance in ETCD based on the group information, thereby recording the grouping status of the application instances.
[0189] For example, when the grouping information includes: group identifier of application instance A: 1, group identifier of application instance B: 1, and group identifier of application instance C: 2, the management node 110 assigns the value 1 to the third field in the configuration information of application instance A in ETCD, assigns the value 1 to the third field in the configuration information of application instance B, and assigns the value 2 to the third field in the configuration information of application instance C.
[0190] In one possible implementation, the management node 110 migrates the second application instance from the first resource pool to the second resource pool, including: before migrating the second application instance, the management node 110 queries the ETCD for application instances with the same group identifier as the second application instance to obtain the fourth application instance, and then the management node 110 migrates the second application instance and the fourth application instance belonging to the same group from the first resource pool to the second resource pool.
[0191] In one possible example, management node 110 queries the ETCD for application instances that have the same group identifier as the second application instance. This includes: management node 110 traversing the third field of the configuration information of all application instances in the first resource pool stored in the ETCD, and determining the application instance that has the same value in the third field as the second application instance, such as the fourth application instance mentioned above.
[0192] In one possible embodiment, the above-mentioned multiple application instances further include a fifth application instance. For the content of this embodiment, please refer to... Figure 3 The content shown, Figure 3 Flowchart of the instance scheduling method provided in this application Figure 2 . Figure 3 The content shown includes the following steps S310-S340.
[0193] S310, Management Node 110 obtains the application instance cancellation request for the fifth application instance input by the tenant.
[0194] In one possible implementation, management node 110 obtains an application instance cancellation request for the fifth application instance input by the tenant, including:
[0195] Management node 110 receives an application instance cancellation request for the fifth application instance sent by tenant terminal 140.
[0196] For example, the application instance cancellation request could carry the command `kubectl delete pods -l app=my-app`. Here, `app=my-app` represents the label or name of the fifth application instance, and `pods -l app=my-app` represents the Pod belonging to the fifth application instance.
[0197] In one possible implementation, the management node 110 obtains the application instance cancellation request for the fifth application instance input by the tenant, including: the management node 110 obtains the application instance cancellation request input by the tenant based on the externally provided API.
[0198] In one possible example, the tenant accesses the management node 110 via the API provided by the management node 110 on the terminal 140. That is, the deletion interface provided by the management node is displayed on the terminal 140 (which is a display interface provided by the cloud management platform). The tenant can then select the application instance to be taken offline (such as the fifth application instance) on the deletion interface. The application instance cancellation request sent by the terminal 140 to the management node 110 carries the information of the application instance to be taken offline.
[0199] S320 and management node 110 cancel the application instance request, stop running the fifth application instance in the first resource pool, and release the seventh hardware resources occupied by the fifth application instance in the first resource pool.
[0200] In one possible implementation, management node 110, based on the application instance cancellation request, stops the fifth application instance from running in the first resource pool and releases the seventh hardware resources occupied by the fifth application instance in the first resource pool. This includes: management node 110 executing the instruction `kubectl delete pods -l app=my-app` carried in the application instance cancellation request to delete the Pods included in the fifth application instance. Furthermore, after confirming that all Pods included in the fifth application instance have been deleted, management node 110 releases the seventh hardware resources occupied by the fifth application instance in the first resource pool.
[0201] In one possible implementation, management node 110, based on the application instance cancellation request, stops the fifth application instance from running in the first resource pool and releases the seventh hardware resources occupied by the fifth application instance in the first resource pool. This includes: management node 110 determining the Pods included in the fifth application instance based on the information of the fifth application instance carried in the application instance cancellation request, and then deleting the Pods included in the fifth application instance. After all the Pods included in the fifth application instance are deleted, management node 110 releases the seventh hardware resources occupied by the fifth application instance in the first resource pool.
[0202] In one possible implementation, the management node 110 can determine the Pods included in the fifth application instance by using the command kubectl getpods -l app=my-app. The information of the fifth application instance includes the label or name of the fifth application instance, i.e., the aforementioned app=my-app.
[0203] S330 and management node 110 obtain the available resources in the first resource pool.
[0204] The above-mentioned resource availability is used to indicate the total amount of hardware resources available in the first server cluster.
[0205] In one possible scenario, the total amount of free hardware resources in the aforementioned first server cluster includes the total amount of free computing resources, storage resources, and network resources.
[0206] In one possible implementation, the management node 110 obtains the available resources of the first resource pool by subtracting the resource usage of the first resource pool from the total amount of hardware resources available to the management node 110 in the first server cluster.
[0207] In one possible implementation, the management node 110 obtains the available resources of the first resource pool by: obtaining the available resources of each worker node in the first server cluster, and then obtaining the available resources of the first resource pool based on the available resources of each worker node.
[0208] In one possible implementation, the management node 110 obtains the resource availability of the first resource pool by: after a worker node collects its own resource availability, it can store it in a designated area of the worker node; the management node 110 obtains the resource availability of the worker node from the designated area of the worker node at preset intervals, thereby obtaining the resource availability of the first resource pool 120 based on the resource availability of each worker node.
[0209] For example, management node 110 adds up the available resources sent by each worker node to obtain the available resources of the first resource pool.
[0210] For a detailed description of the amount of available resources in the first resource pool obtained by the management node 110, please refer to the description of the amount of resources used by the management node 110 in the first resource pool in S250 above, which will not be repeated here.
[0211] S340, if the amount of idle resources is greater than or equal to the second preset value, the management node 110 will schedule the second application instance from the second resource pool to the first resource pool.
[0212] In one possible implementation, when the amount of idle resources is greater than or equal to a second preset value, the management node 110 migrates the second application instance from the second resource pool to the first resource pool. This includes: the management node 110 determines the relationship between the amount of idle resources in the first resource pool and the second preset value. If the amount of idle resources is greater than or equal to the second preset value, the management node 110 migrates the second application instance from the second resource pool to the first resource pool.
[0213] In one possible example, if the amount of idle resources is greater than or equal to a second preset value, the management node 110 obtains a second processing strategy from multiple processing strategies based on the second relationship between the amount of idle resources and the second preset value (the amount of idle resources is greater than or equal to the second preset value), and then executes the second processing strategy to migrate the second application instance from the second resource pool to the first resource pool.
[0214] The second processing strategy described above is used to instruct that when the amount of idle resources is greater than or equal to a second preset value, the management node 110 is instructed to migrate application instances in the second resource pool that are allowed to be migrated to the second resource pool to the first resource pool.
[0215] For example, management node 110 determines the second processing strategy corresponding to the second relationship from the mapping relationship between the above relationships and processing strategies.
[0216] For example, management node 110 executes a second processing strategy represented by a YAML file to migrate a second application instance in a second resource pool to a first resource pool.
[0217] It is worth noting that the above description uses only the second application instance as an example and should not be construed as limiting this application. In practice, a large number of application instances can be deployed in the second resource pool, and the management node 110 can migrate multiple application instances from the second resource pool to the first resource pool.
[0218] In one possible embodiment, the first application instance described above includes M containers running in a first server cluster, where M is a positive integer. For details of this embodiment, please refer to... Figure 4 The content shown, Figure 4 Flowchart of the instance scheduling method provided in this application Figure 3 . Figure 4 The content shown includes the following steps S410-S430.
[0219] S410 and management node 110 confirm that the number of M containers in the first application instance has been reduced to N containers.
[0220] Where N is less than M, and M and N are positive integers.
[0221] The following explanation uses the example of a first application instance containing Pods. Management node 110 periodically retrieves a list of all Pods included in the first application instance. This list shows the number of containers included in a single Pod. Management node 110 determines whether the number of containers included in the first application instance has decreased by comparing the Pod lists retrieved at two adjacent time points.
[0222] For example, if the first application instance includes only one Pod, the management node 110 obtains a list 1 of the Pods at the previous time point (including 5 containers) and a list 2 of the Pods at the next time point (including 3 containers) between two adjacent time points, and then determines that the first application instance is scaled down from 5 containers to 3 containers.
[0223] It is worth noting that the above example comparing lists of Pods at two adjacent time points should not be construed as limiting this application. In other scenarios of this application, the two lists compared by the management node 110 can be two lists obtained at any time point. For example, the management node 110 obtains list 1 of Pods at a first time point and list 2 of Pods at a second time point, with one or more time intervals between the first and second time points.
[0224] S420 and management node 110 obtain the available resources in the first resource pool.
[0225] The above-mentioned resource availability is used to indicate the total amount of hardware resources available in the first server cluster.
[0226] For details on S420, please refer to the description of S330 above, which will not be repeated here.
[0227] S430, if the amount of idle resources is greater than or equal to the second preset value, the management node 110 will migrate the second application instance from the second resource pool to the first resource pool.
[0228] For details on S430, please refer to the description of S340 above, which will not be repeated here.
[0229] In one possible embodiment, the management node obtains the processing policy configured by the tenant. This processing policy is used to instruct the application instance to be migrated between the first resource pool and the second resource pool when preset conditions are met.
[0230] In one possible example, the processing strategy includes the first processing strategy and the second processing strategy described above.
[0231] In another possible example, the above processing strategy may further include a third processing strategy. The third processing strategy is used to instruct the first resource pool to support predetermined hardware resources, and when the amount of idle resources is less than or equal to the predetermined hardware resource requirement, or when the amount of resource usage is greater than or equal to a first preset value, instruct the management node 110 to migrate the application instances in the first resource pool to the second resource pool.
[0232] In yet another possible example, the above processing strategy may further include a fourth processing strategy. The fourth processing strategy is used to indicate that multiple application instances belonging to the same group are simultaneously located in either the first resource pool 120 or the second resource pool 130.
[0233] For example, when management node 110 migrates the second application instance from the first resource pool to the second resource pool, it should also migrate the fourth application instance, which belongs to the same group as the second application instance, from the first resource pool to the second resource pool.
[0234] It is worth noting that the above processing strategies are merely examples and should not be construed as limiting this application. Other embodiments of this application may include more or fewer processing strategies. For example, the above processing strategies may further include a fifth processing strategy, which instructs application instances with high latency requirements to be deployed to worker nodes with higher node performance.
[0235] In one possible scenario, management node 110 manages the aforementioned processing policies through an elastic policy configurator (also known as an elastic policy configuration module).
[0236] For example, management node 110 retrieves the corresponding processing policy from the Elastic Policy Configurator before each application instance migration.
[0237] For example, management node 110 determines the processing strategy corresponding to the target relationship (such as resource usage being greater than or equal to a first preset value, or resource idleness being greater than or equal to a second threshold) based on the mapping relationship between resource usage and processing strategy, or the mapping relationship between resource idleness and processing strategy, and then executes the corresponding strategy.
[0238] For example, the third processing strategy mentioned above is a continuous strategy, that is, the management node 110 will execute the third processing strategy every preset time or every time a migration is performed.
[0239] For example, the fourth processing strategy mentioned above is a persistent strategy. That is, every time a migration is performed, the management node 110 will execute the fourth processing strategy to migrate application instances belonging to the same group together. This avoids different application instances in the same group (elastic resource group) being located in different resource pools, which would result in high communication latency between application instances, thereby reducing the latency of the same elastic resource group providing services to the outside world.
[0240] In one possible scenario, the above processing strategy could be a configuration file, which could be in the form of a YAML file.
[0241] It is worth noting that the above processing strategy is presented in the form of a YAML file, which is only a possible scenario provided in this application and should not be construed as a limitation of this application. In other possible scenarios of this application, the processing strategy may also be presented in JSON (javascript object notation) format, INI (initialization) format, Properties file, etc.
[0242] In one possible implementation, the management node 110 obtains the processing strategy configured by the tenant, including: the management node 110 obtains the processing strategy input by the tenant.
[0243] In one possible example, the tenant accesses the configuration interface provided by the management node 110 via the API provided by the management node 110 on the terminal 140, and then the tenant inputs the processing policy on the configuration interface, so that the management node 110 obtains the processing policy input by the tenant.
[0244] In one possible implementation, the management node 110 stores processing policies, and the management node 110 obtains the processing policies configured by the tenant, including: the management node 110 obtains the pre-configured processing policies of the tenant from the storage.
[0245] In one possible example, management node 110 can access processing strategies stored in memory, which may be built into or external to management node 110.
[0246] If the aforementioned memory is built into the management node 110, the memory may be a read-only memory or the like.
[0247] If the aforementioned storage is external to the management node 110, the storage can be a read-only storage in other nodes (worker nodes or other management nodes), or a storage service deployed on the worker node.
[0248] In one possible embodiment, the management node 110 migrates the second application instance from the first resource pool to the second resource pool, including: the management node 110 creating a copy of the second application instance in the second resource pool. If the copy of the second application instance meets the operating conditions, the management node 110 sends a first instruction to the first resource pool to instruct the second application instance to be taken offline, and sends a second instruction to the second resource pool to run the copy of the second application instance.
[0249] The following explanation uses the application instance as a Pod as an example. The creation of a replica of the second application instance in the second resource pool by management node 110 includes:
[0250] Management node 110 copies the configuration of Pod 1 (the second application instance) from the first resource pool and saves it as a YAML file. Then, management node 110 adjusts the Pod's name, tag, and resource pool affiliation in the YAML file to prevent conflicts with existing Pods. Finally, management node 110 executes the adjusted YAML to create a copy of Pod 1 in the second resource pool.
[0251] For example, management node 110 sets metadata.name in the YAML file to pod1-copy to ensure that it is different from the name of Pod1 in the first resource pool, sets metadata.namespace to namespace2, which is the namespace of the second resource pool, and sets the container image and other configuration information in spec.containers.
[0252] In one possible scenario, management node 110 receives a query request from the kubelet on the second resource pool. This query request retrieves information about the Pods that need to be created on the second resource pool. In response to the query request, management node 110 retrieves the latest Pod definition from etcd and returns the aforementioned Pod definition to the kubelet, which includes the adjusted YAML file described above. The kubelet executes the adjusted YAML file to create a copy of the second application instance in the second resource pool.
[0253] In one possible example, if a replica of the second application instance meets the operating conditions, then management node 110 sends an instruction to the first resource pool to instruct the second application instance to be taken offline, and sends a second instruction to the second resource pool to run a replica of the second application instance, including:
[0254] Once management node 110 ensures that the replica of the second application instance in the second resource pool has been successfully created and configured, it sends an instruction to the first resource pool to take the second application instance offline, such as `kubectcl delete pod`. <pod1>And send a second instruction to the second resource pool to run a replica of the second application instance, such as the management node 110 sending an instruction to the kubelet deployed in the second resource pool to start a replica of the second application instance.
[0255] For example, the etcd record in management node 110 has a fourth field. If the fourth field has a fifth value (e.g., ready), then the replica of the second application instance meets the running conditions. Otherwise, the replica of the second application instance does not meet the running conditions.
[0256] In one possible scenario, after management node 110 ensures that the replica of the second application instance in the second resource pool has been created and configured normally, management node 110 updates the Pod image to 0 through the controller, thereby automatically deleting the second application instance.
[0257] The controller mentioned above can be a Deployment controller.
[0258] In one possible scenario, the kubelet in the second resource pool executes a modified YAML file to create a replica of the second application instance in the second resource pool. After creation, the kubelet can directly run the replica of the second application instance. After the kubelet runs the replica of the second application instance, it sends a status update message (indicating that the replica of the second application instance is running normally) to the kube-apiserver in management node 110. The kube-apiserver then updates the status. Based on the normal operation of the replica of the second application instance, the kube-apiserver in management node 110 sends an instruction to the kubelet in the first resource pool to take the second application instance offline.
[0259] It is understood that, in order to achieve the functions in the above embodiments, the management node 110 includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and method steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0260] The above text combines Figures 2 to 4 The application describes in detail the instance scheduling method provided in this application. The following will combine... Figure 5 , Figure 5 A schematic diagram of the structure of an instance scheduling device provided in this application Figure 1 This application describes an instance scheduling apparatus provided. The instance scheduling apparatus 500 can be used to implement the functions of the management node 110 in the above method embodiments, and therefore can also achieve the beneficial effects of the above method embodiments. In one possible example, the instance scheduling apparatus is applied to a cloud management platform, which manages a first resource pool and a second resource pool. The first resource pool includes a first server cluster, and the second resource pool includes a second server cluster. Multiple application instances are configured in the first resource pool, including both the first application instance and the second application instance.
[0261] like Figure 5 As shown, the instance scheduling device 500 includes a first configuration module 510, a first acquisition module 520, a creation module 530, a second acquisition module 540, and a migration module 550. The instance scheduling device 500 is used to implement the above-mentioned... Figures 2 to 4 The corresponding method embodiment describes the function of the management node 110. In one possible example, the instance scheduling device 500 implements the above-described instance scheduling method through the following specific processes:
[0262] The first configuration module 510 is used to record, based on the application instance information input by the tenant, the first application instance as an application instance that is not allowed to migrate to the second resource pool, and the second application instance as an application instance that is allowed to migrate to the second resource pool, wherein the first application instance uses the first hardware resources of the first server cluster, and the second application instance uses the second hardware resources of the first server cluster.
[0263] The first acquisition module 520 acquires the application instance creation request input by the tenant. The application instance creation request is used to request the creation of a third application instance with predetermined hardware resource requirements in the first resource pool.
[0264] Create module 530 to create a third application instance in the first resource pool based on the application instance creation request. The third application instance uses the third hardware resources of the first server cluster, and the third hardware resources match the predetermined hardware resource requirements.
[0265] The second acquisition module 540 acquires the resource usage of the first resource pool, which is used to indicate the total hardware resource usage of the first server cluster.
[0266] The migration module 550 is used to migrate a second application instance from a first resource pool to a second resource pool when the resource usage is greater than or equal to a first preset value. The second application instance uses the fourth hardware resource of the second server cluster, and the fourth hardware resource is consistent with the second hardware resource.
[0267] To further achieve the above Figures 2 to 4 The method embodiments shown in the illustration demonstrate functionality. This application also provides an instance scheduling apparatus, such as... Figure 6 As shown, Figure 6 A schematic diagram of the structure of an instance scheduling device provided in this application Figure 2 The instance scheduling device 500 also includes: a second configuration module 560, a cancellation module 570, and a reduction module 580.
[0268] The second configuration module 560 is used to record, based on the grouping information input by the tenant, that the fourth application instance and the second application instance belong to the same group; the fourth application instance is set in the first resource pool, and the fourth application instance uses the fifth hardware resource of the first server cluster.
[0269] The cancellation module 570 is used to obtain an application instance cancellation request for the fifth application instance input by the tenant; based on the application instance cancellation request, it stops running the fifth application instance in the first resource pool and releases the seventh hardware resource occupied by the fifth application instance in the first resource pool. It also obtains the resource idle amount in the first resource pool, and if the resource idle amount is greater than or equal to a second preset value, it migrates the second application instance from the second resource pool to the first resource pool. The resource idle amount indicates the total idle amount of hardware resources in the first server cluster, and the multiple application instances include the fifth application instance.
[0270] The scaling-down module 580 is used to confirm that the number of M containers in the first application instance is scaled down to N containers, and to obtain the amount of available resources in the first resource pool. If the amount of available resources is greater than or equal to a second preset value, the second application instance is migrated from the second resource pool to the first resource pool. Here, N is less than M, N is a positive integer, the amount of available resources indicates the total amount of available hardware resources in the first server cluster, and the first application instance includes M containers running in the first server cluster, where M is a positive integer.
[0271] For more information on the functions of the first configuration module 510, the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550, please refer to the description of the instance scheduling method above; they will not be repeated here.
[0272] The first configuration module 510, the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550 can all be implemented in software or in hardware. For example, the implementation of the first configuration module 510 will be described below. Similarly, the implementation of the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550 can refer to the implementation of the first configuration module 510.
[0273] As an example of a software functional unit, the first configuration module 510 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the aforementioned computing instance may be one or more. For example, the first configuration module 510 may include code running on multiple hosts / virtual machines / containers.
[0274] It should be noted that the multiple hosts / virtual machines / containers used to run this code can be distributed within the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run this code can be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region can include multiple AZs.
[0275] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0276] As an example of a hardware functional unit, the first configuration module 510 may include at least one computing device, such as a server. Alternatively, the first configuration module 510 may also be a device implemented using an ASIC or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), an FPGA, a generic array logic (GAL), or any combination thereof.
[0277] The multiple computing devices included in the first configuration module 510 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the first configuration module 510 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the first configuration module 510 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0278] It should be noted that, in other embodiments, the first configuration module 510, the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550 can all execute any step in the instance scheduling method. The steps implemented by the first configuration module 510, the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550 can be specified as needed. These modules respectively implement different steps in the instance scheduling method to achieve all the functions of the management node 110.
[0279] It is worth noting that the management node 110 in the aforementioned embodiment may correspond to the instance scheduling device 500, and may correspond to the execution of the method according to the embodiments of this application. Figures 2 to 4 The corresponding entities, and the operations and / or functions of each module in the instance scheduling device 500, are respectively implemented to achieve the following: Figures 2 to 4 The corresponding processes of each method in the corresponding embodiments are not described in detail here for the sake of brevity.
[0280] in addition, Figure 5 or Figure 6 The instance scheduling device 500 shown can also be implemented via a communication device, which can refer to the management node 110 in the aforementioned embodiment. When the communication device is a chip or chip system applied to a processing device, the instance scheduling device 500 can also be implemented via a chip or chip system.
[0281] This application embodiment also provides a chip system, which includes a control circuit and an interface circuit. The interface circuit is used to acquire access control policies and operation requests, and the control circuit is used to implement the functions of the management node 110 in the above method according to the acquired access control policies and operation requests.
[0282] In one possible design, the chip system also includes a memory for storing program instructions and / or data. This chip system can be composed of chips or may include chips and other discrete components.
[0283] This application also provides a computing device, please refer to... Figure 7 , Figure 7 This application provides a schematic diagram of the structure of a computing device. The computing device 700 includes a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, memory 706, and communication interface 708 are interconnected via the bus 702. The computing device 700 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 700. For example, the computing device 700 can be the aforementioned management node 110.
[0284] The 702 bus can be a PCIe bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 7 The bus 702 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 702 may include a path for transmitting information between various components of the computing device 700 (e.g., processor 704, memory 706, communication interface 708).
[0285] Processor 704 may include any one or more processors such as CPU, GPU, microprocessor (MP) or DSP.
[0286] The memory 706 may include volatile memory, such as random access memory (RAM). The processor 704 may also include non-volatile memory, such as ROM, flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0287] The memory 706 stores executable program code, which the processor 704 executes to implement the functions of the aforementioned first configuration module 510, first acquisition module 520, creation module 530, second acquisition module 540, and migration module 550, thereby implementing the instance scheduling method. In other words, the memory 706 stores instructions for executing the instance scheduling method.
[0288] The communication interface 708 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 700 and other devices or communication networks. The computing device 700 can be a computer (e.g., a server) in a cloud data center, a computer in an edge data center, or a terminal.
[0289] This application also provides a computing device cluster. The computing device cluster includes at least one computing device, which can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0290] like Figure 8 As shown, Figure 8 This application provides a schematic diagram of the structure of a computing device cluster. The computing device cluster includes at least one computing device 700. The memory 706 of one or more computing devices 700 in the computing device cluster may store the same instructions for executing instance scheduling methods.
[0291] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the instance scheduling method. In other words, a combination of one or more computing devices 700 can jointly execute the instructions for executing the instance scheduling method.
[0292] It should be noted that the memory 706 in different computing devices 700 within the computing device cluster can store different instructions, each used to execute a portion of the instance scheduling method's functions. That is, the instructions stored in the memory 706 of different computing devices 700 can implement the functions of one or more modules among the first configuration module 510, the first acquisition module 520, the creation module 530, the second acquisition module 540, and the migration module 550.
[0293] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN). Figure 9 One possible implementation is shown. For example... Figure 9 As shown, Figure 9 This application provides a schematic diagram of a connection between computing devices, where two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 706 in computing device 700A stores instructions for executing the functions of the first configuration module 510 and the first acquisition module 520. Simultaneously, the memory 706 in computing device 700B stores instructions for executing the functions of the creation module 530, the second acquisition module 540, and the migration module 550.
[0294] It should be understood that Figure 9 The functions of the computing device 700A shown can also be performed by multiple computing devices 700. Similarly, the functions of the computing device 700B can also be performed by multiple computing devices 700.
[0295] This application also provides a computer program product containing instructions. This computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any available medium. When the computer program product runs on at least one computing device, it causes the at least one computing device to execute the instance scheduling method described above.
[0296] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute an instance scheduling method.
[0297] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as an SSD.
[0298] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An instance scheduling method, characterized in that, The method is applied to a cloud management platform, which manages a first resource pool and a second resource pool. The first resource pool includes a first server cluster, and the second resource pool includes a second server cluster. Multiple application instances are configured in the first resource pool, including a first application instance and a second application instance. The method includes: Based on the application instance information input by the tenant, the first application instance is recorded as an application instance that is not allowed to be migrated to the second resource pool, and the second application instance is recorded as an application instance that is allowed to be migrated to the second resource pool. The first application instance uses the first hardware resources of the first server cluster, and the second application instance uses the second hardware resources of the first server cluster. Obtain the application instance creation request input by the tenant, the application instance creation request being used to request the creation of a third application instance with predetermined hardware resource requirements in the first resource pool; Based on the application instance creation request, the third application instance is created in the first resource pool. The third application instance uses the third hardware resource of the first server cluster, and the third hardware resource matches the predetermined hardware resource requirement. Obtain the resource usage of the first resource pool, wherein the resource usage is used to indicate the total hardware resource usage of the first server cluster; If the resource usage is greater than or equal to a first preset value, the second application instance is migrated from the first resource pool to the second resource pool, wherein the second application instance uses the fourth hardware resource of the second server cluster, and the fourth hardware resource is consistent with the second hardware resource.
2. The method according to claim 1, characterized in that, The first resource pool also includes a fourth application instance, which uses a fifth hardware resource of the first server cluster. The method further includes: According to the grouping information input by the tenant, the fourth application instance and the second application instance belong to the same group; Migrating the second application instance from the first resource pool to the second resource pool specifically includes: The second application instance and the fourth application instance are migrated from the first resource pool to the second resource pool, wherein the second application instance uses the sixth hardware resource of the second server cluster, and the sixth hardware resource is consistent with the fifth hardware resource.
3. The method according to claim 1 or 2, characterized in that, The plurality of application instances also includes a fifth application instance, and the method further includes: Obtain the application instance cancellation request for the fifth application instance input by the tenant; Based on the cancellation request of the application instance, the fifth application instance is stopped from running in the first resource pool, and the seventh hardware resource occupied by the fifth application instance in the first resource pool is released. Obtain the amount of available resources in the first resource pool, wherein the amount of available resources is used to indicate the total amount of available hardware resources in the first server cluster; If the amount of available resources is greater than or equal to a second preset value, the second application instance will be migrated from the second resource pool to the first resource pool.
4. The method according to claim 1 or 2, characterized in that, The first application instance includes M containers running in the first server cluster, where M is a positive integer. The method further includes: Confirm that the number of M containers in the first application instance is reduced to N containers, where N is less than M and N is a positive integer; Obtain the amount of available resources in the first resource pool, wherein the amount of available resources is used to indicate the total amount of available hardware resources in the first server cluster; If the amount of available resources is greater than or equal to a second preset value, the second application instance will be migrated from the second resource pool to the first resource pool.
5. The method according to any one of claims 1 to 4, characterized in that, The first resource pool is billed using a prepaid method, while the second resource pool is billed using a pay-as-you-go method.
6. The method according to any one of claims 1 to 5, characterized in that, The hardware resources of the first server cluster include one or any combination of computing resources, storage resources, and network resources.
7. An instance scheduling device, characterized in that, The device is applied to a cloud management platform, which manages a first resource pool and a second resource pool. The first resource pool includes a first server cluster, and the second resource pool includes a second server cluster. Multiple application instances are configured in the first resource pool, including a first application instance and a second application instance. The device includes: The first configuration module is used to record the first application instance as an application instance that is not allowed to be migrated to the second resource pool according to the application instance information input by the tenant, and to record the second application instance as an application instance that is allowed to be migrated to the second resource pool, wherein the first application instance uses the first hardware resources of the first server cluster, and the second application instance uses the second hardware resources of the first server cluster. The first acquisition module acquires the application instance creation request input by the tenant. The application instance creation request is used to request the creation of a third application instance with predetermined hardware resource requirements in the first resource pool. The creation module creates the third application instance in the first resource pool according to the application instance creation request. The third application instance uses the third hardware resources of the first server cluster, and the third hardware resources match the predetermined hardware resource requirements. The second acquisition module acquires the resource usage of the first resource pool, wherein the resource usage is used to indicate the total hardware resource usage of the first server cluster. The migration module is used to migrate the second application instance from the first resource pool to the second resource pool when the resource usage is greater than or equal to a first preset value, wherein the second application instance uses the fourth hardware resource of the second server cluster, and the fourth hardware resource is consistent with the second hardware resource.
8. The apparatus according to claim 7, characterized in that, The first resource pool also includes a fourth application instance, which uses the fifth hardware resource of the first server cluster. The device further includes: The second configuration module is used to record, based on the grouping information input by the tenant, that the fourth application instance and the second application instance belong to the same group; The migration module is specifically used to migrate the second application instance and the fourth application instance from the first resource pool to the second resource pool, wherein the second application instance uses the sixth hardware resource of the second server cluster, and the sixth hardware resource is consistent with the fifth hardware resource.
9. The apparatus according to claim 7 or 8, characterized in that, The plurality of application instances also includes a fifth application instance, and the device further includes: The cancellation module is configured to: acquire an application instance cancellation request input by the tenant for the fifth application instance; based on the application instance cancellation request, stop the fifth application instance from running in the first resource pool and release the seventh hardware resource occupied by the fifth application instance in the first resource pool; acquire the resource idle amount of the first resource pool; and, if the resource idle amount is greater than or equal to a second preset value, migrate the second application instance from the second resource pool to the first resource pool; wherein, the resource idle amount is used to indicate the total idle amount of hardware resources of the first server cluster.
10. The apparatus according to claim 7 or 8, characterized in that, The first application instance includes M containers running in the first server cluster, where M is a positive integer. The device further includes: The scaling-down module is used to confirm that the number of M containers of the first application instance is scaled down to N containers, and to obtain the amount of idle resources in the first resource pool. If the amount of idle resources is greater than or equal to a second preset value, the second application instance is migrated from the second resource pool to the first resource pool. Wherein, N is less than M, N is a positive integer, and the amount of idle resources is used to indicate the total amount of idle hardware resources of the first server cluster.
11. The apparatus according to any one of claims 7 to 10, characterized in that, The first resource pool is billed using a prepaid method, while the second resource pool is billed using a pay-as-you-go method.
12. The apparatus according to any one of claims 7 to 11, characterized in that, The hardware resources of the first server cluster include one or any combination of computing resources, storage resources, and network resources.
13. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that, The storage medium stores a computer program or instructions, which, when executed by a computing device, implement the method of any one of claims 1 to 6.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a computing device, the method of any one of claims 1 to 6 is implemented.