WO2021136137A1 - Resource scheduling method and apparatus, and related device - Google Patents

Resource scheduling method and apparatus, and related device Download PDF

Info

Publication number
WO2021136137A1
WO2021136137A1 PCT/CN2020/139902 CN2020139902W WO2021136137A1 WO 2021136137 A1 WO2021136137 A1 WO 2021136137A1 CN 2020139902 W CN2020139902 W CN 2020139902W WO 2021136137 A1 WO2021136137 A1 WO 2021136137A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
resource
resource pool
machine
data
Prior art date
Application number
PCT/CN2020/139902
Other languages
French (fr)
Chinese (zh)
Inventor
肖磊
孙克勇
孙宏伟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021136137A1 publication Critical patent/WO2021136137A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A resource scheduling method and apparatus, and a related device. The method comprises: obtaining performance data and attribute data of each virtual machine in a resource pool, wherein the performance data comprises physical resource information of each virtual machine, and the attribute data comprises port number information and address information of a data packet; clustering a plurality of virtual machines according to the performance data to obtain a plurality of virtual machine clusters; determining a service relationship between services in the plurality of virtual machines according to the attribute data; and upon determining, according to the performance data of the plurality of the virtual machine clusters, that the virtual machines in the resource pool need to be scheduled, scheduling the virtual machines in the resource pool according to the service relationship between the services in the plurality of virtual machines. According to the method, by determining a relationship between services operating in virtual machines, resources are scheduled on the basis of the relationship between the services, so that scheduled virtual machines are more suitable for service needs.

Description

