Host resource management method, device, equipment and medium

By calculating the spare resources of the physical host and determining the target physical host, the problem of uneven load in the cloud platform is solved, and the creation efficiency and resource utilization of cloud hosts are improved.

CN119739467APending Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202412000439.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

When managing and allocating host resources, existing cloud platforms have uneven load problems, resulting in excessive loading of certain partitions or computing nodes, low resource utilization, and affecting system operation.

Method used

By obtaining the reserved resource information of the physical host, it determines that the cloud host has used resources and total available resources, calculates the spare resources of the physical host, and when creating a cloud host, it determines the target physical host based on the free resources of each physical host.

Benefits of technology

It improves the creation efficiency and resource utilization of cloud hosts, avoids the problem of uneven load, and ensures the stable operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739467A_ABST
    Figure CN119739467A_ABST
Patent Text Reader

Abstract

The present invention discloses a host resource management method, device, equipment and medium, which are applied to the field of cloud computing technology, including: obtaining reserved resource information of a physical host, the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host; determining the resources currently occupied by a cloud host on the physical host to obtain the used resources of the cloud host; determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information and the used resources of the cloud host; in response to a cloud host creation request, determining a target physical host based on the free resources of each physical host, and creating a new cloud host on the target physical host. In this way, the creation efficiency of the cloud host can be improved, as well as the resource utilization of the cloud host.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a host resource management method, device, equipment and medium. Background Art

[0002] Currently, cloud platforms manage and allocate host resources through available partitions. When creating a cloud host, you need to pay attention to the resource usage of each partition and manually select partitions with lower loads to balance the load. This will not only affect the efficiency of cloud host creation, but also cause uneven loads. Some partitions or computing nodes are highly loaded or even fully loaded, resulting in low resource utilization and affecting system operation.

[0003] Therefore, how to improve the efficiency of creating cloud hosts and improve the resource utilization of cloud hosts is a problem that technical personnel in this field need to solve. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a host resource management method, device, equipment and medium, which can improve the efficiency of cloud host creation and improve the resource utilization of cloud hosts. The specific scheme is as follows:

[0005] In a first aspect, the present invention provides a host resource management method, comprising:

[0006] Acquire reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host;

[0007] Determine the resources currently occupied by the cloud host on the physical host to obtain the used resources of the cloud host;

[0008] Determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host;

[0009] In response to a cloud host creation request, a target physical host is determined based on idle resources of each physical host, and a new cloud host is created on the target physical host.

[0010] Optionally, determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host includes:

[0011] Calculate virtual total available resources based on the total available resources and the over-division ratio;

[0012] Calculate virtual reserved resources based on the reserved resource information and the over-division ratio;

[0013] The free resources of the physical host are determined based on the total virtual available resources of the physical host, the virtual reserved resources, and the used resources of the cloud host.

[0014] Optionally, the reserved resource information includes reserved processor resources and / or memory resources;

[0015] Accordingly, determining the free resources of the physical host based on the total virtual available resources of the physical host, the virtual reserved resources, and the used resources of the cloud host includes:

[0016] The free processor resources of the physical host are determined based on the virtual total available processor resources of the physical host, the virtual reserved processor resources and the used processor resources of the cloud host, and / or the free memory resources of the physical host are determined based on the virtual total available memory resources of the physical host, the virtual reserved memory resources and the used memory resources of the cloud host.

[0017] Optionally, obtaining the reserved resource information of the physical host includes:

[0018] Obtaining reserved resource information of the physical host based on the request processing service in the cloud platform;

[0019] Using the request processing service to transmit the reserved resource information to a preset service in the cloud platform, wherein the preset service includes a pre-created free resource calculation function;

[0020] Accordingly, determining the resources currently occupied by the cloud host on the physical host to obtain the used resources of the cloud host; determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information and the used resources of the cloud host, including:

[0021] The preset service is used to obtain the total available resources of the physical host, and the virtual total available resources are calculated based on the total available resources and the super-resolution ratio, and the resources currently occupied by the cloud host on the physical host are determined to obtain the used resources of the cloud host. The free resources of the physical host are calculated based on the free resource calculation function and the virtual total available resources and the used resources of the cloud host. The free resource calculation function includes a processor free resource calculation function and a memory free resource calculation function; the processor free resource calculation function is:

[0022] free_vcpu = total_vcpu - reserved_vcpu - vcpu_used;

[0023] Where free_vcpu indicates free processor resources, total_vcpu indicates the total available virtual processor resources, reserved_vcpu indicates the virtual reserved processor resources, vcpu_used indicates the processor resources used by the cloud host, reserved_vcpu = reserve_cpu* cpu_allocation_ratio, reserve_cpu indicates the reserved processor resources, and cpu_allocation_ratio indicates the over-resolution ratio corresponding to the processor;

