Resource state determination method and device, equipment, storage medium and product
By obtaining host performance resource scores in the cloud computing environment and generating multi -layered resource status values, the problem of difficulty granular resource assessment in existing technology has been solved, and a detailed assessment and management of cloud computing resources are realized.
Patent Information
- Application Number
- CN202411270404.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art is difficult to conduct fine-grained resource evaluation in a cloud computing environment, and it is impossible to carefully score each resource entity of cloud computing resources.
By obtaining the host performance resource scores of host resources, including CPU, memory, network and storage resource scores, and generating multi-level resource status values based on these scores, it reflects the health of the host, cluster and data center.
The fine -grained resource assessment in the cloud computing environment has been realized, the accuracy of the resource status is improved, and can be more detailed to manage and evaluate cloud computing resources.
Smart Images

Figure CN119356843A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource status determination method, device, equipment, storage medium and product. Background Art
[0002] Different from the traditional computing model, cloud computing uses virtualization technology to provide users with elastic resource services on demand. Virtualization technology is one of the key technologies in the field of cloud computing. It can virtualize the physical resources of a physical machine into multiple virtual machines (VMs). The physical resources are provided to each virtual machine in the form of a virtual resource pool by the virtualization platform, and the physical resources are shared between virtual machines.
[0003] A cloud data center is a data center that provides computing, storage, network and other resources in a virtualized manner. Compared with traditional data centers, cloud data centers have highly centralized resources and unified scheduling and management, which greatly saves data center operation and maintenance costs. The data center allocates virtual machine resources according to demand and strategy, and at the same time ensures the secure isolation of resources between virtual machines.
[0004] As the scale of cloud computing data centers expands, when users want to know whether the current data centers, clusters, hosts, virtual machines and other cloud computing resources are in sufficient resources or a relatively healthy state, they can adopt a cluster health inspection solution. This solution generally refers to inspecting the cluster to obtain a total score of the cluster or system, which is also usually called health.
[0005] However, this solution cannot perform detailed scoring on each resource entity of cloud computing resources, and thus cannot perform fine-grained resource evaluation and management. Summary of the invention
[0006] In view of this, the embodiments of the present application provide a resource status determination method, apparatus, device, storage medium and product, which can realize fine-grained resource evaluation in a cloud computing environment and improve the accuracy of resource status determination.
[0007] The technical solution of the embodiment of the present application is implemented as follows:
[0008] In a first aspect, an embodiment of the present application provides a method for determining a resource status, the method comprising:
[0009] Obtaining a host performance resource score of the host resources, wherein the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score;
[0010] Based on the performance resource score of each host, generating a first resource status value;
[0011] Generate a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs;
[0012] Generate a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs;
[0013] The first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster resource to which the host resource belongs, and the third resource status value represents the health of the data center resource to which the host resource belongs.
[0014] In some embodiments, the host resources include virtual machine resources, and the method further includes:
[0015] Obtaining a virtual machine performance resource score of the virtual machine resource, wherein the virtual machine performance resource score includes one or more of the following: a virtual machine CPU resource score, a virtual machine memory resource score, a virtual machine network resource score, and a virtual machine storage resource score;
[0016] Based on one or more of the virtual machine CPU resource score, the virtual machine memory resource score, the virtual machine network resource score, the virtual machine storage resource score and the first weighted rule, a fourth resource status value is determined, where the fourth resource status value represents the health of the virtual machine resources.
[0017] In some embodiments, generating a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs includes:
[0018] Obtaining host identification information of the host resource;
[0019] Determine the cluster resource to which the host resource belongs based on the host identification information and a first mapping relationship representing a correspondence between each host identification information and each cluster resource;
[0020] The second resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs.
[0021] In some embodiments, generating a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs includes:
[0022] Obtaining host identification information of the host resource;
[0023] Determine the data center resource to which the host resource belongs based on the host identification information and a second mapping relationship representing a correspondence between each host identification information and each data center;
[0024] The third resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the data center resources to which the host resource belongs.
[0025] In some embodiments, generating a first resource status value based on each of the host performance resource scores includes:
[0026] The first resource status value is generated based on one or more of the host CPU resource score, the host memory resource score, the host storage resource score, the host network resource score, and a second weighting rule.
[0027] In some embodiments, the host resources include: host CPU resources and virtual machine resources, and the method further includes:
[0028] Obtain a first CPU resource score and a second CPU resource score, wherein the first CPU resource score represents a CPU resource score of the virtual machine resource when the virtual machine resource is running on the host resource, and the second CPU resource score represents a CPU resource score corresponding to when the host resource does not carry the virtual machine resource;
[0029] The host CPU resource score is generated based on the first CPU resource score, the second CPU resource score, a correction coefficient of the first CPU resource score, and a host CPU score rule.
[0030] In some embodiments, the host resource comprises: host memory resources, and the method further comprises:
[0031] A host memory resource score is generated based on the memory usage of the host resources, the memory swap partition usage of the host resources, the number of host memory home page interruptions and a host memory scoring rule.
[0032] In some embodiments, the host resources include: host network resources, and the method further includes:
[0033] Obtaining a host receiving error rate, a host sending error rate and a host packet loss rate of the host resource data packet;
[0034] The host network resource score is generated based on the host reception error rate, the host transmission error rate, the host packet loss rate and a host network scoring rule.
[0035] In some embodiments, the host resources include: host storage resources and virtual machine resources, and the method further includes:
[0036] Determining a virtual machine storage resource score for the virtual machine resource based on the replica status of the virtual machine resource;
[0037] The host storage resource score is generated based on the virtual machine storage resource score, the correction coefficient corresponding to the storage device usage rate of the host resource, and the storage resource scoring rule.
[0038] In some embodiments, the virtual machine resources include: virtual machine CPU resources, and the method further includes:
[0039] The virtual machine CPU resource score is generated based on the CPU usage of the virtual machine resources, the CPU demand of the virtual machine resources, the CPU correction coefficient and the virtual machine CPU scoring rule.
[0040] In some embodiments, the virtual machine resources include: virtual machine memory resources, and the method further includes:
[0041] A memory resource score of the virtual machine resource is generated based on the memory usage value of the virtual machine resource, the memory requirement value of the virtual machine resource, a memory correction coefficient and a virtual machine memory scoring rule.
[0042] In a second aspect, an embodiment of the present application provides a resource status determination device, the device comprising:
[0043] An acquisition module, used to acquire a host performance resource score of a host resource, wherein the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score;
[0044] A first generating module, configured to generate a first resource status value based on the performance resource score of each host;
[0045] A second generating module, configured to generate a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs;
[0046] A third generating module, configured to generate a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs;
[0047] The first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster to which the host resource belongs, and the third resource status value represents the health of the data center resource to which the host resource belongs.
[0048] In a third aspect, an embodiment of the present application provides a resource status determination device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein:
[0049] The processor is used to execute the steps of the method described in the first aspect when running a computer program.
[0050] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0052] The technical solution provided in the embodiment of the present application obtains a host performance resource score of a host resource, where the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score; based on each host performance resource score, a first resource status value is generated; based on the first resource status value and resource status values corresponding to other host resources in a cluster resource to which the host resource belongs, a second resource status value is generated; based on the first resource status value and resource status values corresponding to other host resources in a data center resource to which the host resource belongs, a third resource status value is generated; wherein the first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster resource to which the host resource belongs, and the third resource status value represents the health of the data center resource to which the host resource belongs.
[0053] In this way, by refining the status determination in the cloud computing scenario to the host, and gradually building a multi-level resource status scoring system for hosts, clusters, and data centers, it reflects the health status of hosts, clusters, and data centers, thereby achieving fine-grained resource evaluation in the cloud computing environment and improving the accuracy of resource evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a method for determining resource status provided in an embodiment of the present application;
[0055] Figure 2 This is a schematic diagram of the external architecture of the rating service deployment in an application example of this application;
[0056] Figure 3 This is a schematic diagram of the composition structure of a virtual machine score in an application example of this application;
[0057] Figure 4This is a schematic diagram of the host scoring structure in an application example of this application;
[0058] Figure 5 This is a schematic diagram of the cluster scoring structure in an application example of this application;
[0059] Figure 6 This is a schematic diagram of the data center scoring structure in an application example of this application;
[0060] Figure 7 A schematic diagram of the online effect of cluster resource scoring in an application example of this application;
[0061] Figure 8 A schematic diagram of the online effect of host resource scoring in an application example of this application
[0062] Fig. 9 Schematic diagram of the online effect of virtual machine resource scoring in an application example of this application
[0063] Fig.10 A schematic diagram of the structure of a resource status determination device provided in an embodiment of the present application;
[0064] Fig.11 A schematic diagram of the structure of a resource status determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0067] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0068] CPU Score: A score that presents the CPU performance status in a percentage format. It is calculated based on relevant indicators such as CPU usage, demand, over-provisioning, and overload.
[0069] Memory Score: A form of memory performance status presented in a percentage, calculated based on actual physical memory used, swap memory used, memory over-allocation and overload, and other related indicators.
[0070] Network Score: A score that presents network performance in percentage, calculated based on indicators such as error rate and packet loss rate.
[0071] Storage Score: A form of storage performance status presented in a percentage, calculated based on indicators such as whether the storage has backups and storage utilization.
[0072] VM Score: A score that presents the performance status of a VM in a percentage format. It is calculated based on the VM's CPU score, memory score, network score, and storage score.
[0073] Host Score: A score that presents the host performance status in a percentage format. It is calculated based on the host CPU score, memory score, network score, and storage score.
[0074] Cluster Score: A form of presenting the status of cluster resources in a percentage, which is calculated by the scores of all hosts in the current cluster.
[0075] Data Center Score: A percentage-based score that represents the health of a data center. It is calculated by summing up the scores of all hosts in the data center.
[0076] CPU usage: refers to the percentage of workload of the computer's central processing unit (CPU) in a specific period of time. It indicates the ratio of the time the CPU is executing tasks to the total time. The higher the CPU usage, the more tasks the CPU is executing, while the lower the usage, the less CPU is idle. The CPU usage can reflect the performance of the computer system. When the CPU usage is continuously high, it may cause problems such as slow system response, extended task execution time, or system crashes.
[0077] CPU Demand: refers to the CPU resources required for normal execution of an application. When CPU resources are sufficient, that is, when there is no resource competition, this value is equal to the CPU utilization rate. When CPU resources are insufficient, that is, when there is resource competition, this value is greater than the CPU utilization rate.
[0078] CPU Cores: Refers to the number of processor cores in a central processing unit (CPU). Each processor core can execute instructions independently, so having more processor cores can increase the processing power and efficiency of a computer. For example, a CPU with four processor cores can execute four threads simultaneously, completing tasks faster than a CPU with only two processor cores.
[0079] Memory Used Percent: refers to the percentage of memory used in a computer system to the total memory. The higher the memory usage, the tighter the memory resources in the system, which may cause problems such as slow system operation or crash.
[0080] VM Memory Config: refers to the memory size pre-configured by the user for the virtual machine before it is powered on. It is the total memory size of the virtual machine, and the actual memory used is generally less than the total memory.
[0081] VM Memory Demand: refers to the actual physical memory size required by the virtual machine process running on the host.
[0082] Memory Swap Used Percent: refers to the percentage of the swap partition size used in the system to the total swap partition size. Swap partition is a virtual memory technology used to temporarily store part of the memory data on the hard disk to free up physical memory space when the physical memory is insufficient. When the swapped data needs to be accessed, the system will read it back into the physical memory. Therefore, the swap partition usage reflects the current tension of the system's physical memory. If the swap partition usage is too high, it may cause the system to respond slowly or even freeze.
[0083] Major Page Fault Per Second: This measures the number of major page faults that occur per second. A major page fault is an error that occurs when the operating system needs to access a page in virtual memory, but the page is not currently in physical memory. This usually requires reading the page from disk, which is a relatively slow operation that can cause system performance to degrade.
[0084] Network Packet Drop Percent: refers to the proportion of data packets lost during network transmission due to various reasons. The higher the network packet loss rate, the worse the network transmission quality, which may lead to problems such as increased network delays and slower data transmission speeds.
[0085] The Network Packet Error Percent refers to the proportion of data packets that have errors during transmission due to various reasons. The higher the network packet error rate, the worse the network transmission quality, which may lead to data transmission errors, data loss and other problems.
[0086] Storage Device Utilization: In the output of the iostat command, util represents the utilization of the disk, that is, the ratio of the working time of the disk to the total time. Specifically, it refers to the proportion of the time that the disk is busy in a period of time. The higher this value is, the heavier the workload of the disk is, which may affect the performance of the system. Normally, this value should be kept below 70%, otherwise you may need to consider optimizing the use of the disk or increasing the number of disks to share the load.
[0087] Aggregated Replica: Aggregated Replica and non-aggregated Replica are two different options when creating a virtual machine in a virtualized environment. Aggregated Replica means storing all files of a virtual machine (including virtual disks, configuration files, etc.) in the same location. Aggregated Replica can also improve the migration efficiency of virtual machines, because all files of a virtual machine are in the same location, making it easier to migrate a virtual machine from one physical host to another.
[0088] Non-Aggregated Replica: A non-aggregated replica of a virtual machine means storing the files of the virtual machine in different locations, such as local disks or different shared storage devices. This method can reduce the load on the storage device because the files of the virtual machine can be scattered across multiple storage devices. However, the fault tolerance and availability of a non-aggregated replica of a virtual machine are poor because if one of the storage devices fails, the virtual machine may not be able to continue running.
[0089] The present application embodiment provides a method for determining resource status, such as Figure 1 As shown, the method comprises the following steps:
[0090] Step 110: Obtain a host performance resource score of the host resources, where the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score.
[0091] It should be noted that in cloud computing systems, resource organization and management adopts a multi-layer structure, which includes host resources, cluster resources and data center resources from micro to macro. Host resources refer to a single physical server or virtual machine instance, which provides basic resources such as computing, memory, network and storage. Each host has its own performance indicators, such as CPU usage, memory usage, network traffic and disk I / O speed, which together determine the performance health of the host.
[0092] It should be noted that cluster resources are composed of multiple hosts that are interconnected and work in coordination to form a logical whole. The cluster can achieve functions such as high availability, failover, and dynamic expansion. Its resource status value reflects the ability and efficiency of the cluster as a unified service provider unit.
[0093] It should be noted that data center resources include one or more clusters and other infrastructure components, such as network devices, storage arrays, etc. At the data center level, the resource status of all clusters is considered, and comprehensive performance monitoring and optimization of the entire data center is performed to ensure that the data center can continue to provide services to a large number of users efficiently and maintain business continuity and stability.
[0094] Here, the host performance resource score of the host resources can be obtained from the database monitoring. The host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score.
[0095] Step 120: Generate a first resource status value based on the performance resource score of each host.
[0096] It should be noted that the host resource includes one or more host performance resource scores, and a first resource state is generated based on each host performance resource score, and the first resource state value is used to represent the health of the host resource. Based on the first resource state value, the health status of the host itself can be understood.
[0097] Step 130: Generate a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs.
[0098] Here, after determining the first resource status value, the health of the cluster resource environment where the host resource is located is further considered. Based on this, the first resource status value of the host and the resource status values corresponding to other host resources in the cluster resource to which the host resource belongs are integrated to generate a second resource status value representing the cluster resource.
[0099] Step 140: Generate a third resource status value based on the first resource status value and the resource status values corresponding to other host resources in the data center resources to which the host resource belongs; wherein the first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster resources to which the host resource belongs, and the third resource status value represents the health of the data center resources to which the host resource belongs.
[0100] Here, above the cluster layer, it continues to expand to the data center layer, and based on the first resource status value and the resource status values corresponding to other host resources in the data center resources to which the host resource belongs, the overall performance of all host resources in the entire data center resources is analyzed, so as to determine the health status of the data center resources and generate a third resource status value representing the health of the data center resources to which the host resource belongs. The third resource status value can also be generated based on the second resource status value of the cluster to which the host resource belongs and the resource status values of other clusters in the data information to which the cluster belongs.
[0101] In this way, by refining the status determination in the cloud computing scenario to the host, and gradually building a multi-level resource status scoring system for hosts, clusters, and data centers, it reflects the health status of hosts, clusters, and data centers, thereby achieving fine-grained resource evaluation in the cloud computing environment and improving the accuracy of resource evaluation.
[0102] In some embodiments, the host resources include virtual machine resources, and the method further includes:
[0103] Obtaining a virtual machine performance resource score of a virtual machine resource, where the virtual machine performance resource score includes one or more of the following: a virtual machine CPU resource score, a virtual machine memory resource score, a virtual machine network resource score, and a virtual machine storage resource score;
[0104] Based on one or more of the virtual machine CPU resource score, the virtual machine memory resource score, the virtual machine network resource score, the virtual machine storage resource score and the first weighted rule, a fourth resource status value is determined, and the fourth resource status value represents the health of the virtual machine resources.
[0105] It should be noted that in a cloud computing environment, a host usually runs one or more virtual machines through virtualization technology. As an important part of host resources, the performance and health status of virtual machine resources also have a direct impact on the overall service quality and availability.
[0106] Here, for virtual machine resources, there are various key performance indicators, including: virtual machine CPU usage, memory usage, network traffic, and disk I / O performance. In order to evaluate the virtual machine resources as a whole, these indicators need to be quantitatively scored. Correspondingly, virtual machine resources also correspond to their own virtual machine performance resource scores, and the virtual machine performance resource scores include one or more of the following: virtual machine CPU resource score, virtual machine memory resource score, virtual machine network resource score, and virtual machine storage resource score.
[0107] Here, after obtaining one or more performance resource scores of the virtual machine resources, the overall health status of the virtual machine is calculated based on one or more of the virtual machine CPU resource score, the virtual machine memory resource score, the virtual machine network resource score, the virtual machine storage resource score and the first weighted rule, thereby determining a fourth resource status value that characterizes the health of the virtual machine resources.
[0108] Here, the first weighted rule can be set according to the importance of each resource to the operating efficiency of the virtual machine in different business scenarios. For example, in some computing-intensive applications, the weight of the CPU resource score may be higher; while in memory-sensitive applications, the weight of the memory resource score may be greater.
[0109] Exemplarily, the first weighted rule may be expressed by the following formula:
[0110]
[0111] In the above formula, Weighted virtual machine performance resource score, S x (v) Score the virtual machine performance resources.
[0112] After weighting the scores of each performance resource based on the first weighting rule, an overall calculation can be performed based on the following formula to determine the fourth resource status value:
[0113]
[0114] In the above formula, S(v) is the fourth resource status value, Score the weighted CPU resources of the virtual machine. Score the weighted virtual machine memory resources. Score the weighted virtual machine network resources. The weighted virtual machine storage resource score, n cpu is the weighted value of the virtual machine's CPU resources, n mem is the weighted value of the virtual machine's memory resources, n net is the weighted value of the virtual machine network resources, n stoA weighted value for storage resources for the virtual machine.
[0115] In this way, by determining the fourth resource status value based on one or more of the virtual machine CPU resource score, virtual machine memory resource score, virtual machine network resource score, virtual machine storage resource score and the first weighted rule, the fourth resource status value can more accurately reflect the health of the virtual machine resources, which helps operation and maintenance personnel to promptly discover and handle problems at the virtual machine level, optimize virtual machine resource configuration, and ensure the stability and efficiency of cloud services. At the same time, this virtual machine resource status can also be integrated into the upper-level cluster resource and data center resource evaluation system to achieve comprehensive resource management and operation and maintenance, thereby achieving fine-grained resource evaluation in a cloud computing environment and improving the accuracy of resource evaluation.
[0116] In some embodiments, generating a second resource status value based on the first resource status value includes:
[0117] Get the host identification information of the host resource;
[0118] Determine the cluster resource to which the host resource belongs based on the host identification information and a first mapping relationship representing a correspondence between each host identification information and each cluster resource;
[0119] A second resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs.
[0120] Here, the first mapping relationship can be constructed and stored in advance by the user. The first mapping relationship represents the correspondence between each host identification information and each cluster resource. Based on the host identification information, the cluster resource corresponding to the host identification information can be found in the first mapping relationship to determine the cluster resource of the host resource.
[0121] Here, the geometric mean calculation rule can be used to process multiple data with relative properties, and the geometric mean calculation rule can better reflect the balance between multiple factors. In the cloud computing scenario, based on the geometric mean calculation rule, the resource status values of all hosts in the cluster are taken as the geometric mean to obtain a second resource status value representing the health status of the entire cluster. In this way, the overall resource utilization and performance of the cluster can be more comprehensively evaluated, thereby improving the accuracy of resource evaluation.
[0122] Exemplarily, the geometric mean calculation rule can be expressed by the following formula:
[0123]
[0124] In the above formula, S(c) is the second resource status value, and S(h) is the resource status value of each host resource in the cluster.
[0125] In some embodiments, generating a third resource status value based on the first resource status value includes:
[0126] Get the host identification information of the host resource;
[0127] Determine the data center resource to which the host resource belongs based on the host identification information and a second mapping relationship representing the correspondence between each host identification information and each data center;
[0128] A third resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the data center resources to which the host resource belongs.
[0129] Here, the second mapping relationship can be pre-built and stored by the user. The second mapping relationship represents the correspondence between each host identification information and each data center, and the data center resource where the host resource is located is found according to the second mapping relationship.
[0130] Here, in order to evaluate the resource status of data center-level resources, for the host resources that have been determined to belong to the data center resources, a higher-level resource status third resource status value is generated by combining the status of multiple host resources using a geometric mean calculation rule.
[0131] In this way, the embodiment of the present application not only considers the first resource status value of the host resource, but also integrates the relevant resource status values corresponding to all other host resources in the same data center, so as to generate a third resource status value that can reflect the overall operating status or resource balance of the entire data center. This can provide more macro and comprehensive data support for data center-level operation and maintenance decisions, thereby improving the accuracy of resource evaluation.
[0132] In some embodiments, generating a first resource status value based on the performance resource score of each host includes:
[0133] A first resource status value is generated based on one or more of the host CPU resource score, the host memory resource score, the host storage resource score, the host network resource score, and a second weighted rule.
[0134] Exemplarily, the second weighting rule can be expressed by the following formula:
[0135]
[0136] In the above formula, Weighted host performance resource score, S x (h) Host performance resource score.
[0137] After weighting the scores of each performance resource based on the first weighting rule, an overall calculation can be performed based on the following formula to determine the first resource status value:
[0138]
[0139] In the above formula, S(h) is the first resource status value, is the weighted host CPU resource score, is the weighted host memory resource score, Score the weighted host network resources. is the weighted host storage resource score, n cpu is the weighted value of the host CPU resources, n mem is the weighted value of host memory resources, n net is the weighted value of the host network resources, n sto The weighted value of the host storage resources.
[0140] In this way, the scores corresponding to each host resource (CPU, memory, storage, network) are multiplied by their respective weights and summed to obtain a first resource status value that comprehensively reflects the overall resource status of the host. This value can express the overall performance status of the host in a quantitative way, which helps operation and maintenance personnel quickly identify resource bottlenecks, reasonably schedule and optimize resource allocation.
[0141] In some embodiments, the method further comprises:
[0142] Based on the percentage conversion rule, one or more of the first resource status value, the second resource status value, and the third resource status value are converted.
[0143] Here, in order to make the resource status values intuitively comparable and easy to understand, the calculated first resource status value, second resource status value, and third resource status value can be converted using percentage conversion rules. In this way, even if the original calculation methods of each resource status value are different, they can be converted into a unified and intuitive percentage form, which is convenient for horizontal comparison analysis and decision support.
[0144] In some embodiments, the host resources include: host CPU resources and virtual machine resources, and the method further includes:
[0145] Obtain a first CPU resource score and a second CPU resource score, the first CPU resource score representing the CPU resource score of the virtual machine resource when the virtual machine resource is running on the host resource, and the second CPU resource score representing the CPU resource score corresponding to when the host resource does not carry the virtual machine resource;
[0146] A host CPU resource score is generated based on the first CPU resource score, the second CPU resource score, a correction coefficient of the first CPU resource score, and a host CPU score rule.
[0147] It should be noted that in a cloud computing environment, host resources include not only the physical CPU resources of the host itself, but also the CPU resources of virtual machines derived from the physical CPU. In actual applications, with the support of virtualization technology, the CPU resources on the physical host can be divided into multiple virtual CPUs (vCPUs) and allocated to different virtual machines. Virtual machine resources include various virtual resources abstracted from the physical layer provided by the host, among which CPU resources are particularly important because they are one of the key factors that determine the running speed and processing power of the virtual machine. Therefore, the CPU resource score of the host consists of two parts: the basic score (Sbase), i.e. the second CPU resource score, which represents the CPU resource score corresponding to when the host resources do not carry virtual machine resources, and the basic score (Svmbase) of the virtual machine running on the host, i.e. the first CPU resource score.
[0148] It should be noted that in order to improve the accuracy of the first CPU resource score, the first CPU resource score can be corrected based on the host CPU scoring rule and the correction coefficient of the first CPU resource score, and the host CPU resource score is generated based on the corrected first CPU resource score, the second CPU resource score and the host CPU scoring rule.
[0149] Exemplarily, the CPU scoring rule can be expressed by the following formula:
[0150]
[0151] In the above formula, S cpu (h) is the host CPU resource score, S base (h) scoring the second CPU resource, is the first CPU resource score, and m1 and m2 are correction coefficients of the first CPU resource score.
[0152] In this way, the embodiment of the present application generates a host CPU resource score based on the first CPU resource score, the second CPU resource score, the correction coefficient of the first CPU resource score and the host CPU scoring rule, provides the question of which specific relevant indicators to use to measure the host CPU resource score, and the corresponding calculation method, thereby improving the accuracy of the host CPU score.
[0153] In some embodiments, the host resources include: host memory resources, and the method further includes:
[0154] A host memory resource score is generated based on the memory usage of the host resources, the memory swap partition usage of the host resources, the number of host memory home page interruptions, and the host memory scoring rule.
[0155] It should be noted that the host's memory score is determined by three factors: the host resource memory usage (MEM usedPct), the memory swap partition usage (MEM swapUsedPct), and the host memory home page interruption count per second (MajorPageFaultPerSec).
[0156] Exemplarily, the memory scoring rule can be expressed by the following formula:
[0157]
[0158] In the above formula, S mem (h) is the host memory resource score, MEM usedPct (h) is the memory usage of the host resources, and m1 and m2 are memory coefficients.
[0159] Exemplarily, m1 can be calculated based on the following formula:
[0160]
[0161] In the above formula, MEM usedPct (h) / 100 is the memory usage of host resources, and MajorPageFaultPerSec(h) is the number of home page interruptions per second of the host. The greater the number of home page interruptions per second, the greater the impact on memory performance, the greater the coefficient m1, and the lower the score; conversely, the fewer the number of home page interruptions per second, the smaller the coefficient m1, and the higher the score.
[0162] For example, m2 can be calculated based on the following formula:
[0163]
[0164] In the above formula, MEM swapUsedPct (h) is the memory swap partition usage value. In this formula, the greater the proportion of memory swap partition usage, the greater the impact on memory performance, the greater the coefficient m2, and the lower the score. When the swap partition is not used, the coefficient m2 is 0 and does not affect the score.
[0165] In this way, the embodiment of the present application generates a host memory resource score based on the memory utilization rate of the host resources, the memory swap partition utilization rate of the host resources, the number of host memory home page interruptions and the host memory scoring rules, and provides the question of which specific relevant indicators to use to measure the host memory resource score, as well as the corresponding calculation method, thereby improving the accuracy of the host memory score.
[0166] In some embodiments, the host resources include: host network resources, and the method further includes:
[0167] Obtain the host receiving error rate, host sending error rate and host packet loss rate of the host resource data packets;
[0168] Generate a host network resource score based on the host receiving error rate, host sending error rate, host packet loss rate and host network scoring rules.
[0169] Here, the host reception error rate of the host resource data packets can be expressed as packets RxErrorPct Indicates that the host sends error packets using packets TxErrorPct express.
[0170] For the host packet loss rate, it includes the receiving packet loss rate packets RxDropPct and the packet loss rate packets TxDropPct .
[0171] Exemplarily, the host network scoring rule can be expressed by the following formula:
[0172] S net (h) = 100-max(packets RxErrorPct (h)+packets RxDroppct (h), packets TxErrorPct (h)+packets TxDropPct (h))
[0173] In the above formula, S net (h) Host network resource score, packets RxErrorPct (h) is the reception error rate of the host resource data packets, packets RxdropPct (h) is the packet loss rate of the host resource data packets TxErrorPct (h) is the error rate of sending packets of host resource data packets, packets TxdropPct (h) is the packet loss rate of the host resource data packet.
[0174] In this way, the embodiment of the present application generates a host network resource score based on the host reception error rate, the host transmission error rate, the host packet loss rate and the host network scoring rules, provides the question of which specific relevant indicators to use to measure the host network resource score, and the corresponding calculation method, thereby improving the accuracy of the host network resource score.
[0175] In some embodiments, the host resources include: host storage resources and virtual machine resources, and the method further includes:
[0176] Determining a virtual machine storage resource score for the virtual machine resource based on a replica state of the virtual machine resource;
[0177] A host storage resource score is generated based on the virtual machine storage resource score, the correction coefficient corresponding to the storage device usage rate of the host resources, and the storage resource scoring rule.
[0178] Here, the host storage score consists of two items: the first item is the virtual machine storage resource score of the virtual machine resources on the host. The second item is a correction factor related to the host's storage device utilization. If the utilization of all storage devices is low, the score is high.
[0179] Exemplarily, it can be determined based on the following storage resource scoring rules:
[0180]
[0181] In the above formula, s sto (h) is the host storage resource score, s sto (i) is the virtual machine storage resource score of the virtual machine resources on the host, and δ is a correction factor related to the storage device usage of the host. In this formula, the storage score of the host is obtained by multiplying the above two items. The first item is the geometric mean of the storage score of the virtual machine resources on the host, and the second item δ is a correction item related to the storage device usage of the host. When the usage of all storage devices of the host, that is, the %until value, does not exceed 70%, δ is 1, and in other cases δ is 0.9.
[0182] In some embodiments, the virtual machine resources include: virtual machine CPU resources, and the method further includes:
[0183] A virtual machine CPU resource score is generated based on the CPU usage of the virtual machine resources, the CPU demand of the virtual machine resources, the CPU correction coefficient, and the virtual machine CPU score rule.
[0184] Here, for virtualization technology in a cloud computing environment, the evaluation of virtual machine resources on host resources is also critical. For virtual machine resources, virtual machine resources include virtual machine CPU resources.
[0185] Here, the virtual machine CPU resource score involves three parts. The first part is the ratio of the virtual machine resource CPU usage rate CPUused to the CPU demand CPU demand, that is, the ratio of the actual CPU time obtained by the virtual machine to the expected CPU time. If the actual CPU time is closer to the expected time, the higher the score; conversely, if the actual CPU time is less than the expected time, the lower the score.
[0186] The second and third parts are m1 and m2 respectively. m1 and m2 are CPU correction coefficients. m1 is the CPU over-provisioning coefficient of the host, and m2 is the CPU overload correction coefficient. The higher the CPU over-provisioning ratio and CPU overload ratio of the host where the virtual machine is located, the larger these two items are, and the lower the calculated score is.
[0187] Exemplarily, the virtual machine CPU scoring rule can be expressed by the following formula:
[0188]
[0189] In the above formula, s cpu (v) Score the CPU resources of the virtual machine. used (v) is the CPU usage of virtual machine resources, CPU demand (v) is the CPU demand of the virtual machine resources, m1 and m2 are CPU correction coefficients.
[0190] In this way, the embodiment of the present application generates a virtual machine CPU resource score based on the CPU utilization rate of the virtual machine resources, the CPU demand of the virtual machine resources, the CPU correction coefficient and the virtual machine CPU scoring rules, and provides the question of which specific relevant indicators to use to measure the virtual machine CPU resource score, as well as the corresponding calculation method, thereby improving the accuracy of the virtual machine CPU resource score and further improving the accuracy of resource evaluation.
[0191] In some embodiments, the virtual machine resources include: virtual machine memory resources, and the method further includes:
[0192] A virtual machine memory resource score is generated based on the memory usage value of the virtual machine resource, the memory requirement value of the virtual machine resource, the memory correction coefficient, and the virtual machine memory scoring rule.
[0193] Here, the memory resource score of the virtual machine resources is mainly determined by three parts. The first part is the actual memory usage value of the virtual machine resources, that is, the memory usage of the virtual machine resources and the memory demand value that needs to be used, that is, the memory demand value of the virtual machine resources. The second and third parts are m1 and m2. m1 and m2 are memory correction coefficients. m1 is the host memory overload coefficient, and m2 is the correction item for host over-provisioning. When the total memory remains unchanged, when the memory load of the host where the virtual machine is located is higher, the larger m1 is, the more likely it is to affect the performance of the virtual machine, so the score will be reduced; when the total virtual machine memory configured on the host where the virtual machine is located is larger, exceeding 80% of the total memory of the host, the larger m2 is, the more likely it is to affect the performance of the virtual machine, so the score will be reduced. If it does not exceed 80% of the total memory of the host, this item is 1 and does not affect the score.
[0194] In this way, a virtual machine memory resource score is generated based on the memory usage value of the virtual machine resources, the memory requirement value of the virtual machine resources, the memory correction coefficient and the virtual machine memory scoring rule, which provides the question of which specific relevant indicators to use to measure the virtual machine memory resource score and the corresponding calculation method, thereby improving the accuracy of the virtual machine memory resource score and further improving the accuracy of resource evaluation.
[0195] The following describes the embodiment of the present application in detail in conjunction with an application example.
[0196] Existing solutions in the industry generally obtain a total cluster or system score by regularly inspecting the cluster from aspects such as computing, network, storage, and high-reliability services. This total score is also commonly referred to as health. Compared with this solution, the score is not broken down into virtual machine scores and host scores, as well as more fine-grained CPU, memory, network, and storage scores.
[0197] Based on this, this application example provides a resource scoring solution in a cloud scenario. When users want to know whether the current data center, cluster, host, virtual machine and other resources are in sufficient or relatively healthy state, they do not need to check and confirm the status of each resource through cumbersome methods such as background services or task managers. They only need to use the percentage system to clearly and intuitively understand the resource status of the current data center, cluster, host, and virtual machine.
[0198] In addition, this application example also solves the problem of which specific related indicators should be used to measure the CPU, memory, network, and storage scores, as well as the corresponding calculation methods; the problem of how to score virtual machines and hosts based on the CPU, memory, network, and storage scores, as well as the corresponding calculation methods; the problem of how to score clusters and data centers based on hosts, as well as the corresponding calculation methods.
[0199] like Figure 2 As shown, Figure 2 The diagram of the external architecture deployed for the scoring service. The whole process is as follows:
[0200] 1. The Agent collector regularly collects the monitoring and configuration data required for scoring and reports it to the data for storage.
[0201] 2. The scoring service periodically pulls monitoring and configuration data from the database based on the timestamp, calculates the scores of the corresponding virtual machines, hosts, clusters, data centers, etc. online, and saves them to the database.
[0202] 3. Based on the user's operation, the user chooses which rating to view, and the front end queries the database in real time to obtain the latest rating results.
[0203] Based on the above structure, the resource scoring scheme in this cloud scenario includes the following four parts.
[0204] 1. Virtual machine score (ie, the fourth resource status value mentioned above).
[0205] In this application example, the virtual machine score (i.e., the aforementioned fourth resource status value) includes the virtual machine CPU score (i.e., the aforementioned virtual machine CPU resource score), the memory score (i.e., the aforementioned virtual machine memory resource score), and the network score.
[0206] (i.e. the aforementioned virtual machine network resource score) and storage score (i.e. the aforementioned virtual machine storage resource score).
[0207] (1) Virtual machine CPU score.
[0208]
[0209] α=0.03
[0210] CPU load (h)=max(CPU used (h),CPU demand (h))
[0211] The CPU score of the virtual machine S cpu (v) is divided into three parts.
[0212] The first part is the ratio of the virtual machine's CPU used (i.e., the CPU utilization rate of the virtual machine resources mentioned above) to the CPU demand (i.e., the CPU demand of the virtual machine resources mentioned above), that is, the ratio of the actual CPU time obtained by the virtual machine to the expected CPU time. If the actual CPU time is closer to the expected time, the higher the score; conversely, if the actual CPU time is less than the expected time, the lower the score.
[0213] The second and third parts are m1 and m2 (the aforementioned CPU correction coefficients), which are the two multiplication terms m1 and m2 in the denominator of the above formula, which are the CPU over-provisioning and CPU overload correction terms of the host. The higher the CPU over-provisioning and CPU overload ratios of the host where the virtual machine is located, the larger these two terms are, and the lower the calculated score is.
[0214] For CPU over-provisioning, the more cores all virtual machines on the host have, the greater the over-provisioning ratio is, and the greater the possibility of resource competition. However, the configured number of cores is not the number of cores used, which does not necessarily cause performance degradation. Therefore, the weight value α is temporarily set to 0.03, which has a slight impact on the overall score. The CPU over-provisioning ratio of the host is the sum of the configured CPUs of all virtual machines running above Σ v∈h CPUcores (v) Divided by the number of CPU cores on the host cores (h) It is found that when the over-allocation ratio is less than 1, the score will not be reduced.
[0215] For CPU overload, the host load CPU load The higher (h) is, the greater the impact on the virtual machine performance, so the corresponding virtual machine score is lower. Therefore, the overload weight value β is 0.2 when the load is not higher than 20%, and the actual proportion of the load is taken when it is higher than 20%. Here, the maximum value between the host CPU utilization and the CPU expected to be obtained by all virtual machines is taken.
[0216] (2) Virtual machine memory score.
[0217] In practical applications, S mem (v) The virtual machine memory score can be calculated based on the following memory score calculation formula:
[0218]
[0219] α=0.6
[0220] β=0.5,γ=0.8
[0221]
[0222] From the above formula, we can see that the memory score of a virtual machine is mainly determined by three parts.
[0223] The first part is the ratio of the physical memory MEM used (the memory used by the virtual machine resources mentioned above) to the physical memory needed (MEM used + k * MEM swapUsed) (the memory required by the virtual machine resources). MEM used actually uses the VmRSS of the virtual machine process, and MEM swapUsed uses the VmSwap of the process, multiplied by a coefficient k related to the memory swap frequency MajorPageFaultPerSec. The more swap partitions are actually used, the more times the disk needs to be accessed, and the greater the possibility of causing memory homepage interruption, resulting in more interruptions and lower scores.
[0224] The second and third parts m1 and m2 (i.e. the aforementioned memory correction coefficient) are correction items for host memory overload and over-provisioning respectively. When the total memory remains unchanged, when the memory load of the host where the virtual machine is located is higher, the larger m1 is, the more likely it is to affect the performance of the virtual machine, so the score will be reduced; when the total memory of the virtual machine configured on the host where the virtual machine is located is larger, exceeding 80% of the total memory of the host, the larger m2 is, the more likely it is to affect the performance of the virtual machine, so the score will be reduced. If it does not exceed 80% of the total memory of the host, this item is 1 and does not affect the score.
[0225] (3) Virtual machine network score.
[0226] Here, in actual application, the virtual machine network score S can be calculated based on the following virtual machine network score formula: net (v):
[0227] S net (v) = 100-max(packets RxErrorPct (v)+packets RxDropPct (v) packets TxErrorPct (v)+packets TxDropPct (v))
[0228] In the above formula, the network score of the virtual machine is determined by the maximum value of the sum of the received packet error rate and the packet loss rate, and the sum of the sent packet error rate and the packet loss rate. The larger the error rate and packet loss rate, the more unstable the sending and receiving network packets are, the worse the network conditions are, and the lower the network score is.
[0229] (4) Virtual machine storage score.
[0230] Here, in actual application, the virtual machine storage score S can be calculated based on the following virtual machine storage score calculation formula: sto (v):
[0231]
[0232] In the above formula, the storage score of the virtual machine is determined by whether there is a local copy on the current host. If there is a local copy, the storage score is 100 points, and if there is no local copy, the storage score is 90 points. Whether a virtual machine has a local copy is also called an aggregate copy and a non-aggregate copy. The performance difference between an aggregate copy (with all data) and a non-aggregate copy is within the range of 10% to 15%.
[0233] (5) The overall score of the virtual machine (ie, the fourth resource status value mentioned above).
[0234] After obtaining the CPU score, memory score, network score, and storage score of the virtual machine, calculate the overall score of the virtual machine. Figure 3 As shown, Figure 3 This is a diagram of the composition structure of the virtual machine score. The virtual machine score is composed of the CPU score, memory score, network score and storage score. That is, the overall virtual machine score is the weighted geometric mean of the four score components, namely the CPU score, memory score, network score and storage score. Each component score needs to be weighted by the score weighting formula to increase the weight of the low-scoring component score, so that the final overall score is closer to the low score and more in line with reality.
[0235] First, based on the following formula (i.e., the first weighted rule mentioned above), the CPU score, memory score, network score, and storage score are weighted:
[0236]
[0237] Then, based on the following formula, the weighted geometric mean of the four score components, namely, the CPU score, memory score, network score, and storage score, is calculated to determine the overall score S(v) of the virtual machine.
[0238]
[0239] 2. Host score (ie, the aforementioned first resource status value).
[0240] In this application example, the host score includes: CPU score (i.e., the aforementioned host CPU resource status value), memory score (i.e., the aforementioned host memory resource status value), network score (i.e., the aforementioned host network resource status value) and storage score (i.e., the aforementioned host storage resource status value).
[0241] (1) Host CPU score (i.e., the host CPU resource score mentioned above).
[0242] In this application example, the host CPU score S can be calculated based on the following host CPU score calculation formula: cpu (h):
[0243]
[0244] S base (h) = 100 - CPU used (h),
[0245]
[0246] In the above formula, the CPU score Scpu(h) of the host is composed of two parts, the base score (Sbase) (ie, the aforementioned second CPU resource score) and the base score (Svmbase) of the virtual machine running thereon (ie, the aforementioned first CPU resource score).
[0247] The basic score is mainly related to the host's overall CPU utilization. The higher the host's overall CPU utilization, the lower the basic score; conversely, the lower the utilization, the higher the basic score.
[0248] The basic score of the virtual machine is segmented. When the host CPU load is less than 50%, the host load has little impact on the virtual machine performance, so a higher score is expected. When the host CPU load is greater than or equal to 50%, the host load may have a greater impact on the virtual machine performance, so a lower score is expected.
[0249] In addition, the two coefficients m1 and m2 (ie, the correction coefficients of the aforementioned first CPU resource score) will also affect the basic score of the virtual machine (ie, the aforementioned first CPU resource score).
[0250] m1 is a coefficient used to measure whether the CPU requirements of the virtual machines on the host are fully met. When there are no virtual machines running on the host, the sum of the CPU demands of all virtual machines on the host is 0, and the coefficient is 1, which will not reduce the score. In other cases, it depends on whether there is resource competition among the virtual machine CPUs. If there is resource competition, that is, the sum of the CPU used of all virtual machines on the host is less than the sum of the CPU demands of all virtual machines on the host, the coefficient is less than 1, which will reduce the basic score of the virtual machine. If there is no resource competition, that is, the sum of the CPU used of all virtual machines on the host is equal to the sum of the CPU demand of all virtual machines on the host, the coefficient is 1, which will not reduce the score.
[0251] m2 takes into account the number of cores (CPU cores) and CPU utilization (CPU used) of the host. For example, when the CPU utilization of an 8-core host and a 64-core host is 80%, the number of remaining idle cores is different, so this coefficient is introduced. When the number of cores is larger, the CPU utilization is smaller, the coefficient is larger, and the score is higher; when the number of cores is smaller, the CPU utilization is larger, the coefficient is smaller, and the score is lower.
[0252] Where CPU used represents the host CPU utilization, Σ v∈h CPU used (v) represents the actual number of CPU cores used by all virtual machines running on the host, Σ v∈h CPU demand (v) represents the number of CPU cores required by all virtual machines running on the host. cores (h) represents the number of logical cores of the host.
[0253] (2) Host memory score (i.e., the host memory resource score mentioned above).
[0254] In this application example, the host memory score S can be calculated based on the following rules: mem (h):
[0255]
[0256] The host's memory score is S mem (h) It is determined by three factors: the memory usage of the entire machine (MEM usedPct), the memory swap partition usage (MEM swapUsedPct) and the number of memory home page interrupts per second (MajorPageFaultPerSec).
[0257] The higher the memory usage, the greater the possibility of using the swap partition and the greater the possibility of home page interruption. Therefore, the higher the memory usage, the greater the impact on memory performance, causing the score to decrease.
[0258] The greater the number of home page interruptions per second, the greater the impact on memory performance, the larger the coefficient m1, and the lower the score; conversely, the fewer the number of home page interruptions per second, the smaller the coefficient m1, and the higher the score.
[0259] The greater the proportion of memory used in the swap partition, the greater the impact on memory performance, the greater the coefficient m2, and the lower the score; when the swap partition is not used, the coefficient m2 is 0 and has no effect on the score.
[0260] (3) Host network score (i.e. the aforementioned host network resource score).
[0261] S net (h) = 100-max(packets RxErrorPct (h)+packets RxDropPct (h), packets TxErrorPct (h)+packets TxDropPct (h))
[0262] In the above formula, the network score S of the host is net (h) It is determined by the maximum value of the sum of the received packet error rate and the packet loss rate, and the sum of the sent packet error rate and the packet loss rate. The larger the error rate and the packet loss rate, the worse the network condition and the lower the network score.
[0263] (4) Host storage score (i.e., the aforementioned host storage resource score).
[0264]
[0265] From the above formula, we can know that the storage score S of the host is sto(h) is obtained by multiplying two items. The first term is the geometric mean of the storage scores of each virtual machine on the host. The second term δ is a correction term related to the storage device utilization of the host. If the utilization of all storage devices (time) is low, the score is high.
[0266] (5) Overall host rating.
[0267] After obtaining the above host CPU score, memory score, network score, and storage score, calculate the overall host score. Figure 4 As shown, Figure 4 This is a schematic diagram of the host score composition structure. The host virtual machine score is composed of the CPU score, memory score, network score and storage score. That is, the overall host score is the weighted geometric mean of the four score components, namely the CPU score, memory score, network score and storage score. Each component score needs to be weighted using the score weighting formula to increase the weight of the low-scoring component score, so that the final overall score is closer to the low score and more in line with reality.
[0268] First, based on the following formula (i.e., the second weighted rule mentioned above), the CPU score, memory score, network score, and storage score are weighted:
[0269]
[0270] Then, based on the following formula, the weighted geometric mean of the four score components, namely, the CPU score, memory score, network score, and storage score, is calculated to determine the overall score S(h) of the virtual machine.
[0271]
[0272] In this way, the host score S(h) includes CPU score, memory score, network score, and storage score. Each component score needs to be weighted by the score weighting formula in the above figure to increase the weight of the low-scoring component score, so that the final overall score is closer to the low score and more in line with reality.
[0273] In addition, there are two reasons why the host score does not use the average of multiple virtual machine scores. One is to simplify the calculation, and the other is to better take background services into consideration.
[0274] 3. Cluster score (ie, the aforementioned second resource status value).
[0275] In practical applications, such as Figure 5 As shown, Figure 5 The schematic diagram of the cluster scoring structure is shown in Figure 5In the example, the overall cluster score s(c) is based on the scores of all hosts in the cluster, such as the score of host 1, the score of host 2, the score of host 3, ..., the score of host N. For example, the calculation formula of the overall cluster score s(c) is as follows:
[0276]
[0277] This application example is based on the above formula. The cluster score adopts the geometric mean of all host scores. Compared with the arithmetic mean, the geometric mean is more easily pulled down by smaller values, that is, it tends to give a higher score to the load-balanced cluster.
[0278] 4. Data center score (i.e. the third resource status value mentioned above).
[0279] In practical applications, such as Figure 6 As shown, Figure 6 A schematic diagram of the data center scoring structure is shown in Figure 6 In the data center, the overall score is based on the scores of N clusters, each cluster includes N host scores, such as host 1 score, host 2 score, host 3 score, ..., host N score. Exemplarily, it is calculated based on the following data center score formula:
[0280]
[0281] In the above formula, the score s(d) of the data center is the geometric mean of the scores of all hosts. Note that it is the mean of all hosts, not the mean of all clusters. You can also use the weighted geometric mean of the number of hosts in each cluster, which is equivalent.
[0282] In addition, if Figure 7 , Figure 8 and Fig. 9 As shown, Figure 7 Schematic diagram of the online effect of scoring cluster resources. Figure 7 In the cloud computing environment, users can intuitively understand the cluster performance score at the cluster resource level and whether the current resource status of the cluster is normal.
[0283] Figure 8 Schematic diagram of the online effect of scoring host resources. In this application example, users can intuitively understand the micro-host resource level of cluster resources in the cloud computing environment online, how much the host score is, and whether the current resource status of the host is normal.
[0284] Fig. 9 Schematic diagram of the online effect of scoring virtual machine resources. In this application example, users can intuitively understand the micro-virtual machine resource level of host resources in the cloud computing environment online, how much the host resource score is, and whether the current resource status of the virtual machine is normal.
[0285] In this way, this application example establishes an evaluation system for the resource scoring scheme in the cloud computing scenario based on the resource scoring scheme in the above cloud scenario, presenting the resource status of virtual machines, hosts, clusters and data centers in the form of scores from 0 to 100, thereby presenting resource performance in the form of percentage scores. Users can more intuitively feel the health status of the current virtual machines, hosts, clusters, and data centers, and thus promptly troubleshoot the causes of poor score status.
[0286] In addition, from the perspective of computing resources, this application example considers the virtual machine migration estimation score, which can provide an effective measurement indicator for cluster dynamic resource scheduling and serve as a reference indicator for the resource dimension when scheduling virtual machine migration.
[0287] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a resource status determination device, which corresponds to the above-mentioned resource status determination method, and each step in the above-mentioned resource status determination method embodiment is also completely applicable to the embodiment of the resource status determination method device. Fig.10 As shown, the resource status determination device includes: an acquisition module 1010, a first generation module 1020, a second generation module 1030 and a third generation module 1040, the acquisition module 1010 is used to obtain the host performance resource score of the host resource, the host performance resource score includes one or more of the following: host CPU resource score, host memory resource score, host network resource score and host storage resource score; the first generation module 1020 is used to generate a first resource status value based on each host performance resource score; the second generation module 1030 is used to generate a second resource status value based on the first resource status value and the resource status values corresponding to other host resources in the cluster resources to which the host resource belongs; the third generation module 1040 is used to generate a third resource status value based on the first resource status value and the resource status values corresponding to other host resources in the data center resources to which the host resource belongs; wherein the first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster to which the host resource belongs, and the third resource status value represents the health of the data center resources to which the host resource belongs.
[0288] In some embodiments, the acquisition module 1010 is also used to obtain a virtual machine performance resource score of the virtual machine resources, where the virtual machine performance resource score includes one or more of the following: a virtual machine CPU resource score, a virtual machine memory resource score, a virtual machine network resource score, and a virtual machine storage resource score; the resource status determination device also includes a fourth generation module 1050, which is used to determine a fourth resource status value based on one or more of the virtual machine CPU resource score, the virtual machine memory resource score, the virtual machine network resource score, the virtual machine storage resource score, and the first weighted rule, where the fourth resource status value represents the health of the virtual machine resources.
[0289] In some embodiments, the acquisition module 1010 is also used to obtain host identification information of the host resources; the resource status determination device also includes a determination module 1060, which is used to determine the cluster resources to which the host resources belong based on the identification information and a first mapping relationship characterizing the correspondence between each host identification information and each cluster resource; the second generation module 1030 is also used to generate a second resource status value based on the geometric mean calculation rule, the first resource status value and the resource status values corresponding to other host resources in the cluster resources to which the host resources belong.
[0290] In some embodiments, the acquisition module 1010 is also used to obtain host identification information of the host resources; the determination module 1060 is also used to determine the data center resources to which the host resources belong based on the host identification information and a second mapping relationship characterizing the correspondence between each host identification information and each data center; the third generation module is also used to generate a third resource status value based on the geometric mean calculation rule, the first resource status value, and the resource status values corresponding to other host resources in the data center resources to which the host resources belong.
[0291] In some embodiments, the first generating module 1020 is further configured to generate a first resource status value based on one or more of a host CPU resource score, a host memory resource score, a host storage resource score, a host network resource score, and a second weighting rule.
[0292] In some embodiments, the resource status determination device further includes a conversion module 1070 for converting one or more of the first resource status value, the second resource status value, and the third resource status value based on a percentage conversion rule.
[0293] In some embodiments, the host resources include: host CPU resources and virtual machine resources, and the acquisition module 1010 is also used to obtain a first CPU resource score and a second CPU resource score, the first CPU resource score represents the CPU resource score of the virtual machine resources when the virtual machine resources are running on the host resources, and the second CPU resource score represents the corresponding CPU resource score when the host resources do not carry the virtual machine resources; the first generation module 1010 is also used to generate the host CPU resource score based on the first CPU resource score, the second CPU resource score, the correction coefficient of the first CPU resource score and the host CPU scoring rule.
[0294] In some embodiments, the host resources include: host memory resources, and the first generation module 1020 is further used to generate a host memory resource score based on the memory usage of the host resources, the memory swap partition usage of the host resources, the number of host memory home page interruptions and the host memory scoring rules.
[0295] In some embodiments, the host resources include: host network resources, the acquisition module 1010 is also used to obtain the host reception error rate, host transmission error rate and host packet loss rate of the host resource data packet; the first generation module 1020 is also used to generate a host network resource score based on the host reception error rate, host transmission error rate, host packet loss rate and host network scoring rules.
[0296] In some embodiments, the host resources include: host storage resources and virtual machine resources, and the determination module 1060 is used to determine the virtual machine storage resource score of the virtual machine resources based on the copy status of the virtual machine resources; the first generation module 1020 is used to generate the host storage resource score based on the virtual machine storage resource score, the correction coefficient corresponding to the storage device usage rate of the host resources, and the storage resource scoring rule.
[0297] In some embodiments, the virtual machine resources include: virtual machine CPU resources, and the fourth generation module 1050 is further used to generate a virtual machine CPU resource score based on the CPU usage of the virtual machine resources, the CPU demand of the virtual machine resources, the CPU correction coefficient and the virtual machine CPU scoring rule.
[0298] In some embodiments, the virtual machine resources include: virtual machine memory resources, and the fourth generation module 1050 is also used to generate the virtual machine memory resource score based on the virtual machine resource's used memory value, the virtual machine resource's required memory value, the memory correction coefficient and the virtual machine memory scoring rule.
[0299] In actual application, the acquisition module 1010, the first generation module 1020, the second generation module 1030, the third generation module 1040, the fourth generation module 1050, the determination module 1060 and the conversion module 1070 can be implemented by a processor in the resource status determination device. Of course, the processor needs to run the computer program in the memory to realize its function.
[0300] It should be noted that: the resource status determination device provided in the above embodiment only uses the division of the above program modules as an example when determining the resource status. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the resource status determination device provided in the above embodiment and the resource status determination method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0301] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a resource status determination device. Fig.11Only an exemplary structure of the resource status determination device is shown, not all structures, and can be implemented as needed. Fig.11 Partial or complete structure shown.
[0302] like Fig.11 As shown, the resource status determination device 1100 provided in the embodiment of the present application includes: at least one processor 1101, a memory 1102, a user interface 1103 and at least one network interface 1104. The various components in the resource status determination device 1100 are coupled together through a bus system 1105. It can be understood that the bus system 1105 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1105 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.11 Various buses are labeled as bus system 1105.
[0303] The user interface 1103 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0304] The memory 1102 in the embodiment of the present application is used to store various types of data to support the operation of the resource status determination device 1100. Examples of such data include: any computer program used to operate on the resource status determination device.
[0305] The resource status determination method disclosed in the embodiment of the present application can be applied to the processor 1101, or implemented by the processor 1101. The processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the resource status determination method can be completed by the hardware integrated logic circuit or software instructions in the processor 1101. The above-mentioned processor 1101 can be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1101 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 1102. The processor 1101 reads the information in the memory 1102 and completes the steps of the resource status determination method provided in the embodiment of the present application in combination with its hardware.
[0306] In an exemplary embodiment, the resource status determination device can be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.
[0307] It can be understood that the memory 1102 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0308] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, which can be a computer-readable storage medium, for example, a memory 1102 storing a computer program, and the computer program can be executed by a processor 1101 of a resource status determination device to complete the steps of the method of the present application embodiment. The computer-readable storage medium can be a memory such as a ROM, a PROM, an EPROM, an EEPROM, a Flash Memory, a magnetic surface memory, an optical disk, or a CD-ROM.
[0309] Illustratively, an embodiment of the present application further provides a computer program product, including a computer program, which can be executed by the processor 1101 of the resource status determination device 1100 to complete any of the aforementioned method steps.
[0310] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0311] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0312] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for determining resource status, characterized in that: The method comprises: Obtaining a host performance resource score of the host resources, wherein the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score; Based on the performance resource score of each host, generating a first resource status value; Generate a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs; Generate a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs; The first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster resource to which the host resource belongs, and the third resource status value represents the health of the data center resource to which the host resource belongs.
2. The method according to claim 1, characterized in that The host resources include virtual machine resources, and the method further includes: Obtaining a virtual machine performance resource score of the virtual machine resource, wherein the virtual machine performance resource score includes one or more of the following: a virtual machine CPU resource score, a virtual machine memory resource score, a virtual machine network resource score, and a virtual machine storage resource score; Based on one or more of the virtual machine CPU resource score, the virtual machine memory resource score, the virtual machine network resource score, the virtual machine storage resource score and the first weighted rule, a fourth resource status value is determined, where the fourth resource status value represents the health of the virtual machine resources.
3. The method according to claim 1, characterized in that The generating a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs includes: Obtaining host identification information of the host resource; Determine the cluster resource to which the host resource belongs based on the host identification information and a first mapping relationship representing a correspondence between each host identification information and each cluster resource; The second resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs.
4. The method according to claim 1, characterized in that: The generating a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs includes: Obtaining host identification information of the host resource; Determine the data center resource to which the host resource belongs based on the host identification information and a second mapping relationship representing a correspondence between each host identification information and each data center; The third resource status value is generated based on a geometric mean calculation rule, the first resource status value, and resource status values corresponding to other host resources in the data center resources to which the host resource belongs.
5. The method according to claim 1, characterized in that The generating a first resource status value based on each of the host performance resource scores includes: The first resource status value is generated based on one or more of the host CPU resource score, the host memory resource score, the host storage resource score, the host network resource score, and a second weighting rule.
6. The method according to claim 1, characterized in that The host resources include: host CPU resources and virtual machine resources, and the method further includes: Obtain a first CPU resource score and a second CPU resource score, wherein the first CPU resource score represents a CPU resource score of the virtual machine resource when the virtual machine resource is running on the host resource, and the second CPU resource score represents a CPU resource score corresponding to when the host resource does not carry the virtual machine resource; The host CPU resource score is generated based on the first CPU resource score, the second CPU resource score, a correction coefficient of the first CPU resource score, and a host CPU score rule.
7. The method according to claim 1, characterized in that The host resources include: host memory resources, and the method further includes: A host memory resource score is generated based on the memory usage of the host resources, the memory swap partition usage of the host resources, the number of host memory home page interruptions and a host memory scoring rule.
8. The method according to claim 1, characterized in that The host resources include: host network resources, and the method further includes: Obtaining a host receiving error rate, a host sending error rate and a host packet loss rate of the host resource data packet; The host network resource score is generated based on the host reception error rate, the host transmission error rate, the host packet loss rate and a host network scoring rule.
9. The method according to claim 1, characterized in that: The host resources include: host storage resources and virtual machine resources, and the method further includes: Determining a virtual machine storage resource score for the virtual machine resource based on the replica status of the virtual machine resource; The host storage resource score is generated based on the virtual machine storage resource score, the correction coefficient corresponding to the storage device usage rate of the host resource, and the storage resource scoring rule.
10. The method according to claim 2, characterized in that The virtual machine resources include: virtual machine CPU resources, and the method further includes: The virtual machine CPU resource score is generated based on the CPU usage of the virtual machine resources, the CPU demand of the virtual machine resources, the CPU correction coefficient and the virtual machine CPU scoring rule.
11. The method according to claim 2, characterized in that The virtual machine resources include: virtual machine memory resources, and the method further includes: The virtual machine memory resource score is generated based on the used memory value of the virtual machine resource, the required memory value of the virtual machine resource, the memory correction coefficient and the virtual machine memory scoring rule.
12. A resource status determination device, characterized in that: The device comprises: An acquisition module, used to acquire a host performance resource score of a host resource, wherein the host performance resource score includes one or more of the following: a host CPU resource score, a host memory resource score, a host network resource score, and a host storage resource score; A first generating module, configured to generate a first resource status value based on the performance resource score of each host; A second generating module, configured to generate a second resource status value based on the first resource status value and resource status values corresponding to other host resources in the cluster resources to which the host resource belongs; A third generating module, configured to generate a third resource status value based on the first resource status value and resource status values corresponding to other host resources in the data center resources to which the host resource belongs; The first resource status value represents the health of the host resource, the second resource status value represents the health of the cluster to which the host resource belongs, and the third resource status value represents the health of the data center resource to which the host resource belongs.
13. A resource status determination device, characterized in that: include: A processor and a memory for storing a computer program that can be executed on the processor, wherein: The processor is used to execute the steps of the method according to any one of claims 1 to 11 when running a computer program.
14. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.