一种资源调度方法、装置及相关设备Resource scheduling method, device and related equipment
本申请要求于2019年12月31日提交中国专利局,申请号为201911419644.3,申请名称“一种资源调度方法、装置及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on December 31, 2019. The application number is 201911419644.3, and the application name is "a resource scheduling method, device and related equipment". The entire content is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种资源调度方法、装置及相关设备。This application relates to the field of computer technology, and in particular to a resource scheduling method, device and related equipment.
背景技术Background technique
动态资源调度(dynamic resource scheduler,DRS)是指采用负载均衡调度算法,通过周期性检查同一资源池内各个物理机的负载情况,在不同的物理机之间迁移虚拟机(virtual machine,VM),从而达到同一资源池内的不同物理机之间负载均衡的目的。Dynamic resource scheduling (DRS) refers to the use of load balancing scheduling algorithms to periodically check the load of each physical machine in the same resource pool, and to migrate virtual machines (VM) between different physical machines, thereby To achieve the purpose of load balancing between different physical machines in the same resource pool.
虚拟机迁移是指虚拟机从一台物理机迁移到另外一台物理机,当前虚拟机的迁移主要是根据同一资源池中各个物理机的物理资源(处理器、内存等)的使用情况以及虚拟机的物理资源需求,在不同的物理机之间迁移虚拟机,从而达到同一资源池内不同物理机之间负载均衡、提高资源利用率的目的。但是当前的虚拟机迁移仅仅考虑资源池中物理机的物理资源利用情况与虚拟机的物理资源需求对虚拟机进行迁移,迁移后的虚拟机的分布并不一定满足实际业务的需求。Virtual machine migration refers to the migration of virtual machines from one physical machine to another. The current migration of virtual machines is mainly based on the usage of physical resources (processors, memory, etc.) and virtual machines in the same resource pool. The physical resource requirements of the machine, the virtual machine is migrated between different physical machines, so as to achieve the purpose of load balancing between different physical machines in the same resource pool and improving resource utilization. However, the current virtual machine migration only considers the physical resource utilization of the physical machine in the resource pool and the physical resource demand of the virtual machine to migrate the virtual machine, and the distribution of the migrated virtual machine does not necessarily meet actual business requirements.
发明内容Summary of the invention
本申请实施例公开了一种资源调度方法、装置以及相关设备,能够根据资源池中虚拟机中业务之间的关系,对虚拟机进行动态调度,使调度后的虚拟机更符合实际业务的需求。The embodiment of the application discloses a resource scheduling method, device and related equipment, which can dynamically schedule virtual machines according to the relationship between the services in the virtual machines in the resource pool, so that the scheduled virtual machines are more in line with actual business requirements .
第一方面,本申请实施例提供一种资源调度方法,包括:In the first aspect, an embodiment of the present application provides a resource scheduling method, including:
获取资源池中多个虚拟机中每个虚拟机的性能数据与每个虚拟机的属性数据,其中,所述性能数据包括所述每个虚拟机的物理资源信息,所述属性数据包括数据包的端口号信息与地址信息;Acquire performance data of each virtual machine and attribute data of each virtual machine in the multiple virtual machines in the resource pool, where the performance data includes physical resource information of each virtual machine, and the attribute data includes data packets Port number information and address information;
根据所述性能数据对所述多个虚拟机进行聚类,得到多个虚拟机集群;Clustering the multiple virtual machines according to the performance data to obtain multiple virtual machine clusters;
根据所述属性数据确定所述多个虚拟机中的业务之间的业务关系;Determining the business relationship between the services in the multiple virtual machines according to the attribute data;
在根据所述每个虚拟机集群中虚拟机的性能数据确定对所述资源池中的虚拟机进行调度时,根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的资源进行调度。When it is determined to schedule the virtual machines in the resource pool according to the performance data of the virtual machines in each virtual machine cluster, according to the business relationship between the services in the multiple virtual machines, Resources for scheduling.
通过实施上述方法,通过获取每个虚拟机的性能数据以及每个物理机中接收到的数据包的属性数据,并根据上述性能数据对资源池中的虚拟机进行聚类,根据上述属性数据中的地址信息以及端口号信息等,感知虚拟机内部承载的业务的感知,以及虚拟机承载的业务之间的关系。然后根据聚类后的每个类别的虚拟机的性能数据确定是否需要对资源池中的资源进行调度,在需要对资源进行调度的情况下,根据业务之间的联系对资源池中的资源进行调度,从而在对资源池中的资源进行调度时,实现感知虚拟机中的业务以确定义务需要的资源,根据业务需要的资源以及业务之间的关系进行资源的调度,使得对资源池中的资源进行调度后更能满足实际业务的需求。By implementing the above method, by acquiring the performance data of each virtual machine and the attribute data of the data packets received in each physical machine, and clustering the virtual machines in the resource pool according to the above performance data, according to the above attribute data The address information and port number information, etc., perceive the perception of the services carried by the virtual machine and the relationship between the services carried by the virtual machine. Then determine whether the resources in the resource pool need to be scheduled according to the performance data of the virtual machines of each category after clustering. When resources need to be scheduled, the resources in the resource pool are performed according to the connection between the services. Scheduling, so that when the resources in the resource pool are scheduled, the services in the virtual machine are perceived to determine the resources required by the obligation, and the resources are scheduled according to the resources required by the business and the relationship between the services, so that the resources in the resource pool are After resources are scheduled, it can better meet the needs of actual business.
在一种可能的实施例中,所述根据所述每个虚拟机集群中虚拟机的性能数据,确定对所 述资源池中的虚拟机进行调度,包括:In a possible embodiment, the determining, according to the performance data of the virtual machines in each virtual machine cluster, to schedule the virtual machines in the resource pool includes:
获取所述每个虚拟机集群中每个虚拟机的资源使用数据,确定所述每个虚拟机集群的资源使用指标,并根据所述每个虚拟机集群的资源使用指标确定所述资源池的资源使用指标;Acquire the resource usage data of each virtual machine in each virtual machine cluster, determine the resource usage index of each virtual machine cluster, and determine the resource usage index of the resource pool according to the resource usage index of each virtual machine cluster Resource usage indicators;
获取所述每个虚拟机集群中每个虚拟机的资源分配数据,确定所述每个虚拟机集群的资源性能指标,并根据每个虚拟机集群的资源性能指标确定资源池的资源性能指标;Acquiring the resource allocation data of each virtual machine in each virtual machine cluster, determining the resource performance index of each virtual machine cluster, and determining the resource performance index of the resource pool according to the resource performance index of each virtual machine cluster;
根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的资源进行调度。According to the resource usage index of the resource pool and the resource performance index of the resource pool, it is determined to schedule the resources in the resource pool.
在一种可能的实施例中,所述根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的资源进行调度,包括:In a possible embodiment, the determining to schedule the resources in the resource pool according to the resource usage index of the resource pool and the resource performance index of the resource pool includes:
在所述资源池的资源使用指标与资源性能指标的比值小于第一阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case where the ratio of the resource usage index to the resource performance index of the resource pool is less than the first threshold, determine to schedule the resources in the resource pool; or,
在所述资源池的资源性能指标小于第二阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case that the resource performance index of the resource pool is less than the second threshold, determine to schedule the resources in the resource pool; or,
在所述资源池的资源使用指标小于第三阈值的情况下,确定对所述资源池中的资源进行调度。In the case that the resource usage index of the resource pool is less than the third threshold, it is determined to schedule the resources in the resource pool.
在一种可能的实施例中,所述根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的虚拟机进行调度,包括:In a possible embodiment, the scheduling the virtual machines in the resource pool according to the business relationship between the services in the multiple virtual machines includes:
所述根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的资源进行调度,包括:The scheduling of the resources in the resource pool according to the business relationship between the services in the multiple virtual machines includes:
在确定第一虚拟机中的第一业务与第二虚拟机中的第二业务之间具有关联关系的情况下,将所述第一虚拟机与所述第二虚拟机迁移到同一个物理机,或者,将所述第一虚拟机迁移到第一物理机,将所述第二虚拟机迁移到第二物理机,所述第一物理机与所述第二物理机之间的路径开销小于第三物理机与第四物理机之间的路径开销,其中,在虚拟机迁移之前,所述第一虚拟机位于所述第三物理机,所述第二虚拟机位于所述第四物理机,所述关联关系包括依赖关系、单向关系、双向关系以及同族关系。When it is determined that there is an association relationship between the first service in the first virtual machine and the second service in the second virtual machine, migrate the first virtual machine and the second virtual machine to the same physical machine , Or, migrating the first virtual machine to a first physical machine, and migrating the second virtual machine to a second physical machine, and the path overhead between the first physical machine and the second physical machine is less than The path overhead between the third physical machine and the fourth physical machine, where, before the virtual machine is migrated, the first virtual machine is located in the third physical machine, and the second virtual machine is located in the fourth physical machine , The association relationship includes a dependency relationship, a one-way relationship, a two-way relationship, and a family relationship.
第二方面,本申请实施例提供一种资源调度装置,该装置包括:In a second aspect, an embodiment of the present application provides a resource scheduling device, which includes:
通信单元,用于:获取资源池中多个虚拟机中每个虚拟机的性能数据,所述性能数据包括所述每个虚拟机的物理资源信息;The communication unit is configured to: obtain performance data of each virtual machine in the multiple virtual machines in the resource pool, where the performance data includes physical resource information of each virtual machine;
获取资源池中多个虚拟机中每个虚拟机对应的数据包的属性数据,所述属性数据包括数据包的端口号信息与地址信息;Acquiring attribute data of a data packet corresponding to each of the multiple virtual machines in the resource pool, where the attribute data includes port number information and address information of the data packet;
处理单元,用于:根据所述性能数据对所述多个虚拟机进行聚类,得到多个虚拟机集群;A processing unit, configured to: cluster the multiple virtual machines according to the performance data to obtain multiple virtual machine clusters;
根据所述属性数据确定所述多个虚拟机中的业务之间的业务关系;Determining the business relationship between the services in the multiple virtual machines according to the attribute data;
在根据所述每个虚拟机集群中虚拟机的性能数据,确定对所述资源池中的虚拟机进行调度时根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的资源进行调度。When determining to schedule the virtual machines in the resource pool according to the performance data of the virtual machines in each virtual machine cluster, according to the business relationship between the services in the multiple virtual machines, Resources for scheduling.
在一种可能的实施例中,所述处理单元具体用于:In a possible embodiment, the processing unit is specifically configured to:
获取所述每个虚拟机集群中每个虚拟机的资源使用数据,确定所述每个虚拟机集群的资源使用指标,并根据所述每个虚拟机集群的资源使用指标确定所述资源池的资源使用指标;Acquire the resource usage data of each virtual machine in each virtual machine cluster, determine the resource usage index of each virtual machine cluster, and determine the resource usage index of the resource pool according to the resource usage index of each virtual machine cluster Resource usage indicators;
获取所述每个虚拟机集群中每个虚拟机的资源分配数据,确定所述每个虚拟机集群的资源性能指标,并根据每个虚拟机集群的资源性能指标确定资源池的资源性能指标;Acquiring the resource allocation data of each virtual machine in each virtual machine cluster, determining the resource performance index of each virtual machine cluster, and determining the resource performance index of the resource pool according to the resource performance index of each virtual machine cluster;
根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的 资源进行调度。According to the resource usage index of the resource pool and the resource performance index of the resource pool, it is determined to schedule the resources in the resource pool.
在一种可能的实施例中,所述处理单元具体用于:In a possible embodiment, the processing unit is specifically configured to:
在所述资源池的资源使用指标与资源性能指标的比值小于第一阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case where the ratio of the resource usage index to the resource performance index of the resource pool is less than the first threshold, determine to schedule the resources in the resource pool; or,
在所述资源池的资源性能指标小于第二阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case that the resource performance index of the resource pool is less than the second threshold, determine to schedule the resources in the resource pool; or,
在所述资源池的资源使用指标小于第三阈值的情况下,确定对所述资源池中的资源进行调度。In the case that the resource usage index of the resource pool is less than the third threshold, it is determined to schedule the resources in the resource pool.
在一种可能的实施例中,所述处理单元具体用于:在确定第一虚拟机中的第一业务与第二虚拟机中的第二业务之间具有关联关系的情况下,将所述第一虚拟机与所述第二虚拟机迁移到同一个物理机,或者,将所述第一虚拟机迁移到第一物理机,将所述第二虚拟机迁移到第二物理机,所述第一物理机与所述第二物理机之间的路径开销小于第三物理机与第四物理机之间的路径开销,其中,在虚拟机迁移之前,所述第一虚拟机位于所述第三物理机,所述第二虚拟机位于所述第四物理机,所述关联关系包括依赖关系、单向关系、双向关系以及同族关系。In a possible embodiment, the processing unit is specifically configured to: when it is determined that there is an association relationship between the first service in the first virtual machine and the second service in the second virtual machine, the The first virtual machine and the second virtual machine are migrated to the same physical machine, or the first virtual machine is migrated to the first physical machine, and the second virtual machine is migrated to the second physical machine, the The path cost between the first physical machine and the second physical machine is smaller than the path cost between the third physical machine and the fourth physical machine. Before the virtual machine is migrated, the first virtual machine is located in the first physical machine. Three physical machines, the second virtual machine is located in the fourth physical machine, and the association relationship includes a dependency relationship, a one-way relationship, a two-way relationship, and a family relationship.
第三方面,本申请实施例提供一种计算设备,包括处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器执行所述指令时,所述服务器执行如上述第一方面或第一方面任意可能的实施例中所述的方法。In a third aspect, an embodiment of the present application provides a computing device, including a processor and a memory, the memory is used to store instructions, the processor is used to execute the instructions, and when the processor executes the instructions, all The server executes the method described in the foregoing first aspect or any possible embodiment of the first aspect.
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,所述处理器执行如上述第一方面或第一方面任意可能的实施例中所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned first aspect or The method described in any possible embodiment of the first aspect.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1是本申请实施例提供的一种虚拟机迁移示意图;FIG. 1 is a schematic diagram of a virtual machine migration provided by an embodiment of the present application;
图2是本申请实施例提供的一种资源池的结构示意图;Figure 2 is a schematic structural diagram of a resource pool provided by an embodiment of the present application;
图3是本申请实施例提供的一种资源调度方法的流程示意图;FIG. 3 is a schematic flowchart of a resource scheduling method provided by an embodiment of the present application;
图4是本申请实施例提供的一种资源调度装置的结构示意图;FIG. 4 is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present application;
图5是本申请实施例提供的一种计算设备的结构示意图。Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
具体实施方式Detailed ways
首先,结合附图对本申请中所涉及的部分用语和相关技术进行解释说明,以便于本领域技术人员对本申请实施例的理解。First of all, some terms and related technologies involved in this application will be explained in conjunction with the accompanying drawings, so that those skilled in the art will understand the embodiments of this application.
动态资源调度(dynamic resource scheduler,DRS)是指采用负载均衡调度算法,通过周期性检查同一资源池内不同主机的负载情况,对资源池中的资源进行动态调度,从而达到同一资源池内的不同物理机之间负载均衡的目的。其中,上述资源是指虚拟机或容器等实例,本申请实施例中以虚拟机为例进行阐述,对容器等其他资源的动态调度与虚拟机类似。Dynamic resource scheduler (DRS) refers to the use of load balancing scheduling algorithms to dynamically schedule the resources in the resource pool by periodically checking the load conditions of different hosts in the same resource pool, so as to achieve different physical machines in the same resource pool. The purpose of load balancing between. Wherein, the aforementioned resources refer to instances such as virtual machines or containers. In the embodiments of the present application, virtual machines are taken as examples for explanation. The dynamic scheduling of other resources such as containers is similar to that of virtual machines.
上述对资源进行动态调度包括对虚拟机进行迁移。对虚拟机进行迁移是指将虚拟机从一 个物理机迁移到另一个物理机中运行。例如,如图1所示,资源池中包括物理机1、物理机2与物理机3三个物理机,VM1、VM2与VM3运行在物理机1中,VM4与VM5运行在物理机2中,VM5、VM7与VM8运行在物理机3中。现在将该VM2迁移到物理机2上,那么VM2将运行在物理机2上,而物理机1上将不存在VM2。The foregoing dynamic scheduling of resources includes the migration of virtual machines. Migrating a virtual machine refers to migrating a virtual machine from one physical machine to another physical machine to run. For example, as shown in Figure 1, the resource pool includes three physical machines, physical machine 1, physical machine 2, and physical machine 3. VM1, VM2, and VM3 run in physical machine 1, and VM4 and VM5 run in physical machine 2. VM5, VM7, and VM8 run in physical machine 3. Now migrate this VM2 to physical machine 2, then VM2 will run on physical machine 2, and VM2 will not exist on physical machine 1.
虚拟机根据需求不同,所表现出的负载特征也各不相同的,例如,一般将虚拟机分为三类,包括计算型虚拟机、存储型虚拟机、网络型虚拟机。其中,所述计算型虚拟机表示虚拟机主要需要的是处理器(central processing unit,CPU)资源,存储型虚拟机表示虚拟机主要需要的是内存资源,网络型虚拟机表示虚拟机主要需要的是带宽资源。若同一台物理机上承载的虚拟机为同一种类型,例如同为计算型虚拟机,各个虚拟机之间会竞争CPU资源,而其它资源(例如内存、带宽等)的利用率就会偏低,由于各个虚拟机竞争使用CPU资源,会造成服务质量降低,同时导致整体资源利用率不高。因此为了避免这种情况的产生,需要根据物理机的物理资源使用情况以及虚拟机的物理资源需求动态调度资源池中的资源,提高资源池内物理机的整体资源利用率。According to different requirements, virtual machines exhibit different load characteristics. For example, virtual machines are generally divided into three categories, including computing virtual machines, storage virtual machines, and network virtual machines. Wherein, the computing virtual machine means that the virtual machine mainly needs processor (central processing unit, CPU) resources, the storage virtual machine means that the virtual machine mainly needs memory resources, and the network virtual machine means that the virtual machine mainly needs resources. Is the bandwidth resource. If the virtual machines hosted on the same physical machine are of the same type, for example, the same type of computing virtual machine, each virtual machine will compete for CPU resources, and the utilization of other resources (such as memory, bandwidth, etc.) will be low. As each virtual machine competes for the use of CPU resources, the quality of service will be reduced, and the overall resource utilization will not be high. Therefore, in order to avoid this situation, it is necessary to dynamically schedule the resources in the resource pool according to the physical resource usage of the physical machine and the physical resource demand of the virtual machine to improve the overall resource utilization of the physical machine in the resource pool.
当前虚拟机的动态调度主要通过周期性的获取同一资源池内的各个物理机的物理资源(处理器、内存、带宽等)的使用状态,并结合物理机的历史资源使用信息、历史迁移时长以及虚拟机的物理资源需求等信息,确定虚拟机的动态调度策略。例如,在物理机的处理器和/或内存资源的占用率超过预设阈值时,对物理机内的虚拟机进行迁移。图1中,当前时刻物理机1的CPU以及内存的占用率均小于预设阈值,但是根据历史资源使用数据,物理机1在未来的20分钟内CPU占用率会超过预设阈值且超过预设阈值的持续时间较长,而物理机2中CPU的占用率一直处于预设阈值之下且处理器资源满足物理机1中任一虚拟机的需求,则可以提前将物理机1中的部分虚拟机迁移到物理机2中。The current dynamic scheduling of virtual machines mainly uses periodic acquisition of the physical resources (processor, memory, bandwidth, etc.) usage status of each physical machine in the same resource pool, and combines the physical machine's historical resource usage information, historical migration duration, and virtual The physical resource requirements of the machine and other information determine the dynamic scheduling strategy of the virtual machine. For example, when the occupancy rate of the processor and/or memory resources of the physical machine exceeds a preset threshold, the virtual machine in the physical machine is migrated. In Figure 1, the CPU and memory occupancy rates of physical machine 1 at the current moment are less than the preset threshold, but according to historical resource usage data, the CPU occupancy rate of physical machine 1 will exceed the preset threshold and exceed the preset threshold in the next 20 minutes The threshold lasts for a long time, and the occupancy rate of the CPU in physical machine 2 has been below the preset threshold and the processor resources meet the needs of any virtual machine in physical machine 1, then part of the virtual machine in physical machine 1 can be virtualized in advance. The machine is migrated to physical machine 2.
当前资源池内资源的调度主要是根据同一虚拟机集群中各个物理机的物理资源的使用情况以及虚拟机的物理资源需求,在不同的物理机之间对虚拟机进行迁移,从而实现同一资源池内不同物理机之间负载均衡、提高资源利用率的目的。但是当前的虚拟机迁移仅仅考虑资源池中物理机的物理资源利用情况与虚拟机的物理资源需求,并不感知虚拟机中的业务,虚拟机在从原物理机迁移到新物理机中之后,新物理机并不一定满足虚拟机中实际运行的业务的需求,对实际业务的运行效果不好。The scheduling of resources in the current resource pool is mainly based on the use of physical resources of each physical machine in the same virtual machine cluster and the physical resource requirements of the virtual machines, and the migration of virtual machines between different physical machines, so as to realize the difference in the same resource pool. The purpose of load balancing between physical machines and improving resource utilization. However, the current virtual machine migration only considers the physical resource utilization of the physical machine in the resource pool and the physical resource demand of the virtual machine, and does not perceive the business in the virtual machine. After the virtual machine is migrated from the original physical machine to the new physical machine, The new physical machine does not necessarily meet the needs of the business actually running in the virtual machine, and has a bad effect on the operation of the actual business.
针对上述问题,本申请实施例提供一种资源调度方法,该方法通过周期性获取虚拟机的性能数据以及属性数据,根据性能数据对虚拟机进行聚类,并根据属性数据确定虚拟机中承载的业务以及不同业务之间的关系。在确定虚拟机所属的类别以及虚拟机中业务之间的关系之后,根据虚拟机所属的类别以及业务之间的关系,确定资源调度策略。其中,性能数据为虚拟机的不同性能指标的数据,包括CPU占用率、内存占用率、存储空间占用率、带宽占用率等,属性数据包括物理机接收到的数据包的源端口号、目的端口号、源互联网协议(internet protocol,IP)地址以及目的IP地址等。业务之间的关系是指不同虚拟机中承载的业务之间的关系,其中,业务之间的关系包括依赖关系、双向关系、单向关系、同族关系以及互斥关系等。依赖关系是指业务A的运行需要业务B提供的数据;双向关系是指业务A与业务B之间有数据交互;单向关系是指业务A采集数据提供给业务B;同族关系是指业务A和业务B都需要访问同一资源;互斥关系是指业务A与业务B不能运行在同一个虚拟机。例如,虚拟机VM14中的业务a是提供网页服务,虚拟机VM21中业务b是数据库业务,业务b为业务a提供网页服务需要的数据,则业务a与业务b之间的关系为依赖关系;虚拟机VM23中的 业务c是数据采集业务,其采集的数据提供给虚拟机VM42中的数据库业务d,则业务c和业务d之间为单向关系。In response to the above problems, embodiments of the present application provide a resource scheduling method. The method periodically obtains performance data and attribute data of virtual machines, clusters the virtual machines according to the performance data, and determines the virtual machines carried in the virtual machine according to the attribute data. Business and the relationship between different businesses. After determining the category to which the virtual machine belongs and the relationship between the services in the virtual machine, the resource scheduling strategy is determined according to the category to which the virtual machine belongs and the relationship between the services. Among them, the performance data is the data of different performance indicators of the virtual machine, including CPU occupancy, memory occupancy, storage space occupancy, bandwidth occupancy, etc., and attribute data includes the source port number and destination port of the data packet received by the physical machine Number, source Internet protocol (IP) address, destination IP address, etc. The relationship between services refers to the relationship between the services carried in different virtual machines, where the relationship between the services includes a dependency relationship, a two-way relationship, a one-way relationship, a family relationship, and a mutually exclusive relationship. Dependency relationship refers to the data provided by business B for the operation of business A; two-way relationship refers to data interaction between business A and business B; one-way relationship refers to business A collecting data and providing data to business B; family relationship refers to business A Both service B and service B need to access the same resource; mutually exclusive relationship means that service A and service B cannot run on the same virtual machine. For example, the business a in the virtual machine VM14 is to provide web services, the business b in the virtual machine VM21 is a database business, and the business b provides the data required by the web services for the business a, and the relationship between the business a and the business b is a dependency relationship; The service c in the virtual machine VM23 is a data collection service, and the collected data is provided to the database service d in the virtual machine VM42, then there is a one-way relationship between the service c and the service d.
如图2所示,图2是本申请实施例提供的一种资源池的结构示意图,该系统包括管理节点10与多个物理机20,每个物理机包括运行在该物理机上的多个虚拟机、虚拟机监视器(virtual machine monitor,VMM)210以及数据采集模块220。其中,数据采集模块220可以是VMM210中的一个模块,也可以是VMM210之外的一个模块,本申请实施例中以数据采集模块220是VMM210之外的一个模块为例进行说明。数据采集模块220用于采集上述性能数据与属性数据,并将性能数据与属性数据发送给管理节点10。管理节点10用于对各个物理机反馈的性能数据与属性数据进行分析并生成对应的资源调度策略,管理节点10包括数据分析模块110与管理模块120,数据分析模块110用于对数据采集模块220采集的数据进行分析,并将分析结果发送给管理模块120,管理模块120根据分析结果生成资源调度策略。需要说明的是,上述每个物理机的结构都是类似的,只是每个物理机中部署的虚拟机的数量以及每个物理机可以提供的各类物理资源有所差异。As shown in Figure 2, Figure 2 is a schematic structural diagram of a resource pool provided by an embodiment of the present application. The system includes a management node 10 and multiple physical machines 20. Each physical machine includes multiple virtual machines running on the physical machine. A virtual machine, a virtual machine monitor (VMM) 210, and a data collection module 220. The data collection module 220 may be a module in the VMM210 or a module other than the VMM210. In the embodiment of the present application, the data collection module 220 is a module other than the VMM210 as an example for description. The data collection module 220 is configured to collect the above-mentioned performance data and attribute data, and send the performance data and attribute data to the management node 10. The management node 10 is used to analyze the performance data and attribute data fed back by each physical machine and generate corresponding resource scheduling strategies. The management node 10 includes a data analysis module 110 and a management module 120. The data analysis module 110 is used to perform a data acquisition module 220 The collected data is analyzed, and the analysis result is sent to the management module 120, and the management module 120 generates a resource scheduling strategy according to the analysis result. It should be noted that the structure of each of the above physical machines is similar, except that the number of virtual machines deployed in each physical machine and the various physical resources that each physical machine can provide are different.
基于上述描述,本申请实施例提供一种资源调度方法,参见图3,图3是本申请实施例提供的一种资源调度方法的流程示意图,该方法包括:Based on the foregoing description, an embodiment of the present application provides a resource scheduling method. Refer to FIG. 3. FIG. 3 is a schematic flowchart of a resource scheduling method provided by an embodiment of the present application. The method includes:
S301、物理机获取每个虚拟机的性能数据与属性数据。S301. The physical machine obtains performance data and attribute data of each virtual machine.
本申请实施例中,每个物理机均具有各自的物理机标识PMi,例如物理机1的标识为PM1,物理机2的标识为PM2,物理机m的标识为PMm。每个物理机中的虚拟机具有虚拟机标识VMij,其中,i表示第i个物理机,j表示第j个虚拟机,VMij表示第i个物理机中的第j个虚拟机。例如虚拟机VM23,表示物理机2中的第3个虚拟机。In the embodiment of the present application, each physical machine has its own physical machine identification PMi, for example, the identification of physical machine 1 is PM1, the identification of physical machine 2 is PM2, and the identification of physical machine m is PMm. The virtual machine in each physical machine has a virtual machine identifier VMij, where i represents the i-th physical machine, j represents the j-th virtual machine, and VMij represents the j-th virtual machine in the i-th physical machine. For example, the virtual machine VM23 represents the third virtual machine in the physical machine 2.
每个物理机中的数据采集模块220包括性能数据采集模块2201与属性数据采集模块2202。性能数据采集模块2201获取物理机中每个虚拟机的性能数据,属性数据采集模块2202采集每个物理机接收到的数据包的属性数据。其中,性能数据包括每个虚拟机的CPU占用率、内存占用率、存储空间占用率以及带宽占用率等,属性数据包括数据包的源端口号、目的端口号、源IP地址与目的IP地址。目的IP地址用于确定数据包对应的目的虚拟机,目的端口号用于确定目的IP地址对应的目的虚拟机中承载的业务类型,源IP地址和目的IP地址用于确定进行数据交互的两个虚拟机。示例性的,数据包中的目的端口号是110,则表示接收该数据包的虚拟机提供的业务包括邮件服务业务,如果数据包中的目的端口号为80,则表示接收该数据包的虚拟机提供的业务包括网页服务。The data acquisition module 220 in each physical machine includes a performance data acquisition module 2201 and an attribute data acquisition module 2202. The performance data collection module 2201 obtains the performance data of each virtual machine in the physical machine, and the attribute data collection module 2202 collects the attribute data of the data packet received by each physical machine. Among them, the performance data includes the CPU occupancy rate, memory occupancy rate, storage space occupancy rate, and bandwidth occupancy rate of each virtual machine, and the attribute data includes the source port number, destination port number, source IP address, and destination IP address of the data packet. The destination IP address is used to determine the destination virtual machine corresponding to the data packet, the destination port number is used to determine the type of service carried in the destination virtual machine corresponding to the destination IP address, and the source IP address and destination IP address are used to determine the two data exchanges. virtual machine. Exemplarily, the destination port number in the data packet is 110, which means that the services provided by the virtual machine receiving the data packet include mail service services. If the destination port number in the data packet is 80, it means that the virtual machine receiving the data packet Services provided by the machine include web services.
S302、物理机将获取到的性能数据与属性数据发送给管理节点。S302: The physical machine sends the acquired performance data and attribute data to the management node.
本申请实施例中,性能数据采集模块2201发送给管理节点10的数据包括每个虚拟机的标识以及每个虚拟机对应的性能数据。属性数据采集模块2202发送给上述管理节点10的数据包括每个物理机的物理机标识以及物理机接收到的数据包的属性数据。在一种可能的实施例中,属性数据采集模块2202还可以根据每个数据包中的目的IP地址确定上述每个数据包所要到达的目的虚拟机,从而将每个虚拟机对应的属性数据发送给管理节点10。In the embodiment of the present application, the data sent by the performance data collection module 2201 to the management node 10 includes the identification of each virtual machine and the performance data corresponding to each virtual machine. The data sent by the attribute data collection module 2202 to the aforementioned management node 10 includes the physical machine identification of each physical machine and the attribute data of the data packet received by the physical machine. In a possible embodiment, the attribute data collection module 2202 may also determine the destination virtual machine to which each data packet is to be reached according to the destination IP address in each data packet, thereby sending the attribute data corresponding to each virtual machine To the management node 10.
S303、管理节点接收物理机发送的每个虚拟机的性能数据与属性数据。S303. The management node receives the performance data and attribute data of each virtual machine sent by the physical machine.
上述每个物理机中的数据采集模块220以预设周期将采集到的性能数据与属性数据发送给管理节点10,管理节点10接收上述性能数据与属性数据,并将上述性能数据与属性数据发送给管理节点10中的数据分析模块110。The data collection module 220 in each of the aforementioned physical machines sends the collected performance data and attribute data to the management node 10 in a preset period, and the management node 10 receives the aforementioned performance data and attribute data, and sends the aforementioned performance data and attribute data. To the data analysis module 110 in the management node 10.
S304、管理节点根据接收到的性能数据与属性数据进行分析,得到分析结果。S304. The management node performs analysis according to the received performance data and attribute data to obtain an analysis result.
本申请实施例中,上述分析结果包括资源池中每个虚拟机的类别以及虚拟机中运行的业务之间的关系。数据分析模块110包括聚类模块1101和业务分析模块1102,其中,聚类模块1101根据资源池中每个虚拟机的性能数据对虚拟机进行聚类,将资源池中的虚拟机分为多个类别。例如将虚拟机分为计算型虚拟机、存储型虚拟机、网络型虚拟机、计算和网络型虚拟机以及存储和网络型虚拟机。业务分析模块1102根据属性数据分析得到虚拟机中运行的业务之间的关系。在确定虚拟机所属的类型以及虚拟机中业务之间的关系之后,根据虚拟机所属的类型以及业务之间的关系,确定资源池的资源调度策略。In the embodiment of the present application, the foregoing analysis result includes the category of each virtual machine in the resource pool and the relationship between the services running in the virtual machine. The data analysis module 110 includes a clustering module 1101 and a business analysis module 1102. The clustering module 1101 clusters the virtual machines according to the performance data of each virtual machine in the resource pool, and divides the virtual machines in the resource pool into multiple category. For example, virtual machines are divided into computing virtual machines, storage virtual machines, network virtual machines, computing and network virtual machines, and storage and network virtual machines. The business analysis module 1102 analyzes and obtains the relationship between the businesses running in the virtual machine according to the attribute data. After determining the type of the virtual machine and the relationship between the services in the virtual machine, the resource scheduling strategy of the resource pool is determined according to the type of the virtual machine and the relationship between the services.
具体的,聚类模块1101在获取到每个虚拟机的虚拟机标识以及每个虚拟机标识对应的性能数据之后,根据聚类算法结合每个虚拟机的性能数据对资源池中的虚拟机进行聚类,得到多个类别的虚拟机。其中,聚类算法可以是K均值聚类算法、均值漂移聚类算法、模糊聚类算法等,本申请实施例不做限定。示例性的,聚类模块1101可以通过模糊C均值聚类算法(fuzzy c-means algorithm,FCM),根据上述每个虚拟机对应的性能数据对虚拟机进行聚类。采用FCM算法对虚拟机进行聚类的方法包括以下步骤:Specifically, after the clustering module 1101 obtains the virtual machine identifier of each virtual machine and the performance data corresponding to each virtual machine identifier, it performs a calculation on the virtual machines in the resource pool according to the clustering algorithm and the performance data of each virtual machine. Clustering to obtain multiple categories of virtual machines. Among them, the clustering algorithm may be a K-means clustering algorithm, a mean shift clustering algorithm, a fuzzy clustering algorithm, etc., which are not limited in the embodiment of the present application. Exemplarily, the clustering module 1101 may use a fuzzy c-means clustering algorithm (FCM) to cluster the virtual machines according to the performance data corresponding to each virtual machine. The method of clustering virtual machines using the FCM algorithm includes the following steps:
(1)以每个虚拟机的性能数据建立样本矩阵,并对样本矩阵中的数据进行标准化处理,将性能数据转换为[0,1]之间的数据。该样本矩阵包括M行N列,其中,M为样本数量,即资源池包括M个虚拟机,N为每个虚拟机的性能数据包括的指标数量,本申请实施例中,每个虚拟机的性能数据的指标包括CPU占用率、内存占用率、存储空间占用率与带宽占用率。该样本矩阵中的每一行数据代表一个虚拟机对应的N个性能数据,每一列为不同虚拟机同一个指标的数据;(1) Establish a sample matrix based on the performance data of each virtual machine, standardize the data in the sample matrix, and convert the performance data into data between [0, 1]. The sample matrix includes M rows and N columns, where M is the number of samples, that is, the resource pool includes M virtual machines, and N is the number of indicators included in the performance data of each virtual machine. Performance data indicators include CPU usage, memory usage, storage space usage, and bandwidth usage. Each row of data in the sample matrix represents N performance data corresponding to a virtual machine, and each column is data of the same indicator for different virtual machines;
(2)将上述M个虚拟机随机分为5个类别;(2) Randomly divide the above M virtual machines into 5 categories;
(3)计算每个类别的聚类中心,得到初始聚类中心Ci,i∈{1,2,3,4,5};(3) Calculate the cluster centers of each category, and obtain the initial cluster centers Ci,i ∈ {1, 2, 3, 4, 5};
重复下述(4)和(5)中的运算,直至各个样本的隶属度函数值收敛:Repeat the following operations in (4) and (5) until the membership function value of each sample converges:
(4)用当前的聚类中心计算每个虚拟机的隶属度函数;(4) Use the current cluster center to calculate the membership function of each virtual machine;
(5)用(4)中的隶属度函数重新计算重新各个聚类的中心,根据新的聚类中心对虚拟机进行聚类。(5) Use the membership function in (4) to recalculate the center of each cluster and cluster the virtual machines according to the new cluster center.
当上述(4)中隶属度函数值不再变化或者变化值小于预设阈值,确定聚类结果满足要求,将此时的聚类作为最终的虚拟机聚类结果。可以理解,虚拟机的类别可以表示虚拟机内承载的业务的类型,例如,若虚拟机VM12属于计算型虚拟机,表示该虚拟机主要需要的是CPU资源,则该虚拟机内承载的业务同样需要的是CPU资源。When the value of the membership function in (4) above does not change or the change value is less than the preset threshold, it is determined that the clustering result meets the requirements, and the clustering at this time is taken as the final virtual machine clustering result. It can be understood that the type of virtual machine can indicate the type of services carried in the virtual machine. For example, if the virtual machine VM12 is a computing virtual machine, it means that the virtual machine mainly needs CPU resources, and the services carried in the virtual machine are also the same. What is needed is CPU resources.
业务分析模块1102中包括特征配置库以及IP地址与虚拟机标识之间的对应关系,其中,特征配置库指示端口号与业务之间的关系,业务分析模块1102通过数据包中的目的端口号确定该数据包所属的业务,并根据数据包中的目的IP地址确定该数据包对应的虚拟机,从而确定该业务对应的虚拟机,得到虚拟机承载的业务。例如,物理机1中的属性数据采集模块2202采集到的一个数据包中的目的端口号为80,则表示该物理机中有虚拟机提供网页服务。然后根据该数据包中的目的IP地址,确定该目的IP地址对应的虚拟机的虚拟机标识为VM12,则表示虚拟机VM12提供网页服务业务。通过上述方法,可以得到每个虚拟机承载的业务。The service analysis module 1102 includes a feature configuration library and the corresponding relationship between the IP address and the virtual machine identifier. The feature configuration library indicates the relationship between the port number and the service, and the service analysis module 1102 determines the destination port number in the data packet. The service to which the data packet belongs, and the virtual machine corresponding to the data packet is determined according to the destination IP address in the data packet, thereby determining the virtual machine corresponding to the service, and obtaining the service carried by the virtual machine. For example, if the destination port number in a data packet collected by the attribute data collection module 2202 in the physical machine 1 is 80, it means that there are virtual machines in the physical machine that provide web services. Then, according to the destination IP address in the data packet, it is determined that the virtual machine identifier of the virtual machine corresponding to the destination IP address is VM12, which means that the virtual machine VM12 provides a web service service. Through the above method, the services carried by each virtual machine can be obtained.
进一步的,上述业务分析模块1102接收到的数据包括每个物理机的标识以及每个物理机接收到的数据包的属性数据,业务分析模块1102根据属性数据中的源IP地址与目的IP地址确定具有交互关系的两个虚拟机,并根据数据包对应的物理机标识确定具有交互关系的两个虚拟机所属的物理机。上述属性数据还包括数据包的源端口号、目的端口号,业务分析模块 1102确定具有交互关系的两个虚拟机之后,还可以进一步根据两个虚拟机发送的数据包中的目的端口号,分别确定各个虚拟机中承载的业务。示例性的,若物理机1接收到第一数据包中的源IP地址是VM24的地址,目的IP地址是物理机1中VM13的地址,第一数据包中的源端口号为a,目的端口号为b。物理机2中接收到的第二数据包中的源IP地址是VM13的地址,目的IP地址是物理机2中VM24的地址,第一数据包中的源端口号为b,目的端口号为a,则物理机1中的VM13与物理机2中的VM24具有交互关系,物理机1中的业务1与物理机2中的业务2具有联系,若第一数据包的数据量与第二数据包的数据量的差值小于预设差值阈值,则表示业务1与业务2是双向关系,若第一数据包的数据量与第二数据包的数据量的差值大于或者等于预设差值阈值,例如第一数据包的数据量大于第二数据包的数据量且差值大于或者等于预设差值阈值,则表示业务1主要是给业务2提供数据,即业务1与业务2是依赖关系。Further, the data received by the service analysis module 1102 includes the identification of each physical machine and the attribute data of the data packet received by each physical machine. The service analysis module 1102 determines according to the source IP address and the destination IP address in the attribute data. Two virtual machines having an interactive relationship are determined, and the physical machine to which the two virtual machines having an interactive relationship belong is determined according to the physical machine identifier corresponding to the data packet. The above attribute data also includes the source port number and the destination port number of the data packet. After the service analysis module 1102 determines the two virtual machines that have an interactive relationship, it can further determine the destination port number in the data packet sent by the two virtual machines. Determine the services carried in each virtual machine. Exemplarily, if the source IP address in the first data packet received by physical machine 1 is the address of VM24, the destination IP address is the address of VM13 in physical machine 1, the source port number in the first data packet is a, and the destination port The number is b. The source IP address in the second data packet received in physical machine 2 is the address of VM13, the destination IP address is the address of VM24 in physical machine 2, the source port number in the first data packet is b, and the destination port number is a , VM13 in physical machine 1 and VM24 in physical machine 2 have an interactive relationship, and business 1 in physical machine 1 is related to business 2 in physical machine 2. If the data volume of the first data packet is the same as that of the second data packet The difference between the data volume of is less than the preset difference threshold, it means that service 1 and service 2 are in a two-way relationship. If the difference between the data volume of the first data packet and the data volume of the second data packet is greater than or equal to the preset difference Threshold, for example, the data volume of the first data packet is greater than the data volume of the second data packet and the difference is greater than or equal to the preset difference threshold, it means that service 1 mainly provides data for service 2, that is, service 1 and service 2 are dependent relationship.
S305、管理节点根据分析结果对虚拟机进行调度。S305. The management node schedules the virtual machine according to the analysis result.
数据分析模块110将资源池中的虚拟机进行分类得到多个类别的虚拟机之后,管理模块120根据每个类别的多个虚拟机的资源分配数据以及资源使用数据,确定资源池的资源使用指标Pu以及资源性能指标Ru。其中,资源分配数据指每个虚拟机被分配的资源的量,包括CPU资源、内存资源、带宽资源以及存储资源;资源使用数据指每个虚拟机使用的资源,包括CPU占用量、内存占用量、存储空间占用量以及带宽占用量,上述资源使用数据可以是根据每个虚拟机对应的性能数据以及上述资源分配数据计算得到,也可以上述性能数据采集模块2201采集得到后,作为性能数据的一部分发送给管理节点。After the data analysis module 110 classifies the virtual machines in the resource pool to obtain multiple types of virtual machines, the management module 120 determines the resource usage index of the resource pool according to the resource allocation data and resource usage data of the multiple virtual machines in each category Pu and resource performance index Ru. Among them, resource allocation data refers to the amount of resources allocated to each virtual machine, including CPU resources, memory resources, bandwidth resources, and storage resources; resource usage data refers to the resources used by each virtual machine, including CPU usage and memory usage , Storage space occupation and bandwidth occupation, the above resource usage data can be calculated based on the performance data corresponding to each virtual machine and the above resource allocation data, or it can be collected by the above performance data collection module 2201 and used as part of the performance data Sent to the management node.
在确定资源池的资源使用指标Pu以及资源性能指标Ru之后,根据预设条件确定是否对虚拟机进行调度。若以提高资源池的综合利用率作为资源调度的目标,资源池的综合利用率的值为U=Pu/Ru,则在U的值大于或者等于预设综合利用率阈值时,不对虚拟机进行调度,在U的值小于预设综合利用率阈值时,对虚拟机进行调度。若以资源池的性能优先作为资源调度的目标,则在Ru大于或者等于资源性能指标阈值时,不对虚拟机进行调度,在Ru小于资源性能指标阈值时,对虚拟机进行调度。若以资源池的资源使用率优先作为资源调度的目标,则在Pu的值大于或者等于资源使用指标阈值时,不对虚拟机进行调度,在Pu的值小于资源使用指标阈值时,对虚拟机进行调度。After determining the resource usage index Pu and the resource performance index Ru of the resource pool, it is determined whether to schedule the virtual machine according to a preset condition. If improving the comprehensive utilization of the resource pool as the goal of resource scheduling, the value of the comprehensive utilization of the resource pool is U=Pu/Ru, then when the value of U is greater than or equal to the preset comprehensive utilization threshold, the virtual machine is not Scheduling, when the value of U is less than the preset comprehensive utilization threshold, the virtual machine is scheduled. If the performance of the resource pool is prioritized as the resource scheduling target, when Ru is greater than or equal to the resource performance indicator threshold, the virtual machine is not scheduled, and when Ru is less than the resource performance indicator threshold, the virtual machine is scheduled. If the resource usage rate of the resource pool is prioritized as the resource scheduling target, when the value of Pu is greater than or equal to the resource usage index threshold, the virtual machine is not scheduled, and when the value of Pu is less than the resource usage index threshold, the virtual machine is Scheduling.
在根据上述方法确定需要对虚拟机进行调度时,例如以提高资源池的综合利用率作为资源调度的目标,在U的值小于预设综合利用率阈值时,根据上述业务之间的关系、虚拟机所属的类别以及根据虚拟机的类别确定的虚拟机对资源的需求,确定对资源池内的虚拟机进行调度的策略,在根据调度策略对虚拟机进行调度之后,再次执行上述S301~S305中的步骤,计算调度后的Pu与Ru,直至U的值大于或者等于预设综合利用率阈值。上述策略包括将具有单向关系、双向关系或者依赖关系的两个业务所在的虚拟机迁移到同一个物理机中,或者,将具有单向关系、双向关系或者依赖关系的两个业务所在的虚拟机迁移到相近的两个物理机中,其中,相近是指数据从一个物理机传输到另一个物理机的路径开销较小。例如,业务a运行在虚拟机VM11中,业务b运行在虚拟机VM54中,业务a与业务b之间具有双向关系,则可以将虚拟机VM54从物理机5迁移到物理机1中,使虚拟机VM11与虚拟机VM54位于同一个物理机中。若业务b需要的是CPU资源,物理机1的CPU占用率较高,物理机1与物理机2之间的路径开销小于物理机1与物理机5之间的路径开销,且物理机2的CPU占用率较低,则将VM54迁移到物理机2中。When it is determined according to the above method that virtual machines need to be scheduled, for example, to improve the comprehensive utilization of the resource pool as the goal of resource scheduling, when the value of U is less than the preset comprehensive utilization threshold, according to the relationship between the above-mentioned services, virtual The category to which the machine belongs and the demand for resources of the virtual machine determined according to the category of the virtual machine, determine the strategy for scheduling the virtual machine in the resource pool, and after the virtual machine is scheduled according to the scheduling strategy, perform the above S301~S305 again Step: Calculate the scheduled Pu and Ru until the value of U is greater than or equal to the preset comprehensive utilization threshold. The above strategies include migrating the virtual machines of two services with one-way relationship, two-way relationship or dependent relationship to the same physical machine, or transferring two virtual machines with one-way relationship, two-way relationship or dependent relationship to the same physical machine. Machines are migrated to two similar physical machines, where similarity means that the path overhead for data transmission from one physical machine to another physical machine is small. For example, business a runs in virtual machine VM11, business b runs in virtual machine VM54, and there is a two-way relationship between business a and business b, then virtual machine VM54 can be migrated from physical machine 5 to physical machine 1, so that the virtual The machine VM11 and the virtual machine VM54 are located in the same physical machine. If service b requires CPU resources, the CPU occupancy rate of physical machine 1 is relatively high, the path cost between physical machine 1 and physical machine 2 is less than the path cost between physical machine 1 and physical machine 5, and the cost of physical machine 2 If the CPU usage is low, VM54 is migrated to physical machine 2.
在一种可能的实施方式中,管理模块120通过获取每个类别的虚拟机中每个虚拟机的资源占用数据,计算每个类别的虚拟机的资源使用指标,进而计算资源池的资源使用指标。其中,资源占用数据包括CPU占用量、内存占用量、存储空间占用量以及带宽占用量。示例性的,管理模块120获取第i个类别的虚拟机中每个虚拟机的资源占用数据之后,分别计算每类数据的平均值,得到第i个类别的虚拟机对应的资源占用数据P i={p icpu,p imem,p isto,p bw},其中,p icpu表示第i个类别的虚拟机的CPU平均占用量,p imem表示第i个类别的虚拟机的内存平均占用量,p isto表示第i个类别的虚拟机的存储空间平均占用量,r ibw表示第i个类别的虚拟机的带宽平均占用量,则第i个类别的虚拟机的资源使用指标P i可以表示为: In a possible implementation manner, the management module 120 obtains resource occupancy data of each virtual machine in each type of virtual machine, calculates the resource usage index of each type of virtual machine, and then calculates the resource usage index of the resource pool. . Among them, the resource occupation data includes CPU occupation, memory occupation, storage space occupation, and bandwidth occupation. Exemplarily, after obtaining the resource occupation data of each virtual machine in the i-th category of virtual machines, the management module 120 calculates the average value of each type of data to obtain the resource occupation data P i corresponding to the i-th category of virtual machines. ={p icpu , p imem , p isto , p bw }, where p icpu represents the average CPU usage of virtual machines in the i-th category, p imem represents the average memory usage of virtual machines in the i-th category, p isto represents the average storage space occupied by virtual machines of the i-th category, r ibw represents the average bandwidth occupied by virtual machines of the i-th category, and the resource usage index P i of the virtual machines of the i-th category can be expressed as:
Figure PCTCN2020139902-appb-000001
Figure PCTCN2020139902-appb-000001
其中,a,b,c,d分别代表对应物理资源的系数。则资源池的资源使用指标P u为: Among them, a, b, c, and d represent the coefficients of the corresponding physical resources. Then the resource usage index P u of the resource pool is:
Figure PCTCN2020139902-appb-000002
Figure PCTCN2020139902-appb-000002
其中,n为虚拟机的类别数。Among them, n is the number of categories of virtual machines.
管理模块120通过获取每个类别的虚拟机中每个虚拟机的资源分配数据,计算每个类别的虚拟机的资源性能指标,进而计算资源池的资源性能指标。管理模块120获取第i个类别的虚拟机中每个虚拟机的资源分配数据之后,分别计算每类数据的平均值,得到第i个类别的虚拟机对应的资源分配数据,R i={r icpu,r imem,r isto、r ibw},其中,r icpu表示第i个类别的虚拟机分配的CPU的平均值,r imem表示第i个类别的虚拟机分配的内存的平均值,r isto表示第i个类别的虚拟机分配的存储空间的平均值,r ibw表示第i个类别的虚拟机分配的带宽的平均值,则第i个类别的虚拟机的资源性能指标R i可以表示为: The management module 120 obtains the resource allocation data of each virtual machine in each type of virtual machine, calculates the resource performance index of each type of virtual machine, and then calculates the resource performance index of the resource pool. After the management module 120 obtains the resource allocation data of each virtual machine in the i-th category of virtual machines, it calculates the average value of each type of data to obtain the resource allocation data corresponding to the i-th category of virtual machines, R i ={r icpu , r imem , r isto , r ibw }, where r icpu represents the average value of the CPU allocated by the virtual machine of the i-th category, rimem represents the average memory allocated by the virtual machine of the i-th category, and r isto Represents the average value of the storage space allocated by the virtual machines of the i-th category, r ibw represents the average value of the bandwidth allocated by the virtual machines of the i-th category, then the resource performance index R i of the virtual machines of the i-th category can be expressed as :
Figure PCTCN2020139902-appb-000003
Figure PCTCN2020139902-appb-000003
其中,x,y,z,w分别为对应物理资源的系数。则资源池的资源性能指标R u为: Among them, x, y, z, w are coefficients corresponding to physical resources. Then the resource performance index Ru of the resource pool is:
Figure PCTCN2020139902-appb-000004
Figure PCTCN2020139902-appb-000004
通过实施上述实施例,资源池中的每个物理机周期性的获取每个虚拟机的性能数据以及每个物理机中接收到的数据包的属性数据,并将获取到的性能数据与属性数据发送给管理节点,管理节点根据上述性能数据对资源池中的虚拟机进行聚类,并根据上述属性数据中的地址信息以及端口号信息等,感知虚拟机内部承载的业务的感知,以及虚拟机承载的业务之间的关系。管理节点在根据聚类后的每个类别的虚拟机的性能数据确定是否需要对资源池中的资源进行调度,在需要对资源进行调度的情况下,根据虚拟机所属的类别确定虚拟机内的业务所需要的资源,根据业务所述的资源以及业务之间的联系对资源池中的资源进行调度,从而在对资源池中的资源进行调度时,实现感知虚拟机中的业务以确定业务需要的资源,根据义务需要的资源以及业务之间的关系进行资源的调度,使得对资源池中的资源进行调度后更能满足实际业务的需求。By implementing the above-mentioned embodiments, each physical machine in the resource pool periodically obtains the performance data of each virtual machine and the attribute data of the data packets received in each physical machine, and combines the obtained performance data and attribute data Sent to the management node, the management node clusters the virtual machines in the resource pool according to the above-mentioned performance data, and perceives the perception of the services carried in the virtual machine according to the address information and port number information in the above-mentioned attribute data, and the virtual machine The relationship between the services carried. The management node determines whether the resources in the resource pool need to be scheduled based on the clustered performance data of each category of virtual machine. When resources need to be scheduled, the management node determines the virtual machine's status according to the category to which the virtual machine belongs. For the resources required by the business, the resources in the resource pool are scheduled according to the resources described in the business and the connections between the services, so that when the resources in the resource pool are scheduled, the services in the virtual machine can be sensed to determine the business needs The resource is scheduled according to the resource required by the obligation and the relationship between the services, so that the resources in the resource pool can be scheduled to better meet the actual business needs.
值得说明的是,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组 合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明所必须的。It is worth noting that for the above method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described sequence of actions. Secondly, Those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.
本领域的技术人员根据以上描述的内容,能够想到的其他合理的步骤组合,也属于本发明的保护范围内。其次,本领域技术人员也应该熟悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明所必须的。Based on the content described above, those skilled in the art can think of other reasonable step combinations that also fall within the protection scope of the present invention. Secondly, those skilled in the art should also be familiar with that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.
上文结合图1至图3详细描述了本申请实施例提供的资源调度方法,下面结合图4和图5,描述实现本申请实施例提供的实现资源调度的相关装置与设备。图4是本申请实施例提供的一种资源调度装置的结构示意图,所述资源调度装置400部署于上述管理节点10中,实现上述管理节点10的功能。该资源调度装置400包括通信单元410和处理单元420,其中,The resource scheduling method provided by the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 3. The following describes related devices and equipment for implementing resource scheduling provided by the embodiment of the present application with reference to FIG. 4 and FIG. 5. FIG. 4 is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present application. The resource scheduling device 400 is deployed in the above-mentioned management node 10 to realize the functions of the above-mentioned management node 10. The resource scheduling device 400 includes a communication unit 410 and a processing unit 420, where:
通信单元410,用于接收资源池中各个物理机发送的性能数据和属性数据,其中,性能数据包括资源池中每个虚拟机的物理资源信息,所述属性数据包括接收到的数据包的端口号与地址信息。具体的,通信单元410执行上述管理节点10的接收和发送的动作,例如上述图3中的S303中所描述的接收性能数据与属性数据,在此不再赘述。The communication unit 410 is configured to receive performance data and attribute data sent by each physical machine in the resource pool, where the performance data includes physical resource information of each virtual machine in the resource pool, and the attribute data includes the port of the received data packet Number and address information. Specifically, the communication unit 410 executes the receiving and sending actions of the management node 10, such as the receiving performance data and the attribute data described in S303 in FIG. 3, which will not be repeated here.
处理单元420,用于根据上述性能数据对资源池中的多个虚拟机进行聚类,得到多个虚拟机集群;并根据上述属性数据确定上述多个虚拟机中的业务之间的业务关系。处理单元420对上述资源池中的虚拟机进行聚类的方法可以参照上述S304中聚类模块1101执行的方法,处理单元420根据属性数据确定虚拟机中承载的业务之间的关系的方法可以参照上述S304中业务分析模块1102执行的方法,本申请实施例不再赘述。The processing unit 420 is configured to cluster multiple virtual machines in the resource pool according to the above-mentioned performance data to obtain multiple virtual machine clusters; and determine the business relationship between the services in the above-mentioned multiple virtual machines according to the above-mentioned attribute data. The method for the processing unit 420 to cluster the virtual machines in the above resource pool can refer to the method executed by the clustering module 1101 in the above S304, and the method for the processing unit 420 to determine the relationship between the services carried in the virtual machines according to the attribute data can refer to The method executed by the service analysis module 1102 in the foregoing S304 will not be repeated in this embodiment of the application.
处理单元420,还用于根据上述多个虚拟机集群中每个虚拟机集群的性能数据,确定对资源池中的资源进行调度,然后根据上述多个虚拟机中业务之间的业务关系,对资源池中的资源进行调度。该组员调度包括对部分虚拟机进行迁移、超配比例调度、NUMA聚合等。具体的,处理单元420确定是否对虚拟机中的资源进行调度的方法可参照上述S305中,管理模块120根据资源使用指标与资源性能指标确定是都对资源进行调度的方法。在处理单元420确定对资源池中的资源进行调度的情况下,处理单元420对资源进行调度的策略可参照上述S305中管理模块120根据业务之间的关系对生成对资源进行调度的策略,在此不再赘述。The processing unit 420 is further configured to determine the scheduling of the resources in the resource pool according to the performance data of each virtual machine cluster in the multiple virtual machine clusters, and then, according to the business relationship between the services in the multiple virtual machine clusters, The resources in the resource pool are scheduled. The group member scheduling includes migration of some virtual machines, overproportional scheduling, NUMA aggregation, and so on. Specifically, the method for the processing unit 420 to determine whether to schedule the resources in the virtual machine may refer to the above S305. The management module 120 determines based on the resource usage index and the resource performance index to determine whether to schedule the resources. In the case that the processing unit 420 determines to schedule the resources in the resource pool, the strategy for the processing unit 420 to schedule the resources can refer to the strategy for scheduling resources generated by the management module 120 in S305 according to the relationship between the services. This will not be repeated here.
所述通信单元420,还用于处理单元420在确定对资源池中的资源进行调度,并根据业务之间的关系生成资源调度策略之后,通信单元420还用于将资源调度策略发送给资源池中的物理机,以使接收到资源调度策略的物理机根据资源调度侧率进行资源调度。The communication unit 420 is also used for the processing unit 420 after determining to schedule the resources in the resource pool and generating a resource scheduling policy according to the relationship between services, the communication unit 420 is also used for sending the resource scheduling policy to the resource pool In order to make the physical machine receiving the resource scheduling policy perform resource scheduling according to the resource scheduling side rate.
具体的,该资源调度装置300实现资源调度的操作可以参照上述方法实施例中管理节点10执行的操作,在此不再赘述。Specifically, the operation of the resource scheduling apparatus 300 to implement resource scheduling may refer to the operations performed by the management node 10 in the foregoing method embodiment, and details are not described herein again.
图5为本申请实施例提供的一种计算设备的结构示意图,该计算设备500实现上述实施例中的管理节点10的功能,执行上述实施例中的资源调度方法。该资源调度装置500至少包括:处理器510、通信接口520以及存储器530。可选的,所述处理器510、通信接口520以及存储器530通过总线540相互连接,其中,FIG. 5 is a schematic structural diagram of a computing device provided by an embodiment of the application. The computing device 500 implements the function of the management node 10 in the foregoing embodiment and executes the resource scheduling method in the foregoing embodiment. The resource scheduling device 500 includes at least: a processor 510, a communication interface 520, and a memory 530. Optionally, the processor 510, the communication interface 520, and the memory 530 are connected to each other through a bus 540, where:
所述处理器510用于实现上述数据分析模块110和管理模块120执行的操作,处理器510执行各种操作的具体实现可参照上述方法实施例中以管理节点10为执行主体执行的具体操作。例如处理器510用于执行上述图3中S304与S305中管理节点10的操作等,在此不再赘述。The processor 510 is configured to implement the operations performed by the above-mentioned data analysis module 110 and the management module 120. The specific implementation of the various operations performed by the processor 510 may refer to the specific operations performed by the management node 10 in the foregoing method embodiment. For example, the processor 510 is configured to perform operations of the management node 10 in S304 and S305 in FIG.
处理器510可以有多种具体实现形式,例如处理器510可以为中央处理器(central  processing unit,CPU)或图像处理器(graphics processing unit,GPU),处理器510还可以是单核处理器或多核处理器。处理器510可以由CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。处理器510也可以单独采用内置处理逻辑的逻辑器件来实现,例如FPGA或数字信号处理器(digital signal processor,DSP)等。The processor 510 may have a variety of specific implementation forms. For example, the processor 510 may be a central processing unit (CPU) or a graphics processing unit (GPU), and the processor 510 may also be a single-core processor or Multi-core processor. The processor 510 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 510 may also be implemented by a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (digital signal processor, DSP).
通信接口520可以为有线接口或无线接口,用于与其他模块或设备进行通信,有线接口可以是以太接口、局域互联网络(local interconnect network,LIN)等,无线接口可以是蜂窝网络接口或使用无线局域网接口等。The communication interface 520 can be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface can be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface can be a cellular network interface or use Wireless LAN interface, etc.
本申请实施例中通信接口520执行上述管理节点10的接收和发送操作,例如,可用于执行上述S303中接收用户终端发送的虚拟机的性能数据与属性数据等,在此不再赘述。In the embodiment of the present application, the communication interface 520 executes the receiving and sending operations of the management node 10, for example, can be used to execute the performance data and attribute data of the virtual machine sent by the user terminal in S303, which will not be repeated here.
存储器530可以是非易失性存储器,例如,只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。存储器530也可以是易失性存储器,易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。The memory 530 may be a non-volatile memory, for example, read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), Electrically erasable programmable read-only memory (EPROM, EEPROM) or flash memory. The memory 530 may also be a volatile memory, and the volatile memory may be a random access memory (RAM), which is used as an external cache.
存储器530也可用于存储指令和数据,以便于处理器510调用存储器530中存储的指令实现上述数据分析模块110和管理模块120执行的操作,例如上述方法实施例中对虚拟机进行聚类的操作。此外,计算设备500可能包含相比于图5展示的更多或者更少的组件,或者有不同的组件配置方式。The memory 530 may also be used to store instructions and data, so that the processor 510 can call the instructions stored in the memory 530 to implement the operations performed by the data analysis module 110 and the management module 120, such as the clustering operation of virtual machines in the foregoing method embodiment. . In addition, the computing device 500 may include more or fewer components than those shown in FIG. 5, or may have different component configurations.
总线540可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线540可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 540 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 540 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used to represent in FIG. 5, but it does not mean that there is only one bus or one type of bus.
可选地,该服务器500还可以包括输入/输出接口550,输入/输出接口550连接有输入/输出设备,用于接收输入的信息,输出操作结果。Optionally, the server 500 may further include an input/output interface 550, and the input/output interface 550 is connected to an input/output device for receiving input information and outputting operation results.
具体地,上述协调服务器500执行各种操作的具体实现可参照上述方法实施例中管理节点执行的具体操作,在此不再赘述。Specifically, for the specific implementation of various operations performed by the aforementioned coordination server 500, reference may be made to the specific operations performed by the management node in the foregoing method embodiments, and details are not described herein again.
本申请实施例还提供一种非瞬态计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当计算机程序在处理器上运行时,可以实现上述方法实施例中的管理节点执行的方法步骤,所述计算机存储介质的处理器在执行上述方法步骤的具体实现可参照上述方法实施例中管理节点的具体操作,在此不再赘述。The embodiments of the present application also provide a non-transitory computer-readable storage medium in which a computer program is stored. When the computer program runs on a processor, the management node in the above-mentioned method embodiment can be implemented. For the method steps to be executed, the processor of the computer storage medium may refer to the specific operations of the management node in the method embodiment for the specific implementation of the above method steps, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For a part that is not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或 者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The above-mentioned embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above-mentioned embodiments may be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more sets of available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
本申请实施例方法中的步骤可以根据实际需要进行顺序调度、合并或删减;本申请实施例装置中的模块可以根据实际需要进行划分、合并或删减。The steps in the method in the embodiment of the present application may be sequentially scheduled, merged, or deleted according to actual needs; the modules in the device in the embodiment of the present application may be divided, merged, or deleted according to actual needs.
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the application are described in detail above, and specific examples are used in this article to illustrate the principles and implementation of the application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the application; at the same time, for Those of ordinary skill in the art, based on the idea of the application, will have changes in the specific implementation and the scope of application. In summary, the content of this specification should not be construed as a limitation to the application.