[0024] The free memory resource calculation function is:

[0025] free_memory = total_memory - reserved_vmemory - memory_used;

[0026] Among them, free_memory indicates free memory resources, total_memory indicates the total available virtual memory resources, reserved_vmemory indicates the virtual reserved memory resources, memory_used indicates the used memory resources of the cloud host, reserved_ vmemory = reserve_memory * memory_allocation_ratio; reserve_memory indicates the reserved memory resources, and memory_allocation_ratio indicates the over-allocation ratio of the memory.

[0027] Optionally, in response to the cloud host creation request, determining the target physical host based on idle resources of each physical host includes:

[0028] In response to a cloud host creation request, the memory resource requirements and processor resource requirements of the cloud host creation in the request are parsed, and a physical host that meets the memory resource requirements and the processor resource requirements is screened out based on the idle resources of each physical host, and is determined as the target physical host.

[0029] Optionally, the screening out a physical host that meets the memory resource requirement and the processor resource requirement based on the idle resources of each physical host, and determining the physical host as the target physical host, includes:

[0030] Filter out the physical host that meets the memory resource requirement and the processor resource requirement based on the idle resources of each physical host;

[0031] If there are multiple physical hosts that meet the memory resource requirement and the processor resource requirement, a physical host whose free resources are higher than a preset threshold is screened out and determined as a target physical host.

[0032] Optionally, if there is no physical host with idle resources that meets the resource creation requirement, the physical host whose resource reservation needs to be adjusted is determined, and the reserved resources of the physical host whose resource reservation needs to be adjusted are lowered, wherein the resource creation requirement is the resource requirement for creating a cloud host.

[0033] In a second aspect, the present invention provides a host resource management device, comprising:

[0034] A reserved resource information acquisition module is used to acquire reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host;

[0035] A cloud host used resource determination module is used to determine the resources currently occupied by the cloud host on the physical host to obtain the cloud host used resources;

[0036] A free resource determination module, configured to determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host;

[0037] The cloud host creation module is used to respond to a cloud host creation request, determine a target physical host based on idle resources of each physical host, and create a new cloud host on the target physical host.

[0038] In a third aspect, the present invention provides an electronic device, comprising:

[0039] Memory for storing computer programs;

[0040] A processor is used to execute the computer program to implement the steps of the aforementioned host resource management method.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the steps of the aforementioned host resource management method.

[0042] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the steps of the aforementioned disclosed host resource management method when executed by a processor.

[0043] It can be seen from the above scheme that the present invention provides a host resource management method, including: obtaining reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host; determining the resources currently occupied by a cloud host on the physical host to obtain the used resources of the cloud host; determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host; in response to a cloud host creation request, determining a target physical host based on the free resources of each physical host, and creating a new cloud host on the target physical host.

[0044] It can be seen that the beneficial effects of the present invention are: reserving resources for the physical host, and taking the reserved resources into account when calculating the free resources of the physical host, so that when determining the target physical host for creating a cloud host based on the free resources of the physical host, the reserved resources are hidden and will not appear in the free resources, which can avoid the problem that some host resources have been used up while other host resources are very free, and achieve the effect of load balancing. When creating a cloud host, resources other than reserved resources are used, and resource utilization can be controlled and optimized by setting and adjusting host resource reservations. In addition, because resources are reserved, when creating a new cloud host, there is no need to consider the pressure and load of the physical host, and it can be automatically created on a physical host that meets the requirements. In this way, the efficiency of creating a cloud host can be improved, as well as the resource utilization of the cloud host.

[0045] Correspondingly, a host resource management device, equipment and medium provided by the present invention also have the above technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A flow chart of a host resource management method provided by an embodiment of the present invention;

[0048] Figure 2 A schematic diagram of host resource management provided by an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of the structure of a host resource management device provided by an embodiment of the present invention;

[0050] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0053] Currently, cloud platforms manage and allocate host resources through available partitions. When creating a cloud host, you need to pay attention to the resource usage of each partition and manually select partitions with lower loads to balance the load. This will not only affect the efficiency of cloud host creation, but also cause uneven loads. Some partitions or computing nodes are highly loaded or even fully loaded, resulting in low resource utilization and affecting system operation.

