Container virtual machine resource management method and device and electronic equipment
By deploying container orchestration components and scheduling strategies on the computing power management platform, the problem of uneven resource adjustment of container virtual machines was solved, thereby improving the reliability and resource utilization of container virtual machines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TOWER CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-07-07
AI Technical Summary
Existing container virtual machines cannot adjust resources according to real-time operating conditions, resulting in uneven resource utilization in the computing cluster.
Deploy container orchestration components on the computing power management platform, configure scheduling weights through the control plane cluster and multiple computing power member clusters, obtain computing power resources and the number of container virtual machines in real time, generate scheduling policies, and adjust the deployment of container virtual machines to achieve resource balance.
It achieves the reliability and scalability of container virtual machines, improves the utilization of computing resources, and ensures the stable operation and balanced resource usage of computing clusters.
Smart Images

Figure CN115756740B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and specifically relates to a container virtual machine resource management method, apparatus, and electronic device. Background Technology
[0002] Kubevirt is a project that runs virtual machines in containers. The container virtual machines it creates have all the functions of a virtual machine. It allows you to specify the operating system kernel and version of the container virtual machine, and implement operations such as custom images, live migration, and running virtual machines in a service mesh.
[0003] Kubernetes is an open-source application used to manage containerized applications across multiple hosts in a cloud platform. Combining Kubernetes with Kubevirt is a common method for managing container virtual machines. However, the initial configuration of the number of virtual machine instances and scheduling policies of the container virtual machines orchestrated in this way cannot be adjusted according to real-time operation, resulting in uneven utilization of computing cluster resources. Summary of the Invention
[0004] The purpose of this invention is to provide a container virtual machine resource management method, apparatus, and electronic device that can solve the problem that existing container virtual machines cannot make corresponding resource adjustments based on real-time operating conditions.
[0005] In a first aspect, embodiments of the present invention provide a container virtual machine resource management method, the method comprising:
[0006] Deploy container orchestration components on the computing power management platform;
[0007] Based on the container orchestration component, a control plane cluster and N computing power member clusters are added. The computing power member clusters are used to deploy container virtual machines, where N is an integer greater than 1.
[0008] Configure the corresponding scheduling weight for the container virtual machine for each of the computing power member clusters;
[0009] With the computing power management platform in operation, obtain the computing power resources and the number of container virtual machines for each computing power member cluster;
[0010] Based on the computing resources and the number of container virtual machines in each of the computing power member clusters, a corresponding scheduling policy is generated, and the control plane cluster is used to execute the scheduling policy.
[0011] Optionally, generating a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each of the computing power member clusters includes:
[0012] With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster;
[0013] Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters;
[0014] Reduce the scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the scheduling weight of the second computing power cluster.
[0015] Optionally, generating a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each of the computing power member clusters includes:
[0016] Obtain a request to add a new computing power member cluster, and determine the number of the new computing power member clusters;
[0017] The first standard value of computing resources is determined based on the number of container virtual machines in the N computing power member clusters and the number of the new computing power member clusters.
[0018] Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform;
[0019] Based on the first computing power resource standard value, the scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster.
[0020] Optionally, generating a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each of the computing power member clusters includes:
[0021] Get the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted;
[0022] The second computing power resource standard value is determined based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted.
[0023] According to the second computing power resource standard value, the scheduling weight of the pre-deleted computing power member cluster is deleted, and the deleted scheduling weight of the pre-deleted computing power member cluster is added to the scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster.
[0024] Based on the number of computing power member clusters to be deleted, the pre-deleted computing power member clusters are deleted on the computing power management platform.
[0025] Optionally, when the computing power management platform is running, obtaining the computing power resources and the number of container virtual machines in each computing power member cluster includes:
[0026] Deploy a computing power acquisition entity to each of the computing power member clusters. The computing power acquisition entity is used to periodically acquire the computing power resources and the number of container virtual machines in each of the computing power member clusters.
[0027] When the computing power management platform is running, the computing power resources and the number of container virtual machines in each computing power member cluster are obtained through the computing power acquisition entity.
[0028] Secondly, embodiments of the present invention provide a container virtual machine resource management device, the device comprising:
[0029] The first deployment module is used to deploy container orchestration components on the computing power management platform;
[0030] The second deployment module is used to add a control plane cluster and N computing power member clusters based on the container orchestration component. The computing power member clusters are used to deploy container virtual machines, and N is an integer greater than 1.
[0031] The initial weight module is used to configure the scheduling weight of the corresponding container virtual machine for each of the computing power member clusters;
[0032] The computing power acquisition module is used to acquire the computing power resources and the number of container virtual machines for each computing power member cluster when the computing power management platform is running.
[0033] The scheduling module is used to generate a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each of the computing power member clusters, and the control plane cluster is used to execute the scheduling policy.
[0034] Optionally, the scheduling module is further configured to:
[0035] With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster;
[0036] Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters;
[0037] Reduce the scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the scheduling weight of the second computing power cluster.
[0038] Optionally, the scheduling module is further configured to:
[0039] Obtain a request to add a new computing power member cluster, and determine the number of the new computing power member clusters;
[0040] The first standard value of computing resources is determined based on the number of container virtual machines in the N computing power member clusters and the number of the new computing power member clusters.
[0041] Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform;
[0042] Based on the first computing power resource standard value, the scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster.
[0043] Optionally, the scheduling module is further configured to:
[0044] Get the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted;
[0045] The second computing power resource standard value is determined based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted.
[0046] According to the second computing power resource standard value, the scheduling weight of the pre-deleted computing power member cluster is deleted, and the deleted scheduling weight of the pre-deleted computing power member cluster is added to the scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster.
[0047] Based on the number of computing power member clusters to be deleted, the pre-deleted computing power member clusters are deleted on the computing power management platform.
[0048] Thirdly, embodiments of the present invention provide an electronic device, the electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the container virtual machine resource management method as described in the first aspect.
[0049] Fourthly, embodiments of the present invention provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, implement the steps of the container virtual machine resource management method as described in the first aspect.
[0050] In this embodiment of the invention, by deploying a container orchestration component on a computing power management platform, container virtual machine instances can be deployed simultaneously in multiple clusters, thereby running ultra-large-scale container virtual machine applications and making the operation of container virtual machines more reliable and scalable. Furthermore, during the operation of the computing power management platform, by acquiring the computing power resources and the number of container virtual machines in each computing power member cluster in real time, the number of container virtual machines deployed in each computing power member cluster is reasonably adjusted to achieve balanced resource utilization of the computing power clusters. This improves the utilization rate of computing power resources of the computing power clusters while ensuring the normal operation of each computing power member cluster. Attached Figure Description
[0051] Figure 1 This is one of the flowcharts illustrating the container virtual machine resource management method provided in an embodiment of the present invention;
[0052] Figure 2 This is a second flowchart illustrating the container virtual machine resource management method provided in an embodiment of the present invention.
[0053] Figure 3 This is a schematic diagram of the structure of the container virtual machine resource management device provided in an embodiment of the present invention;
[0054] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0056] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0057] The container virtual machine resource management method provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0058] like Figure 1 As shown, the container virtual machine resource management method provided in this embodiment of the invention includes:
[0059] Step S1: Deploy container orchestration components on the computing power management platform.
[0060] It should be noted that a computing power management platform, also known as a computing power network, is a facility that allocates and flexibly schedules computing, storage, and network resources on demand among the cloud, network, and edge according to business requirements.
[0061] In this embodiment of the invention, the container orchestration component can be a Karmada component. The Karmada component is lightweight and highly decoupled, which can help users achieve resource orchestration across multiple clusters without changing the application.
[0062] By deploying the Kmarmada component on the computing power management platform, container virtual machine instances can be deployed across multiple clusters, solving the problem that existing container virtual machine instances can only be deployed on a single cluster and are limited in scale. When container virtual machine instances experience abnormal operating conditions, feedback and processing can be performed quickly.
[0063] Step S2: Based on the container orchestration component, add a control plane cluster and N computing power member clusters. The computing power member clusters are used to deploy container virtual machines, where N is an integer greater than 1.
[0064] Based on the fact that the container orchestration component is the Karmada component, the multi-cloud environment managed by the Karmada component includes two types of clusters: the host cluster (i.e., the control plane cluster) and the member cluster (i.e., the computing power member cluster). The control plane cluster consists of the Karmada control plane and is used to accept user-submitted workload deployment requests and synchronize them to the computing power member clusters. The computing power member clusters are responsible for running user-submitted workloads, such as container virtual machine instances.
[0065] Step S3: Configure the scheduling weight of the corresponding container virtual machine for each of the computing power member clusters.
[0066] After adding the control plane cluster and the computing power member cluster, the control plane cluster synchronizes the initial scheduling weight for each of the computing power member clusters. When the computing power management platform receives a user request, it sends the user request to the control plane cluster, which then synchronizes the user request to the N computing power member clusters. The specific workload on each computing power member cluster, such as the number of container virtual machine instances, is determined by the initial scheduling weight and the user request.
[0067] Step S4: With the computing power management platform running, obtain the computing power resources and the number of container virtual machines for each computing power member cluster.
[0068] It should be noted that the computing power resources of each computing power member cluster refer to the maximum number of workloads such as container virtual machines that can be deployed in each computing power member cluster. The number of container virtual machines is the actual number of container virtual machines deployed in each computing power member cluster during actual operation.
[0069] Step S5: Based on the computing power resources and the number of container virtual machines in each computing power member cluster, a corresponding scheduling policy is generated, and the control plane cluster is used to execute the scheduling policy.
[0070] Based on the maximum theoretical number of deployable container virtual machines for each computing power member cluster and the actual number of deployed container virtual machines, the operating load of each computing power member cluster can be determined. Based on the operating load, a scheduling policy is generated, and the control plane cluster enables each computing power member cluster to execute a new scheduling weight to redeploy container virtual machines.
[0071] The container virtual machine resource management method provided in this invention deploys the Karmada component on a computing power management platform, enabling the simultaneous deployment of container virtual machine instances across multiple clusters. This allows for the running of ultra-large-scale container virtual machine applications and makes the operation of container virtual machines more reliable and scalable. Furthermore, during the operation of the computing power management platform, the computing power resources and the number of container virtual machines in each computing power member cluster are acquired in real time, and the number of container virtual machines deployed in each computing power member cluster is adjusted reasonably to achieve balanced resource utilization across the computing power clusters. This improves the utilization rate of computing power resources while ensuring the normal operation of each computing power member cluster.
[0072] As an optional implementation, step S5 generates a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each computing power member cluster, including:
[0073] With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster.
[0074] One of the N computing power member clusters is selected as the computing power member cluster to be tested. The computing power resource utilization rate of the computing power member cluster to be tested is the ratio of the number of container virtual machine instances actually deployed during the operation of the computing power member cluster to the maximum number of container virtual machine instances that can be theoretically deployed in the computing power member cluster to be tested. It can be understood that the higher the computing power resource utilization rate, the fewer the number of remaining deployable container virtual machine instances in the computing power member cluster to be tested. When the computing power resource utilization rate is greater than 1, it indicates that the computing power member cluster to be tested is already overloaded, which will lead to the instability of the operation of the container virtual machine instances within it.
[0075] Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters.
[0076] After obtaining the real-time computing power resource utilization rate of each computing power member cluster, the clusters are sorted by comparing the size of their utilization rates. The computing power member cluster with the highest utilization rate, i.e., the one with the least remaining resources, is marked as the overloaded cluster, i.e., the first computing power cluster. Similarly, the computing power member cluster with the lowest utilization rate is marked as the second computing power cluster.
[0077] Reduce the scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the scheduling weight of the second computing power cluster.
[0078] It should be noted that the above steps are for cases where the computing resource utilization rates of all N computing power member clusters are less than or equal to 1, or where only the computing resource utilization rate of the first computing power cluster is greater than 1. The computing power management platform generates new scheduling weights, the control plane cluster executes the new scheduling weights, and transfers the container virtual machine instances in the first computing power cluster to the second computing power cluster according to the new scheduling weights, while the total number of container virtual machine instances in the computing power management platform remains unchanged. This ensures that the computing resource utilization rate of each computing power member cluster tends to be balanced, avoiding situations where the computing resource utilization rate of a certain computing power member cluster is too high. When a user submits a new workload deployment request to the computing power management platform, the computing power member cluster with the high computing resource utilization rate may experience overload after deploying the new workload, thus ensuring the balanced and stable operation of computing resources across all computing power member clusters.
[0079] Optionally, when multiple computing resource utilization rates are greater than 1 among the N computing power member clusters, they are sorted in ascending order of computing resource utilization rate to form a sequence of computing power member clusters: F1, F2, F3...FN. Assuming the number of computing power member clusters with a computing resource utilization rate greater than 1 is 3, then FN, F(N-1), and F(N-2) are computing power member clusters with a computing resource utilization rate greater than 1. Container virtual machine instances exceeding their corresponding computing resources on FN are migrated to F1, on F(N-1) to F2, and on F(N-2) to F3, ensuring that each computing power member cluster does not experience overload. The same analogy applies to other cases where the number of computing power member clusters with a computing resource utilization rate greater than 1 is not specified.
[0080] Optionally, assuming each computing power member cluster has the same computing power resources, a preset resource threshold x is obtained. The computing power member clusters are then sorted according to the amount of computing power resource reserves, and a cluster is marked as having sufficient computing power resource reserves, i.e., the number of container virtual machine instances y is less than the resource threshold x, and the central processing unit (CMU) is also sufficient. The computing power cluster with a balanced CPU and memory distribution is designated as the preferred cluster E. The computing power member cluster with the fewest remaining deployable container virtual machine instances (VMs) is designated as the overloaded cluster D, where the number of VMs y is greater than the resource threshold x and the remaining computing power resources are minimal. For example, there are three computing power member clusters with VMs y1, y2, and y3 deployed. Since y3 > x, the computing power member cluster corresponding to y3 is the overloaded cluster D1. Since both y1 and y2 are less than the resource threshold x, the computing power member clusters corresponding to y1 and y2 are the preferred clusters E1 and E2. Based on the number of VMs in the overloaded cluster D1 exceeding the resource threshold, the computing power management platform generates a new scheduling policy. The control plane cluster causes the overloaded cluster D1 and the preferred clusters E1 and E2 to execute the new scheduling weights. The preferred clusters E1 and E2 increase the number of VMs while simultaneously reducing the number of VMs in the overloaded cluster D1.
[0081] As an optional implementation, step S5 generates a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each computing power member cluster, including:
[0082] Receive a request to add a new computing power member cluster, and determine the number of such new computing power member clusters.
[0083] When the computing power management platform receives a request to add a computing power member cluster, the control plane cluster forms a new scheduling strategy to ensure the balance of computing power resources of each computing power member cluster after the addition of a new computing power member cluster.
[0084] The first standard value for computing resources is determined based on the number of container virtual machines in the existing N computing power member clusters and the number of the new computing power member clusters.
[0085] For example, the total number of existing container virtual machine instances in the computing power management platform is a, the number of new computing power member clusters is b, and the first computing power resource standard value t1 = a / (N+b).
[0086] Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform.
[0087] Based on user requests, add corresponding new computing power member clusters to the computing power management platform.
[0088] Based on the first computing power resource standard value, the scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster.
[0089] At this point, the total number of computing power member clusters in the computing power management platform is N+b. The computing power resources of the new computing power member cluster are obtained, and added to the computing power resources of the N existing computing power member clusters, resulting in the total number of computing power resources m in the computing power management platform. The total number of computing power resources m is divided by the total number of computing power member clusters N+b to obtain the average computing power resource. Based on the average computing power resource and the first computing power resource standard value t1, the average computing power resource utilization rate y = (a / (N+b)) / (m / (N+b)) is obtained. The average computing power resource utilization rate y is compared with the computing power resource utilization rates of the N existing computing power member clusters to form a new scheduling weight. The computing power member clusters with a utilization rate greater than the average utilization rate are designated as computing power member clusters to be migrated. The excess container virtual machine instances in these clusters relative to the average utilization rate are migrated to the new computing power member cluster, thereby achieving a balance of computing power resources after adding a new computing power member cluster to the computing power management platform.
[0090] Optionally, the process of deploying container virtual machine instances on a new computing power member cluster may involve directly migrating the container virtual machine instances in the computing power member cluster to be migrated to the new computing power member cluster, or it may involve deleting the extra container virtual machine instances in the computing power member cluster to be migrated and adding copies of the deleted container virtual machine instances to the new computing power member cluster.
[0091] As an optional implementation, step S5 generates a corresponding scheduling policy based on the computing resources and the number of container virtual machines in each computing power member cluster, including:
[0092] Obtain the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted.
[0093] Understandably, when the computing power management platform receives a request to delete a computing power member cluster, it needs to generate a new scheduling strategy to ensure the stable operation of the remaining computing power clusters.
[0094] Based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted, a second computing power resource standard value is determined.
[0095] By analogy with the case of adding computing power member clusters, the total number of existing container virtual machine instances on the computing power management platform is a, the number of computing power member clusters to be deleted is c, and the second computing power resource standard value t2 = a / (Nc).
[0096] Based on the second computing power resource standard value, the scheduling weight of the pre-deleted computing power member cluster is removed, and the removed scheduling weight of the pre-deleted computing power member cluster is added to the scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster.
[0097] Analogous to adding computing power member clusters, the total number of computing power member clusters in the computing power management platform is Nc, and the total number of computing power resources in the computing power management platform is m. The total number of computing power resources m divided by the total number of computing power member clusters Nc yields the average computing power resource. Based on the average computing power resource and the second standard value t2 of computing power resources, the average computing power resource utilization rate y = (a / (Nc)) / (m / (Nc)) is obtained. The average computing power resource utilization rate y is compared with the computing power resource utilization rates of the N computing power member clusters to form a new scheduling weight. The container virtual machine instances of the pre-deleted computing power member clusters are migrated to the remaining computing power member clusters. Alternatively, the container virtual machine instances of the pre-deleted computing power member clusters are deleted, and copies of the deleted container virtual machine instances are added to the remaining computing power member clusters. The number of container virtual machine instances that need to be added to the remaining computing power member clusters is the number of container virtual machine instances whose corresponding computing power resource utilization rate is less than the average computing power resource utilization rate.
[0098] Based on the number of computing power member clusters to be deleted, the pre-deleted computing power member clusters are deleted on the computing power management platform.
[0099] After the migration of the container virtual machine instances is completed, the pre-deleted computing power member clusters can be deleted to ensure that the number of container virtual machine instances in the computing power management platform remains unchanged, and the normal operation of the remaining computing power member clusters continues.
[0100] like Figure 2 As shown, in an optional implementation, the container virtual machine resource management method provided by this embodiment of the invention includes:
[0101] Step S1: Deploy container orchestration components on the computing power management platform;
[0102] Step S2: Add a control plane cluster and N computing power member clusters based on the container orchestration component. The computing power member clusters are used to deploy container virtual machines, and N is an integer greater than 1.
[0103] Step S3: Configure the scheduling weight of the corresponding container virtual machine for each of the computing power member clusters;
[0104] The specific details of steps S1, S2, and S3 above can be found in the above description. Figure 1 The descriptions in the embodiments described herein will not be repeated here.
[0105] Step S41: Deploy the computing power acquisition entity to each of the computing power member clusters. The computing power acquisition entity is used to periodically acquire the computing power resources and the number of container virtual machines of each of the computing power member clusters.
[0106] Step S42: When the computing power management platform is running, the computing power resources and the number of container virtual machines of each computing power member cluster are obtained through the computing power acquisition entity.
[0107] The computing power deployment entity, namely the computing power agent, can periodically obtain the computing power resources and the number of container virtual machines in each of the computing power member clusters, and send the above data to the control plane cluster and the computing power management platform. Each time the above data is obtained, the scheduling weight of each computing power member cluster is evaluated and adjusted to make reasonable use of the computing power resources of the computing power member clusters, achieve balance, and improve the utilization rate of computing power resources.
[0108] The container virtual machine resource management method provided in this embodiment of the invention can be executed by a container virtual machine resource management device. This embodiment of the invention takes the execution of the container virtual machine resource management method by a container virtual machine resource management device as an example, and combines it with the appendix... Figure 3 This invention describes a container virtual machine resource management device 300 provided in an embodiment of the present invention. The device 300 includes:
[0109] The first deployment module 301 is used to deploy container orchestration components on the computing power management platform;
[0110] The second deployment module 302 is used to add a control plane cluster and N computing power member clusters based on the container orchestration component. The computing power member clusters are used to deploy container virtual machines, and N is an integer greater than 1.
[0111] The initial weight module 303 is used to configure the scheduling weight of the corresponding container virtual machine for each of the computing power member clusters;
[0112] The computing power acquisition module 304 is used to acquire the computing power resources and the number of container virtual machines in each computing power member cluster when the computing power management platform is running.
[0113] The scheduling module 305 is used to generate a corresponding scheduling policy based on the computing power resources and the number of container virtual machines in each of the computing power member clusters, and the control plane cluster is used to execute the scheduling policy.
[0114] Optionally, the scheduling module is further configured to:
[0115] With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster;
[0116] Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters;
[0117] Reduce the scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the scheduling weight of the second computing power cluster.
[0118] Optionally, the scheduling module is further configured to:
[0119] Obtain a request to add a new computing power member cluster, and determine the number of the new computing power member clusters;
[0120] The first standard value of computing resources is determined based on the number of container virtual machines in the N computing power member clusters and the number of the new computing power member clusters.
[0121] Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform;
[0122] Based on the first computing power resource standard value, the scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster.
[0123] Optionally, the scheduling module is further configured to:
[0124] Get the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted;
[0125] The second computing power resource standard value is determined based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted.
[0126] According to the second computing power resource standard value, the scheduling weight of the pre-deleted computing power member cluster is deleted, and the deleted scheduling weight of the pre-deleted computing power member cluster is added to the scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster.
[0127] Based on the number of computing power member clusters to be deleted, the pre-deleted computing power member clusters are deleted on the computing power management platform.
[0128] Optionally, the computing power acquisition module is further configured to:
[0129] Deploy a computing power acquisition entity to each of the computing power member clusters. The computing power acquisition entity is used to periodically acquire the computing power resources and the number of container virtual machines in each of the computing power member clusters.
[0130] When the computing power management platform is running, the computing power resources and the number of container virtual machines in each computing power member cluster are obtained through the computing power acquisition entity. The container virtual machine resource management device provided in this embodiment of the invention can deploy Karmada components on the computing power management platform to enable the deployment of container virtual machine instances on multiple and various clusters.
[0131] It should be noted that the container virtual machine resource management device provided in this embodiment of the invention can implement all the technical processes of the above-described container virtual machine resource management method and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0132] The container virtual machine resource management device in this embodiment of the invention can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. Non-mobile electronic devices can also be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This embodiment of the invention does not impose specific limitations.
[0133] Optionally, such as Figure 4 As shown, this embodiment of the invention also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the above-described container virtual machine resource management method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0134] It should be noted that the electronic devices in the embodiments of the present invention include the mobile electronic devices and non-mobile electronic devices described above.
[0135] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described container virtual machine resource management method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0136] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0137] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0139] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for managing container virtual machine resources, characterized in that, The method includes: Deploy container orchestration components on the computing power management platform; Based on the container orchestration component, a control plane cluster and N computing power member clusters are added. The computing power member clusters are used to deploy container virtual machines, where N is an integer greater than 1. Configure an initial scheduling weight for each of the computing power member clusters, wherein the initial scheduling weight is: the initial scheduling weight synchronized by the control plane cluster for each of the computing power member clusters when the control plane cluster and N computing power member clusters are added based on the container orchestration component; With the computing power management platform in operation, obtain the computing power resources and the number of container virtual machines for each computing power member cluster; Based on the computing resources and the number of container virtual machines in each of the computing power member clusters, a corresponding scheduling policy is generated, and the control plane cluster is used to execute the scheduling policy. The generation of corresponding scheduling policies based on the computing resources and the number of container virtual machines in each computing power member cluster includes: With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster; Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters; Reduce the initial scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the initial scheduling weight of the second computing power cluster; The generation of corresponding scheduling policies based on the computing resources and the number of container virtual machines in each computing power member cluster includes: Obtain a request to add a new computing power member cluster, and determine the number of the new computing power member clusters; The first standard value of computing resources is determined based on the number of container virtual machines in the N computing power member clusters and the number of the new computing power member clusters. Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform; Based on the first computing power resource standard value, the initial scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster; The generation of corresponding scheduling policies based on the computing resources and the number of container virtual machines in each computing power member cluster includes: Get the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted; The second computing power resource standard value is determined based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted. Based on the second computing power resource standard value, the initial scheduling weight of the pre-deleted computing power member cluster is deleted, and the deleted scheduling weight of the pre-deleted computing power member cluster is added to the initial scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster. Based on the number of pre-deleted computing power member clusters, the pre-deleted computing power member clusters are deleted on the computing power management platform.
2. The container virtual machine resource management method as described in claim 1, characterized in that, When the computing power management platform is running, obtaining the computing power resources and the number of container virtual machines in each computing power member cluster includes: Deploy a computing power acquisition entity to each of the computing power member clusters. The computing power acquisition entity is used to periodically acquire the computing power resources and the number of container virtual machines in each of the computing power member clusters. When the computing power management platform is running, the computing power resources and the number of container virtual machines in each computing power member cluster are obtained through the computing power acquisition entity.
3. A container virtual machine resource management device, characterized in that, The device includes: The first deployment module is used to deploy container orchestration components on the computing power management platform; The second deployment module is used to add a control plane cluster and N computing power member clusters based on the container orchestration component. The computing power member clusters are used to deploy container virtual machines, and N is an integer greater than 1. The initial weight module is used to configure the initial scheduling weight of the corresponding container virtual machine for each of the computing power member clusters. The initial scheduling weight is: the initial scheduling weight synchronized by the control plane cluster for each of the computing power member clusters when the control plane cluster and N computing power member clusters are added based on the container orchestration component. The computing power acquisition module is used to acquire the computing power resources and the number of container virtual machines for each computing power member cluster when the computing power management platform is running. The scheduling module is used to generate a corresponding scheduling policy based on the computing power resources and the number of container virtual machines in each of the computing power member clusters, and the control plane cluster is used to execute the scheduling policy. The scheduling module is also used for: With the number of computing power member clusters remaining constant, determine the computing power resource utilization rate of each computing power member cluster; Determine the first computing power cluster with the highest computing power resource utilization rate and the second computing power cluster with the lowest computing power resource utilization rate among the N computing power member clusters; Reduce the initial scheduling weight of the first computing power cluster, and add the reduced scheduling weight of the first computing power cluster to the initial scheduling weight of the second computing power cluster; The scheduling module is also used for: Obtain a request to add a new computing power member cluster, and determine the number of the new computing power member clusters; The first standard value of computing resources is determined based on the number of container virtual machines in the N computing power member clusters and the number of the new computing power member clusters. Based on the number of new computing power member clusters, deploy the new computing power member clusters on the computing power management platform; Based on the first computing power resource standard value, the initial scheduling weight of the N computing power member clusters is reduced, and the reduced scheduling weight of the N computing power member clusters is configured on the new computing power member cluster; The scheduling module is also used for: Get the request to delete the computing power member cluster, and determine the number of computing power member clusters to be deleted; The second computing power resource standard value is determined based on the number of container virtual machines in the N computing power member clusters and the number of computing power member clusters to be deleted. Based on the second computing power resource standard value, the initial scheduling weight of the pre-deleted computing power member cluster is deleted, and the deleted scheduling weight of the pre-deleted computing power member cluster is added to the initial scheduling weight of the remaining computing power member clusters among the N computing power member clusters excluding the pre-deleted computing power member cluster. Based on the number of pre-deleted computing power member clusters, the pre-deleted computing power member clusters are deleted on the computing power management platform.
4. The container virtual machine resource management device as described in claim 3, characterized in that, The computing power acquisition module is also used for: Deploy a computing power acquisition entity to each of the computing power member clusters. The computing power acquisition entity is used to periodically acquire the computing power resources and the number of container virtual machines in each of the computing power member clusters. When the computing power management platform is running, the computing power resources and the number of container virtual machines in each computing power member cluster are obtained through the computing power acquisition entity.
5. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the container virtual machine resource management method as described in any one of claims 1 to 2.
6. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the container virtual machine resource management method as described in any one of claims 1 to 2.