Claims (10)

  1. 一种资源调度方法,其特征在于,包括:A resource scheduling method, characterized in that it comprises:
    获取资源池中多个虚拟机中每个虚拟机的性能数据与每个虚拟机的属性数据,其中,所述性能数据包括所述每个虚拟机的物理资源信息,所述属性数据包括数据包的端口号信息与地址信息;Acquire performance data of each virtual machine and attribute data of each virtual machine in the multiple virtual machines in the resource pool, where the performance data includes physical resource information of each virtual machine, and the attribute data includes data packets Port number information and address information;
    根据所述性能数据对所述多个虚拟机进行聚类,得到多个虚拟机集群;Clustering the multiple virtual machines according to the performance data to obtain multiple virtual machine clusters;
    根据所述属性数据确定所述多个虚拟机中的业务之间的业务关系;Determining the business relationship between the services in the multiple virtual machines according to the attribute data;
    在根据每个虚拟机集群中虚拟机的性能数据确定对所述资源池中的虚拟机进行调度时,根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的虚拟机进行调度。When it is determined to schedule the virtual machines in the resource pool according to the performance data of the virtual machines in each virtual machine cluster, the virtual machines in the resource pool are determined according to the business relationship between the services in the multiple virtual machines. Machine for scheduling.
  2. 根据权利要求1所述的方法,其特征在于,所述根据每个虚拟机集群中虚拟机的性能数据,确定对所述资源池中的虚拟机进行调度,包括:The method according to claim 1, wherein the determining, according to the performance data of the virtual machines in each virtual machine cluster, to schedule the virtual machines in the resource pool comprises:
    获取所述每个虚拟机集群中每个虚拟机的资源使用数据,确定所述每个虚拟机集群的资源使用指标,并根据所述每个虚拟机集群的资源使用指标确定所述资源池的资源使用指标;Acquire the resource usage data of each virtual machine in each virtual machine cluster, determine the resource usage index of each virtual machine cluster, and determine the resource usage index of the resource pool according to the resource usage index of each virtual machine cluster Resource usage indicators;
    获取所述每个虚拟机集群中每个虚拟机的资源分配数据,确定所述每个虚拟机集群的资源性能指标,并根据每个虚拟机集群的资源性能指标确定资源池的资源性能指标;Acquiring the resource allocation data of each virtual machine in each virtual machine cluster, determining the resource performance index of each virtual machine cluster, and determining the resource performance index of the resource pool according to the resource performance index of each virtual machine cluster;
    根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的资源进行调度。According to the resource usage index of the resource pool and the resource performance index of the resource pool, it is determined to schedule the resources in the resource pool.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的资源进行调度,包括:The method according to claim 2, wherein the determining to schedule the resources in the resource pool according to the resource usage index of the resource pool and the resource performance index of the resource pool comprises:
    在所述资源池的资源使用指标与资源性能指标的比值小于第一阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case where the ratio of the resource usage index to the resource performance index of the resource pool is less than the first threshold, determine to schedule the resources in the resource pool; or,
    在所述资源池的资源性能指标小于第二阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case that the resource performance index of the resource pool is less than the second threshold, determine to schedule the resources in the resource pool; or,
    在所述资源池的资源使用指标小于第三阈值的情况下,确定对所述资源池中的资源进行调度。In the case that the resource usage index of the resource pool is less than the third threshold, it is determined to schedule the resources in the resource pool.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的资源进行调度,包括:The method according to any one of claims 1 to 3, wherein the scheduling of the resources in the resource pool according to the business relationship between the services in the multiple virtual machines comprises:
    在确定第一虚拟机中的第一业务与第二虚拟机中的第二业务之间具有关联关系的情况下,将所述第一虚拟机与所述第二虚拟机迁移到同一个物理机,或者,将所述第一虚拟机迁移到第一物理机,将所述第二虚拟机迁移到第二物理机,所述第一物理机与所述第二物理机之间的路径开销小于第三物理机与第四物理机之间的路径开销,其中,在虚拟机迁移之前,所述第一虚拟机位于所述第三物理机,所述第二虚拟机位于所述第四物理机,所述关联关系包括依赖关系、单向关系、双向关系以及同族关系。When it is determined that there is an association relationship between the first service in the first virtual machine and the second service in the second virtual machine, migrate the first virtual machine and the second virtual machine to the same physical machine , Or, migrating the first virtual machine to a first physical machine, and migrating the second virtual machine to a second physical machine, and the path overhead between the first physical machine and the second physical machine is less than The path overhead between the third physical machine and the fourth physical machine, where, before the virtual machine is migrated, the first virtual machine is located in the third physical machine, and the second virtual machine is located in the fourth physical machine , The association relationship includes a dependency relationship, a one-way relationship, a two-way relationship, and a family relationship.
  5. 一种资源调度装置,其特征在于,所述装置包括:A resource scheduling device, characterized in that the device includes:
    通信单元,用于:获取资源池中多个虚拟机中每个虚拟机的性能数据,所述性能数据包 括所述每个虚拟机的物理资源信息;The communication unit is configured to: obtain performance data of each virtual machine in the multiple virtual machines in the resource pool, where the performance data includes physical resource information of each virtual machine;
    获取资源池中多个虚拟机中每个虚拟机对应的数据包的属性数据,所述属性数据包括数据包的端口号信息与地址信息;Acquiring attribute data of a data packet corresponding to each of the multiple virtual machines in the resource pool, where the attribute data includes port number information and address information of the data packet;
    处理单元,用于:根据所述性能数据对所述多个虚拟机进行聚类,得到多个虚拟机集群;A processing unit, configured to: cluster the multiple virtual machines according to the performance data to obtain multiple virtual machine clusters;
    根据所述属性数据确定所述多个虚拟机中的业务之间的业务关系;Determining the business relationship between the services in the multiple virtual machines according to the attribute data;
    在根据所述每个虚拟机集群中虚拟机的性能数据,确定对所述资源池中的虚拟机进行调度时根据所述多个虚拟机中业务之间的业务关系,对所述资源池中的资源进行调度。When determining to schedule the virtual machines in the resource pool according to the performance data of the virtual machines in each virtual machine cluster, according to the business relationship between the services in the multiple virtual machines, Resources for scheduling.
  6. 根据权利要求5所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 5, wherein the processing unit is specifically configured to:
    获取所述每个虚拟机集群中每个虚拟机的资源使用数据,确定所述每个虚拟机集群的资源使用指标,并根据所述每个虚拟机集群的资源使用指标确定所述资源池的资源使用指标;Acquire the resource usage data of each virtual machine in each virtual machine cluster, determine the resource usage index of each virtual machine cluster, and determine the resource usage index of the resource pool according to the resource usage index of each virtual machine cluster Resource usage indicators;
    获取所述每个虚拟机集群中每个虚拟机的资源分配数据,确定所述每个虚拟机集群的资源性能指标,并根据每个虚拟机集群的资源性能指标确定资源池的资源性能指标;Acquiring the resource allocation data of each virtual machine in each virtual machine cluster, determining the resource performance index of each virtual machine cluster, and determining the resource performance index of the resource pool according to the resource performance index of each virtual machine cluster;
    根据所述资源池的资源使用指标和所述资源池的资源性能指标,确定对所述资源池中的资源进行调度。According to the resource usage index of the resource pool and the resource performance index of the resource pool, it is determined to schedule the resources in the resource pool.
  7. 根据权利要求6所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 6, wherein the processing unit is specifically configured to:
    在所述资源池的资源使用指标与资源性能指标的比值小于第一阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case where the ratio of the resource usage index to the resource performance index of the resource pool is less than the first threshold, determine to schedule the resources in the resource pool; or,
    在所述资源池的资源性能指标小于第二阈值的情况下,确定对所述资源池中的资源进行调度;或者,In the case that the resource performance index of the resource pool is less than the second threshold, determine to schedule the resources in the resource pool; or,
    在所述资源池的资源使用指标小于第三阈值的情况下,确定对所述资源池中的资源进行调度。In the case that the resource usage index of the resource pool is less than the third threshold, it is determined to schedule the resources in the resource pool.
  8. 根据权利要求5至7任一项所述的装置,其特征在于,所述处理单元具体用于:The device according to any one of claims 5 to 7, wherein the processing unit is specifically configured to:
    在确定第一虚拟机中的第一业务与第二虚拟机中的第二业务之间具有关联关系的情况下,将所述第一虚拟机与所述第二虚拟机迁移到同一个物理机,或者,将所述第一虚拟机迁移到第一物理机,将所述第二虚拟机迁移到第二物理机,所述第一物理机与所述第二物理机之间的路径开销小于第三物理机与第四物理机之间的路径开销,其中,在虚拟机迁移之前,所述第一虚拟机位于所述第三物理机,所述第二虚拟机位于所述第四物理机,所述关联关系包括依赖关系、单向关系、双向关系以及同族关系。When it is determined that there is an association relationship between the first service in the first virtual machine and the second service in the second virtual machine, migrate the first virtual machine and the second virtual machine to the same physical machine , Or, migrating the first virtual machine to a first physical machine, and migrating the second virtual machine to a second physical machine, and the path overhead between the first physical machine and the second physical machine is less than The path overhead between the third physical machine and the fourth physical machine, where, before the virtual machine is migrated, the first virtual machine is located in the third physical machine, and the second virtual machine is located in the fourth physical machine , The association relationship includes a dependency relationship, a one-way relationship, a two-way relationship, and a family relationship.
  9. 一种计算设备,其特征在于,包括处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器执行所述指令时,所述计算设备执行如权利要求1至4任一项所述的方法。A computing device, characterized by comprising a processor and a memory, the memory is used to store instructions, the processor is used to execute the instructions, and when the processor executes the instructions, the computing device executes The method of any one of claims 1 to 4.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,所述处理器执行如权利要求1至4任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes any one of claims 1 to 4 Methods.