[0054] For example, in the cluster environment of OpenStack, computing resource management is not dynamic and flexible enough. Currently, it is mainly through configuring available partitions for computing hosts, and managing computing resources in the resource pool through available partitions. When the resources in a certain available partition are full, the subsequent creation of cloud hosts will select available partitions with relatively free resources. This method will not maximize the resource utilization of computing nodes. It is necessary to manually observe the usage of partition resources and manually select available partitions with more sufficient resources. It is possible that the load of some computing nodes will be relatively high, which will have a certain impact on the performance and response of the corresponding services running on them. Now openstack clusters all support one cloud with multiple cores. There are differences in CPU architecture. If the resource usage of some hosts is relatively high, it will be troublesome to adjust and evacuate resources later. It can be seen that the current openstack cluster uses available partitions to manage and allocate resources, which has some defects. First of all, it is necessary to pay attention to the resource usage of each partition. When creating a cloud host, it is necessary to manually select a partition with a relatively low load to balance the load. This will result in uneven load. There will always be some partitions or computing nodes with high loads or even full loads. Although the business can still run, the performance and response will be greatly affected, and it is not possible to keep the computing nodes in a relatively stable and efficient operation scenario.

[0055] To this end, the present invention provides a host resource management solution that can improve the efficiency of creating a cloud host and improve the resource utilization of the cloud host.

[0056] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0057] Next, a host resource management method provided by an embodiment of the present invention is described in detail. Figure 1 A flow chart of a host resource management method provided by an embodiment of the present invention, the host resource management method comprising:

[0058] Step S11: obtaining reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host.

[0059] In an embodiment of the present invention, the physical host may be a computing node managed by a cloud management platform, and the reserved resource information may include reserved processor resources and / or memory resources. The reserved resource information configured by the cloud management platform may be obtained. The user may configure the reserved resources based on the configuration page of the cloud management platform, and may configure the reserved processor resources and memory resources, or may configure one of them.

[0060] Step S12: Determine the resources currently occupied by the cloud host on the physical host to obtain the used resources of the cloud host.

[0061] In the embodiment of the present invention, for any physical host, the sum of resources occupied by all cloud hosts running on the physical host can be determined to obtain the cloud host used resources, including the cloud host used processor resources and the cloud host used memory resources.

[0062] Step S13: Determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host.

[0063] In an embodiment of the present invention, the virtual total available resources can be calculated based on the total available resources and the over-division ratio; the virtual reserved resources can be calculated based on the reserved resource information and the over-division ratio; and the free resources of the physical host can be determined based on the virtual total available resources of the physical host, the virtual reserved resources, and the used resources of the cloud host.

[0064] The over-resolution ratio describes the distribution relationship between physical resources and virtual resources. In a virtualized environment, the resources (such as CPU, memory, etc.) allocated to virtual machines exceed the number of physical resources. By setting the over-resolution ratio reasonably, hardware resources can be fully utilized to improve system performance and efficiency.

[0065] In an optional embodiment, the free processor resources of the physical host can be determined based on the virtual total available processor resources of the physical host, the virtual reserved processor resources and the used processor resources of the cloud host, and / or the free memory resources of the physical host can be determined based on the virtual total available memory resources of the physical host, the virtual reserved memory resources and the used memory resources of the cloud host.

[0066] Furthermore, in an optional implementation, the acquisition of the reserved resource information of the physical host includes: acquiring the reserved resource information of the physical host based on the request processing service in the cloud platform; using the request processing service to transmit the reserved resource information to the preset service in the cloud platform, wherein the preset service includes a pre-created free resource calculation function. The request processing service is a service for processing reserved resource configuration requests, for example, the cloud platform can be an openstack platform, the request processing service can be a nova-api (i.e., Application Programming Interface) service, and the preset service can be a nova-libvirt service.

[0067] Accordingly, the embodiment of the present invention can use the preset service to obtain the total available resources of the physical host, calculate the virtual total available resources based on the total available resources and the super-resolution ratio, determine the resources currently occupied by the cloud host on the physical host, obtain the used resources of the cloud host, and calculate the free resources of the physical host based on the free resource calculation function and using the virtual total available resources and the used resources of the cloud host. The free resource calculation function includes a processor free resource calculation function and a memory free resource calculation function; the processor free resource calculation function is:

[0068] free_vcpu = total_vcpu - reserved_vcpu - vcpu_used;

[0069] Where free_vcpu indicates free processor resources, total_vcpu indicates the total available virtual processor resources, reserved_vcpu indicates the virtual reserved processor resources, vcpu_used indicates the processor resources used by the cloud host, reserved_vcpu = reserve_cpu* cpu_allocation_ratio, reserve_cpu indicates the reserved processor resources, and cpu_allocation_ratio indicates the over-resolution ratio corresponding to the processor;

[0070] The free memory resource calculation function is:

[0071] free_memory = total_memory - reserved_vmemory - memory_used;