PCT/CN2020/139902 2019-12-31 2020-12-28 Resource scheduling method and apparatus, and related device WO2021136137A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911419644.3 2019-12-31
CN201911419644.3A CN111176792B (en) 2019-12-31 2019-12-31 Resource scheduling method and device and related equipment

Publications (1)

Publication Number Publication Date
WO2021136137A1 true WO2021136137A1 (en) 2021-07-08

Family

ID=70656028

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139902 WO2021136137A1 (en) 2019-12-31 2020-12-28 Resource scheduling method and apparatus, and related device

Country Status (2)

Country Link
CN (2) CN111176792B (en)
WO (1) WO2021136137A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567537A (en) * 2022-09-20 2023-01-03 中国联合网络通信集团有限公司 Resource scheduling method and equipment
CN116820766A (en) * 2023-06-29 2023-09-29 黑龙江起速网络科技有限公司 Computer resource distribution system and method based on big data technology

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111176792B (en) * 2019-12-31 2023-11-17 华为技术有限公司 Resource scheduling method and device and related equipment
CN112667999A (en) * 2020-12-31 2021-04-16 中电长城网际安全技术研究院(北京)有限公司 Method and device for adjusting execution time of virtual machine
CN115202803A (en) * 2021-04-13 2022-10-18 超聚变数字技术有限公司 Fault processing method and device
CN113923215B (en) * 2021-09-09 2023-12-29 深信服科技股份有限公司 Virtual machine scheduling method, electronic equipment and storage medium
CN114546603B (en) * 2022-04-24 2022-07-29 睿至科技集团有限公司 Data processing method and system applied to Internet of things
CN115277693A (en) * 2022-06-21 2022-11-01 中国电信股份有限公司 Cloud resource scheduling method and system and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646052A (en) * 2011-02-16 2012-08-22 中国移动通信集团公司 Virtual machine deployment method, device and system
CN104426694A (en) * 2013-08-28 2015-03-18 杭州华三通信技术有限公司 Method and device for adjusting virtual-machine resources
CN106033373A (en) * 2015-03-11 2016-10-19 苏宁云商集团股份有限公司 A method and a system for scheduling virtual machine resources in a cloud computing platform
US20180039494A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Zero down time upgrade for a multi-tenant identity and data security management cloud service
CN110489229A (en) * 2019-07-17 2019-11-22 长沙学院 A kind of multiple target method for scheduling task and system
CN111176792A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Resource scheduling method, device and related equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808341B (en) * 2014-12-29 2019-05-28 中国移动通信集团公司 A kind of methods, devices and systems of scheduling of resource
CN104881327B (en) * 2015-06-01 2018-08-24 曙光信息产业(北京)有限公司 The operation flow management method and device of cluster
CN107222324B (en) * 2016-03-22 2021-05-14 华为技术有限公司 Service configuration method and device of network service
US10489184B2 (en) * 2017-05-12 2019-11-26 At&T Intellectual Property I, L.P. Systems and methods for management of virtual machine resources in a network environment through localized assignment of virtual machines having complimentary resource requirements

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646052A (en) * 2011-02-16 2012-08-22 中国移动通信集团公司 Virtual machine deployment method, device and system
CN104426694A (en) * 2013-08-28 2015-03-18 杭州华三通信技术有限公司 Method and device for adjusting virtual-machine resources
CN106033373A (en) * 2015-03-11 2016-10-19 苏宁云商集团股份有限公司 A method and a system for scheduling virtual machine resources in a cloud computing platform
US20180039494A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Zero down time upgrade for a multi-tenant identity and data security management cloud service
CN110489229A (en) * 2019-07-17 2019-11-22 长沙学院 A kind of multiple target method for scheduling task and system
CN111176792A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Resource scheduling method, device and related equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567537A (en) * 2022-09-20 2023-01-03 中国联合网络通信集团有限公司 Resource scheduling method and equipment
CN116820766A (en) * 2023-06-29 2023-09-29 黑龙江起速网络科技有限公司 Computer resource distribution system and method based on big data technology