[0072] Among them, free_memory indicates free memory resources, total_memory indicates the total available virtual memory resources, reserved_vmemory indicates the virtual reserved memory resources, memory_used indicates the used memory resources of the cloud host, reserved_ vmemory = reserve_memory * memory_allocation_ratio; reserve_memory indicates the reserved memory resources, and memory_allocation_ratio indicates the over-allocation ratio of the memory.

[0073] Step S14: In response to the cloud host creation request, a target physical host is determined based on the idle resources of each physical host, and a new cloud host is created on the target physical host.

[0074] The new cloud host refers to a cloud host other than the cloud host used to determine the used resources of the cloud host in step S12.

[0075] In an optional implementation, in response to a cloud host creation request, the memory resource requirements and processor resource requirements for cloud host creation in the request can be parsed, and physical hosts that meet the memory resource requirements and the processor resource requirements can be screened out based on the idle resources of each physical host and determined as target physical hosts.

[0076] Furthermore, based on the free resources of each physical host, a physical host that meets the memory resource requirement and the processor resource requirement can be screened out; if there are multiple physical hosts that meet the memory resource requirement and the processor resource requirement, a physical host whose free resources are higher than a preset threshold is screened out and determined as the target physical host. If there are multiple physical hosts whose free resources are higher than the preset threshold, one can be randomly selected as the target physical host, or the physical host with the highest free resources can be selected and determined as the target physical host.

[0077] Furthermore, if there is no physical host with idle resources that meets the resource creation requirement, the physical host whose resource reservation needs to be adjusted is determined, and the reserved resources of the physical host whose resource reservation needs to be adjusted are lowered, wherein the resource creation requirement is the resource requirement for creating a cloud host.

[0078] The embodiment of the present invention can adaptively lower the reserved resources as the load increases. A higher reserved resource can be set at the beginning, and as the business increases, it can be gradually lowered to balance the resource usage of each physical host. The size of the reserved resources can be adjusted according to actual conditions. The reserved resources can be adjusted by monitoring the free resources and the load, or the ratio of unused resources to total available resources can be calculated based on the free resources and the reserved resources, and the reserved resources can be adjusted based on the ratio.

[0079] In an optional implementation, in response to a cloud host creation request, based on the memory resource requirements, processor resource requirements, and partition information of the cloud host creation in the parsed request, the processor resource requirements may include the processor architecture and the number of cores, and the partition information may be a partition identifier, the partitions are filtered based on the partition information and using a partition filter plug-in to obtain a target available partition, within the target available partition, the physical hosts that meet the processor resource requirements and memory requirements are filtered based on a preset processor filter plug-in and a preset memory filter plug-in, the free resources of the filtered physical hosts are sorted, and the cloud host is created on the physical host with the most free resources. The free resources may be the free processor resources at most, or the free memory resources at most, or the free processor resources and the free memory resources are weightedly calculated to obtain a total free resource measurement index, and the physical host with the most total free resource measurement index.

[0080] In this way, the physical host with the most free resources can be used preferentially. In addition, the partition information can be specified information. The embodiment of the present invention can realize different services in different partitions, deploy the cloud host of the corresponding service on the physical host of the corresponding partition, and create different business cloud hosts in different available partitions, which is convenient for business management. Through different filtering plug-ins, the target physical host can be quickly determined, and the efficiency of cloud host creation can be improved.

[0081] In addition, in an optional implementation, the reserved resources can be hidden by filtering plug-ins, that is, resource hiding is achieved at the operating system level. When the total available resources of the host are queried using operating system commands (such as Linux commands), the total available resources of the host minus the reserved resources are found. In this way, when calculating the free resources, the free resources can be obtained by removing the resources occupied by the cloud host based on the total available resources of the host obtained by the query. The total available resources of the host minus the reserved resources are found by the nova-libvirt service.

[0082] It can be seen that the embodiment of the present invention reserves resources for the physical host. When calculating the free resources of the physical host, the reserved resources are taken into account, so that when the target physical host for creating a cloud host is determined based on the free resources of the physical host, the reserved resources are hidden and will not appear in the free resources. This can avoid the problem that some host resources have been used up while other host resources are very free, and achieve the effect of load balancing. When creating a cloud host, resources other than reserved resources are used, and resource utilization can be controlled and optimized by setting and adjusting host resource reservations. In addition, because resources are reserved, when creating a new cloud host, there is no need to consider the pressure and load of the physical host, and it can be automatically created on a physical host that meets the requirements. In this way, the efficiency of creating a cloud host can be improved, as well as the resource utilization of the cloud host.

[0083] Further, taking the openstack platform as an example, the host resource management method provided by the present invention can facilitate the host resource management of the openstack cluster, balance and manage host resources by setting host resource reservation, and improve the utilization rate of host resources. On the page of the cloud management platform, you can specify the computing node (i.e., physical host) to set the CPU and memory reservation. You can set the reserved resources of the physical host individually or in batches. The CPU unit is core, and the memory unit is GB. After the host resource reservation is set on the cloud management platform, the configuration data is sent to the large-screen openstack cluster through the API. After the nova service obtains the data, it assigns the parameters to the libvirt service, creates a new calculation function under the libvirt service, and recalculates the free resources of the host CPU and memory. In this way, when creating cloud hosts and other resources, the CPU and memory resources reserved by the host cannot be used. It can include: (1) Add a host resource reservation list on the incloudos cloud management platform page, and create resource reservations for cpu (reserve_cpu) and memory (reserve_memory); (2) This data is sent to the nova module under the openstack cluster through the api; (3) The libvirt service under the nova module will count the host resources to obtain the host's total available cpu and total available memory, and calculate the total available virtual cpu (total_vcpu) and total virtual memory (total_memory) based on the configured over-allocation ratio (cpu_allocation_ratio / memory_allocation_ratio). It will also count the total vcpu (vcpu_used) and total memory (memory_used) of all virtual machines on the node; (4) Create a new calculation function under the libvirt service and use the new function to calculate the resources of the idle host:

[0084] free_vcpu = total_vcpu - reserved_vcpu - vcpu_used, where reserved_vcpu = reserve_cpu* cpu_allocation_ratio;

[0085] free_memory = total_memory - reserved_vmemory - memory_used, where reserved_ vmemory = reserve_memory * memory_allocation_ratio

[0086] (5) Create cloud host resources. The scheduler nova-scheduler selects available hosts through vcpu filtering-CoreFilter and memory filtering-RamFilter. This ensures that some resources of the host are always not occupied, keeping the host at a reasonable load.

[0087] The embodiment of the present invention manages resources by reserving computing resources. By configuring Nova and libvirt to reserve computing node resources, a portion of the host resources in the available partition is reserved to avoid high loads on certain computing nodes. Even under high loads, the normal operation of the service can be guaranteed, and certain resources can still be used for critical tasks or as a buffer.

[0088] The host resource reservation scheme provided by the embodiment of the present invention reserves a part of the host resources and prevents cloud hosts and other resources from using this part of the host resources, so that the host does not have problems of excessive pressure and excessive load. The computing node sets reserved resources, and only resources other than the reserved resources can be used when creating a cloud host. In this way, the resource utilization rate can be controlled and optimized by setting and adjusting the host resource reservation, so that cloud hosts and other resources do not occupy certain host resources, and each host resource can be used evenly to improve the utilization efficiency of host resources, thereby ensuring the stable operation of key services and tasks and avoiding the performance deficiency of key businesses.

[0089] See also Figure 2 As shown, Figure 2 A schematic diagram of host resource management provided by an embodiment of the present invention may include the following steps:

[0090] 1. The cloud management platform sets host resource reservation. Physical hosts can be set individually or in batches, or only one of the CPU and memory can be set. For example, set reserved resources: CPU reserves 24 cores and memory reserves 64GB.

[0091] 2. The configuration will be sent to the openstack platform through the API, and then the data will be transmitted to the nova-libvirt service through the nova-api service.

[0092] 3. The nova-libvirt service calculates the available resources of the host: total virtual CPU (total_vcpu) and total virtual memory (total_memory). It also counts the total vCPU (vcpu_used) and total memory (memory_used) of all virtual machines on the node, and updates the resource data every minute.

[0093] 4. Create a new calculation function under the nova-libvirt service, and calculate the idle CPU and memory resources of the host by calling the new function. At this time, the idle resources have subtracted the reserved resources and the resources already occupied by the virtual machine. During the calculation, the reserved CPU and memory data will be converted by the set over-resolution ratio to obtain reserved_vcpu and reserved_vmemory. The calculation formula is as follows:

[0094] free_vcpu (free cpu) = total_vcpu - reserved_vcpu - vcpu_used;

[0095] free_memory (free memory) = total_memory - reserved_vmemory - memory_used.

[0096] 5. Create cloud host resources and schedule the cloud host to a suitable host through nova-scheduler. At this time, use the vcpu filter plug-in CoreFilte, the memory filter plug-in RamFilte, and the partition filter plug-in to filter and select the host whose free space meets the cloud host specifications.

[0097] 6. The cloud host will be created on a host with more free resources.