Also Published As

Publication number Publication date
CN111176792B (en) 2023-11-17
CN117632361A (en) 2024-03-01
CN111176792A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
WO2021136137A1 (en) Resource scheduling method and apparatus, and related device
US10826841B2 (en) Modification of queue affinity to cores based on utilization
US10558498B2 (en) Method for scheduling data flow task and apparatus
US10530846B2 (en) Scheduling packets to destination virtual machines based on identified deep flow
US10120726B2 (en) Hybrid virtual machine configuration management
US9503387B2 (en) Instantiating incompatible virtual compute requests in a heterogeneous cloud environment
JP6200497B2 (en) Offload virtual machine flows to physical queues
WO2018177012A1 (en) Method, apparatus and device for controlling bandwidth
US20150381453A1 (en) Integrated global resource allocation and load balancing
US10686716B2 (en) Dynamic processing of packets using multiple receive queue features
WO2023125493A1 (en) Resource management method and apparatus, and resource management platform
US10460254B2 (en) System and method for reducing state space in reinforced learning by using decision tree classification
DE102020109669A1 (en) SERVICE GOODS TRANSPORT MANAGEMENT IN HIGH-SPEED PACKAGE PROCESSING SYSTEMS
US20180189084A1 (en) Data flow affinity for heterogenous virtual machines
Mishra et al. Time efficient dynamic threshold-based load balancing technique for Cloud Computing
WO2017010922A1 (en) Allocation of cloud computing resources
US9184982B2 (en) Balancing the allocation of virtual machines in cloud systems
WO2012173641A1 (en) Decentralized management of virtualized hosts
US10237148B2 (en) Providing a data set for tracking and diagnosing datacenter issues
DE102019103932A1 (en) Optimized Quality of Service Acceleration Technologies
CN114564313A (en) Load adjustment method and device, electronic equipment and storage medium
CN114356531A (en) Edge calculation task classification scheduling method based on K-means clustering and queuing theory
CN116643875A (en) Task scheduling method, server and server cluster
CN110247802B (en) Resource configuration method and device for cloud service single-machine environment
JP2018181123A (en) Resource allocation control system, resource allocation control method, and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20909486

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20909486

Country of ref document: EP

Kind code of ref document: A1