[0098] 7. After setting resource reservation for a host, if the free resources have been used up, the creation of a cloud host by specifying the host again will fail due to insufficient resources. To avoid the host resources being fully occupied and the load being too high, the reserved resource size can be adjusted according to the actual situation. When the resources in some available partitions are tight, you can also manually adjust the number of computing nodes in the partition to maintain a relatively balanced resource utilization rate. In other words, when the load on some partitions or computing nodes is relatively high, you can adjust the available partitions, remove the computing nodes in the partitions with relatively low loads and add them to the available partitions with high loads, and then reduce the node load by migrating the cloud host.

[0099] The host resource reservation scheme implemented by the present invention manually sets the reserved CPU and memory resources of the designated host according to the usage scenario, sends the set data to the nova-libvirt service through the API, and creates a new calculation function under the nova-libvirt service. Once the resource reservation is set, the new algorithm function will be called to recalculate the host's free resources by subtracting the reserved resources. When creating cloud host resources for resource scheduling, the reserved CPU and memory resources will be hidden, so that the host always has a part of free resources, which will not appear in the free resources, and the reserved resources will not be used. The present invention can improve resource utilization and avoid the occurrence of excessive host resource pressure and excessive load affecting business operation on the openstack platform. Resource reservation can be set for the host on the cloud management platform page. When setting resource reservation, a new algorithm function will be called to calculate resource data, and the host free resources will be recalculated by subtracting the reserved part of resources. When creating new host resources for resource scheduling, the reserved part of CPU and memory resources will be hidden and will not appear in the free resources, so that the host resources will not be fully occupied and a certain margin will always be provided for the host resources. In this way, the allocation of resources will be more balanced, and the problem that some host resources are already overloaded while other host loads are very low will not occur. The load is balanced, the resource utilization of the host is improved, and the normal operation of the business can also be guaranteed.

[0100] In this way, it is convenient to manage the host resources of the openstack cluster, so that the host always has some CPU or memory resources available, which can avoid the problem that some host resources have been used up while other host resources are very idle, and ensure that some hosts will not be overstressed or overloaded, so as to avoid the impact of excessive host load on business performance and normal operation. When running some important businesses, you only need to reserve resources for the relevant hosts in advance. When creating new cloud host resources, you do not need to consider the host pressure and load issues. The cloud host will be automatically created on other hosts, which will not affect the normal operation of the business on the host with reserved resources. This method is convenient, simple, time-saving and worry-free. It can be adjusted in time according to changes in business scenarios. When the reserved resources are set to be relatively large and the load is always low, the reserved resources can be reduced to release some resources, so that the host performance can be more fully utilized and the resource utilization efficiency can be improved.

[0101] A host resource management device provided by an embodiment of the present invention is introduced below. The host resource management device described below can be referenced to other embodiments described in this document.

[0102] See also Figure 3 As shown, an embodiment of the present invention discloses a host resource management device, including:

[0103] The reserved resource information acquisition module 31 is used to acquire the reserved resource information of the physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for the cloud host;

[0104] The cloud host used resource determination module 32 is used to determine the resources currently occupied by the cloud host on the physical host to obtain the cloud host used resources;

[0105] A free resource determination module 33, configured to determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host;

[0106] The cloud host creation module 34 is used to respond to the cloud host creation request, determine the target physical host based on the idle resources of each physical host, and create a new cloud host on the target physical host.

[0107] The free resource determination module 33 may include:

[0108] A virtual total available resource calculation submodule, configured to calculate the virtual total available resources based on the total available resources and the over-resolution ratio;

[0109] A virtual reserved resource calculation submodule, configured to calculate the virtual reserved resources based on the reserved resource information and the over-division ratio;

[0110] The free resource calculation submodule is used to determine the free resources of the physical host based on the virtual total available resources of the physical host, the virtual reserved resources and the used resources of the cloud host.

[0111] The reserved resource information may include reserved processor resources and / or memory resources;

[0112] Correspondingly, the spare resource calculation submodule is specifically used for:

[0113] The free processor resources of the physical host are determined based on the virtual total available processor resources of the physical host, the virtual reserved processor resources and the used processor resources of the cloud host, and / or the free memory resources of the physical host are determined based on the virtual total available memory resources of the physical host, the virtual reserved memory resources and the used memory resources of the cloud host.

[0114] In an optional implementation, the reserved resource information acquisition module 31 may be used to: acquire the reserved resource information of the physical host based on the request processing service in the cloud platform; transmit the reserved resource information to the preset service in the cloud platform by using the request processing service, wherein the preset service includes a pre-created free resource calculation function;

[0115] Correspondingly, the cloud host used resource determination module 32 is used to use the preset service to determine the resources currently occupied by the cloud host on the physical host to obtain the cloud host used resources; the free resource determination module 33 is used to use the preset service to obtain the total available resources of the physical host, calculate the virtual total available resources based on the total available resources and the super-resolution ratio, and calculate the free resources of the physical host based on the free resource calculation function and using the virtual total available resources and the cloud host used resources. The free resource calculation function includes a processor free resource calculation function and a memory free resource calculation function; the processor free resource calculation function is:

[0116] free_vcpu = total_vcpu - reserved_vcpu - vcpu_used;

[0117] Where free_vcpu indicates free processor resources, total_vcpu indicates the total available virtual processor resources, reserved_vcpu indicates the virtual reserved processor resources, vcpu_used indicates the processor resources used by the cloud host, reserved_vcpu = reserve_cpu* cpu_allocation_ratio, reserve_cpu indicates the reserved processor resources, and cpu_allocation_ratio indicates the over-resolution ratio corresponding to the processor;

[0118] The free memory resource calculation function is:

[0119] free_memory = total_memory - reserved_vmemory - memory_used;

[0120] Among them, free_memory indicates free memory resources, total_memory indicates the total available virtual memory resources, reserved_vmemory indicates the virtual reserved memory resources, memory_used indicates the used memory resources of the cloud host, reserved_ vmemory = reserve_memory * memory_allocation_ratio; reserve_memory indicates the reserved memory resources, and memory_allocation_ratio indicates the over-allocation ratio of the memory.

[0121] The cloud host creation module 34 can be used to respond to a cloud host creation request, parse the memory resource requirements and processor resource requirements of the cloud host creation in the request, and screen out a physical host that meets the memory resource requirements and the processor resource requirements based on the idle resources of each physical host, and determine it as the target physical host.

[0122] In an optional embodiment, the cloud host creation module 34 can be used to screen out physical hosts that meet the memory resource requirements and the processor resource requirements based on the free resources of each physical host; if there are multiple physical hosts that meet the memory resource requirements and the processor resource requirements, then the physical hosts whose free resources are higher than a preset threshold are screened out and determined as the target physical hosts.

[0123] The device may further include a reserved resource adjustment module, configured to:

[0124] If there is no physical host whose idle resources meet the resource creation requirement, the physical host whose resource reservation needs to be adjusted is determined, and the reserved resources of the physical host whose resource reservation needs to be adjusted are lowered, wherein the resource creation requirement is the resource requirement for creating a cloud host.

[0125] It can be seen that the embodiment of the present invention reserves resources for the physical host. When calculating the free resources of the physical host, the reserved resources are taken into account, so that when the target physical host for creating a cloud host is determined based on the free resources of the physical host, the reserved resources are hidden and will not appear in the free resources. This can avoid the problem that some host resources have been used up while other host resources are very free, and achieve the effect of load balancing. When creating a cloud host, resources other than reserved resources are used, and resource utilization can be controlled and optimized by setting and adjusting host resource reservations. In addition, because resources are reserved, when creating a new cloud host, there is no need to consider the pressure and load of the physical host, and it can be automatically created on a physical host that meets the requirements. In this way, the efficiency of creating a cloud host can be improved, as well as the resource utilization of the cloud host.

[0126] An electronic device provided by an embodiment of the present invention is introduced below. The electronic device described below can be referenced to other embodiments described in this document.

[0127] Figure 4 A structural diagram of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the electronic device includes: a memory 40 for storing a computer program;

[0128] The processor 41 is used to implement the steps of the host resource management method of the above embodiment when executing a computer program.

[0129] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop or desktop computer, a server, etc.

[0130] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 41 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0131] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, it can implement the relevant steps of the host resource management method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 402 may include Windows, Unix, Linux, etc. Data 403 may include but is not limited to host resource data, etc.

[0132] In some embodiments, the electronic device may further include a display screen 42 , an input / output interface 43 , a communication interface 44 , a power supply 45 , and a communication bus 46 .

[0133] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.

[0134] It is understandable that if the host resource management method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.

[0135] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the host resource management method described above are implemented.

[0136] A computer program product provided by an embodiment of the present invention is introduced below. The computer program product described below can be referenced to other embodiments described in this document.

[0137] A computer program product includes a computer program / instruction, which implements the steps of the host resource management method disclosed above when executed by a processor.

[0138] The above is a detailed introduction to a host resource management method, device, equipment and medium provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0139] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0140] The above is a detailed introduction to a host resource management method, device, equipment and medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A host resource management method, characterized in that: include: Acquire reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host; Determine the resources currently occupied by the cloud host on the physical host to obtain the used resources of the cloud host; Determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host; In response to a cloud host creation request, a target physical host is determined based on idle resources of each physical host, and a new cloud host is created on the target physical host.

2. The host resource management method according to claim 1, characterized in that: The determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host includes: Calculate virtual total available resources based on the total available resources and the over-division ratio; Calculate virtual reserved resources based on the reserved resource information and the over-division ratio; The free resources of the physical host are determined based on the total virtual available resources of the physical host, the virtual reserved resources, and the used resources of the cloud host.

3. The host resource management method according to claim 2, characterized in that: The reserved resource information includes reserved processor resources and / or memory resources; Accordingly, determining the free resources of the physical host based on the total virtual available resources of the physical host, the virtual reserved resources, and the used resources of the cloud host includes: The free processor resources of the physical host are determined based on the virtual total available processor resources of the physical host, the virtual reserved processor resources and the used processor resources of the cloud host, and / or the free memory resources of the physical host are determined based on the virtual total available memory resources of the physical host, the virtual reserved memory resources and the used memory resources of the cloud host.

4. The host resource management method according to claim 3, characterized in that: The obtaining of the reserved resource information of the physical host includes: Obtaining reserved resource information of the physical host based on the request processing service in the cloud platform; Using the request processing service to transmit the reserved resource information to a preset service in the cloud platform, wherein the preset service includes a pre-created free resource calculation function; Accordingly, determining the resources currently occupied by the cloud host on the physical host to obtain the used resources of the cloud host; determining the free resources of the physical host based on the total available resources of the physical host, the reserved resource information and the used resources of the cloud host, including: The preset service is used to obtain the total available resources of the physical host, and the virtual total available resources are calculated based on the total available resources and the super-resolution ratio, and the resources currently occupied by the cloud host on the physical host are determined to obtain the used resources of the cloud host. The free resources of the physical host are calculated based on the free resource calculation function and the virtual total available resources and the used resources of the cloud host. The free resource calculation function includes a processor free resource calculation function and a memory free resource calculation function; the processor free resource calculation function is: free_vcpu = total_vcpu - reserved_vcpu - vcpu_used; Where free_vcpu indicates free processor resources, total_vcpu indicates the total available virtual processor resources, reserved_vcpu indicates the virtual reserved processor resources, vcpu_used indicates the processor resources used by the cloud host, reserved_vcpu = reserve_cpu* cpu_allocation_ratio, reserve_cpu indicates the reserved processor resources, and cpu_allocation_ratio indicates the over-resolution ratio corresponding to the processor; The memory free resource calculation function is: free_memory = total_memory - reserved_vmemory - memory_used; Among them, free_memory indicates free memory resources, total_memory indicates the total available virtual memory resources, reserved_vmemory indicates the virtual reserved memory resources, memory_used indicates the used memory resources of the cloud host, reserved_ vmemory = reserve_memory * memory_allocation_ratio; reserve_memory indicates the reserved memory resources, and memory_allocation_ratio indicates the over-allocation ratio of the memory.

5. The host resource management method according to claim 1, characterized in that: The step of responding to the cloud host creation request and determining the target physical host based on the idle resources of each physical host includes: In response to a cloud host creation request, the memory resource requirements and processor resource requirements of the cloud host creation in the request are parsed, and a physical host that meets the memory resource requirements and the processor resource requirements is screened out based on the idle resources of each physical host, and is determined as the target physical host.

6. The host resource management method according to claim 5, characterized in that: The step of selecting a physical host that meets the memory resource requirement and the processor resource requirement based on the idle resources of each physical host and determining the physical host as the target physical host includes: Filter out the physical host that meets the memory resource requirement and the processor resource requirement based on the idle resources of each physical host; If there are multiple physical hosts that meet the memory resource requirement and the processor resource requirement, a physical host whose free resources are higher than a preset threshold is screened out and determined as a target physical host.

7. The host resource management method according to any one of claims 1 to 6, characterized in that: Also includes: If there is no physical host whose idle resources meet the resource creation requirement, the physical host whose resource reservation needs to be adjusted is determined, and the reserved resources of the physical host whose resource reservation needs to be adjusted are lowered, wherein the resource creation requirement is the resource requirement for creating a cloud host.

8. A host resource management device, characterized in that: include: A reserved resource information acquisition module is used to acquire reserved resource information of a physical host, wherein the physical host is a physical server in a virtualization cluster, and the virtualization cluster is a server cluster that provides physical resources for a cloud host; A cloud host used resource determination module is used to determine the resources currently occupied by the cloud host on the physical host to obtain the cloud host used resources; A free resource determination module, configured to determine the free resources of the physical host based on the total available resources of the physical host, the reserved resource information, and the used resources of the cloud host; The cloud host creation module is used to respond to a cloud host creation request, determine a target physical host based on idle resources of each physical host, and create a new cloud host on the target physical host.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the host resource management method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the host resource management method according to any one of claims 1 to 7 are implemented.