WO2020253490A1 - Resource allocation method, apparatus and device - Google Patents

Resource allocation method, apparatus and device Download PDF

Info

Publication number
WO2020253490A1
WO2020253490A1 PCT/CN2020/092740 CN2020092740W WO2020253490A1 WO 2020253490 A1 WO2020253490 A1 WO 2020253490A1 CN 2020092740 W CN2020092740 W CN 2020092740W WO 2020253490 A1 WO2020253490 A1 WO 2020253490A1
Authority
WO
WIPO (PCT)
Prior art keywords
resources
available
resource
rack group
available rack
Prior art date
Application number
PCT/CN2020/092740
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 WO2020253490A1 publication Critical patent/WO2020253490A1/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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/504Resource capping

Definitions

  • the present invention relates to the field of cloud computing technology of financial technology (Fintech), and particularly relates to a resource allocation method, device and equipment.
  • the number of instances of core subsystems (A, B1) is not less than 3, and the number of instances of non-core subsystems is not less than 2;
  • the number of instances of a single DCN is deployed on at least two different cabinets.
  • IDC Internet Data Center, Internet Data Center
  • Important subsystems type A, B1, B2
  • the number of instances in a single DCN is not less than 2;
  • Important subsystems (Class A, B1, B2).
  • the number of instances in a single DCN is deployed in at least two different cabinets.
  • the host resource allocation in the existing solution includes the allocation of physical hosts and virtual hosts.
  • unallocated machines are screened from the CMDB according to the physical area, and a series of operations such as physical machine deployment, mother machine placement, and virtualization are performed.
  • a resource pool is formed, and resources that meet the above two high-availability rules are manually selected from the resource pool.
  • information such as DCN and application domains is allocated according to the subsystem and delivered to the resource demander.
  • the present invention provides a resource allocation method, device and equipment, which are used to solve the problem of slow resource allocation process and waste of time in the prior art when resource allocation is performed.
  • an embodiment of the present invention provides a resource allocation method, which includes:
  • the available resources with the same number of required resources are selected from the available rack groups for allocation, where
  • the available rack group is a rack group with available resources in the rack group.
  • the available rack group is a rack group with available resources in the rack group, because when it is determined that the number of required resources is not greater than the number of available rack groups, select the required resources from the rack group The same amount of resources are allocated, eliminating the need to manually select available resources in the resource pool, improving the process of resource allocation and saving time.
  • the method further includes:
  • the required resources are physical host resources, and if the number of required resources is greater than the number of available rack groups, the available resources of at least one available rack group in the available rack group are repeatedly allocated;
  • the required resource is a virtual host resource. If the number of required resources is greater than the number of available rack groups, and is not greater than the number of available physical hosts in the business system corresponding to the required resource, then From the number of available physical hosts in the business system, the available resources that are the same as the required number of resources are selected for allocation.
  • the processing methods are different depending on the required resources. If the required resources are physical host resources and the number of required resources is greater than the number of available rack groups, then the rack The available resources of at least one available rack group in the group are repeatedly allocated; if the required resources are virtual host resources, and the number of required resources is greater than the number of available rack groups, and not greater than the available physical hosts of the business system corresponding to the required resources The number of available resources is selected from the available physical hosts of the business system with the same number of resources needed for allocation.
  • the required resources are virtual host resources, and if the number of required resources is greater than the number of available rack groups, the method further includes:
  • the required resource is a virtual host resource
  • the number of required resources is greater than the number of available rack groups, and is greater than the number of available resources in the business system corresponding to the required resources
  • an exception prompt will be made to indicate that the available resources are insufficient. Unable to allocate resources.
  • the required resources are physical host resources
  • the selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
  • the above method shows how to select and allocate the same amount of available resources from the available rack group when the required resources are physical host resources.
  • the required resources are virtual host resources
  • the selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
  • the SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
  • the above method shows how to select and allocate the same amount of available resources from the available rack group when the required resources are virtual host resources.
  • an embodiment of the present invention provides a resource allocation device, which includes:
  • the allocation module if the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, then it is used to select from the available rack groups the same number of available resources as the required number of resources Resources are allocated, wherein the available rack group is a rack group for which there are available resources in the rack group.
  • the allocation module is further used to:
  • the required resources are physical host resources. If the number of required resources is greater than the number of available rack groups, at least one available rack group in the available rack group The available resources are repeatedly allocated;
  • the required resources are virtual host resources, if the number of required resources is greater than the number of available rack groups, and the number of required resources is not greater than the number of available physical hosts in the business system corresponding to the required resources
  • the number of available resources is selected from the number of available physical hosts in the business system, which is the same as the required number of resources, for allocation.
  • the allocation module is further used to:
  • the required resource is a virtual host resource, if the number of required resources is greater than the number of available rack groups, and if the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, Then no resource allocation is performed.
  • the required resources are physical host resources
  • the allocation module is specifically configured to:
  • the required resources are virtual host resources; the allocation module is specifically configured to:
  • the SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
  • an embodiment of the present invention provides another resource allocation device, which includes:
  • Memory used to store program instructions
  • the processor is configured to call program instructions stored in the memory, and execute the method according to any one of the first aspects according to the obtained program.
  • an embodiment of the present invention also provides that the computer-readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer executes the method described in any one of the first aspects.
  • FIG. 1 is a method for resource allocation provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a physical host resource allocation process provided by an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a virtual host resource allocation process provided by an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a first resource allocation device provided by an embodiment of the present invention.
  • Fig. 5 is a schematic structural diagram of a second resource allocation device provided by an embodiment of the present invention.
  • the embodiments of the present application provide a resource allocation method, device, and equipment, which are used to solve the problem of slow resource allocation process and waste of time in resource allocation in the prior art.
  • the method and the device are based on the same inventive concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
  • IaaS Infrastructure as a Service
  • infrastructure as a service is the bottom layer of cloud services and mainly provides some basic resources.
  • ToR Top of Rack, is a wiring method for data centers, which is to install an access switch on the top of a standard 42U server cabinet.
  • KVM Short for Kernel-based Virtual Machine, it is an open source system virtualization module based on hardware-based full virtualization technology.
  • VM Virtual Machine (Virtual Machine) refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.
  • SystemID refers to the application system number, each business system has a unique system ID.
  • DCN Data Center Node, refers to a logical concept in the application system architecture. It does not represent the actual physical data center, but the same DCN must only belong to a certain physical data center.
  • AppDomain Application Domain, application domain, logical concept, domain to which the application belongs.
  • Hostname host name, used to display or set the host name of the system.
  • OpenStack is an open source cloud computing management platform project, which is composed of several main components to complete specific tasks. OpenStack supports almost all types of cloud environments. The project goal is to provide a cloud computing management platform that is simple to implement, scalable, rich, and standardized. OpenStack provides infrastructure as a service (IaaS) solutions through a variety of complementary services, and each service provides APIs for integration.
  • IaaS infrastructure as a service
  • AZ Availability Zone
  • AZ can be understood simply as a collection of some hosts.
  • Nova and Cinder modules have integrated AZ functions before the Mitaka version.
  • the user can specify an AZ when creating a virtual machine, so that the virtual machine will be generated on the host contained in the AZ.
  • users can specify AZ when creating a volume, so that the volume will be allocated storage in the host included in the specified A.
  • Affinity Group OpenStack association group to ensure that the instances are on the same or different computing hypervisor hosts.
  • Image refers to the system mirror.
  • SN Serial Number, product serial number, product serial number is a concept introduced to verify the "legal identity of the product", it is used to protect the legitimate rights and interests of users, enjoy legitimate services, a set of genuine products Only corresponds to a set of product serial numbers.
  • CMDB Configuration Management Database
  • configuration management database CMDB stores and manages various configuration information of the equipment in the enterprise IT architecture. It is closely connected with all service support and service delivery processes to support the operation and play of these processes The value of the configuration information depends on the relevant processes to ensure the accuracy of the data.
  • ITSM ITService Management
  • IT service management IT service management is a set of methods to help companies effectively manage the planning, research and development, implementation and operation of IT systems. It is a set of methodology. This article refers to ITSM management platform in general.
  • At least one means one or more, and “multiple” means two or more.
  • “And/or” describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects are in an “or” relationship.
  • “The following at least one item (a)” or similar expressions refers to any combination of these items, including any combination of a single item (a) or plural items (a).
  • At least one item (a) of a, b, or c can represent any of the following situations: a, b, c, d and b, a and c, b and c, a and b and c.
  • an embodiment of the present invention provides a resource allocation method. As shown in FIG. 1, the method specifically includes the following steps:
  • the number of required resources is first determined. If it is determined that the number of required resources is not greater than the number of available rack groups established based on TOR, then the available rack group with the same number of required resources is selected from the available rack group. Resources are allocated.
  • the available rack group here refers to the rack group with available resources in the rack group.
  • a resource request message When the resource demander needs resources, a resource request message will be issued.
  • the resource request message will carry the required resources and the number of required resources, such as DCN, Appdomain, SystemId, Image, physical zone, machine model, number of instances, etc. , And then determine the required resources and the number of required resources from the resource request information.
  • the physical area refers to the divided physical area, such as the management area, the external area, the server group area, etc.; the machine model can be created according to the needs of the business, and the corresponding resources can be created according to the needs of the business. Corresponding requirements.
  • resources may be physical host resources, virtual host resources, or a combination of physical host resources and virtual host resources.
  • the resource demander A issues a resource request message
  • the resource determined in the resource request message is 5 physical host resources and 3 virtual host resources.
  • the number of required resources After determining the number of required resources, compare the number of required resources with the number of available rack groups established based on TOR. If the number of required resources is not greater than the number of available rack groups, select and Available resources with the same number of required resources are allocated, and the available rack group here is a rack group with available resources in the rack group.
  • the number of required resources here is the same as the number of subsequent instances, and both represent the number of resources required by the resource demander.
  • the conventional rack is 42U and has 21 seats.
  • the conventional physical host is 2U, so a rack can hold up to 21 physical hosts and one rack group. There can be up to 42 physical hosts.
  • the physical host can no longer be allocated. If there are 42 physical hosts in a rack group and at least one physical host is not occupied, it means that the rack group is an available rack group.
  • the available resources are allocated.
  • the following describes the required resources as physical host resources and the required resources as virtual host resources.
  • Case 1 The required resources are physical host resources.
  • the resource usage rate of the available rack group that is, the ratio of the number of unoccupied physical hosts under the rack group to the total number of physical hosts, and the result is the resource usage rate of the available rack group.
  • the resource utilization rate of rack group 1 is 50%.
  • the resource usage rate of available rack group is 10%
  • the resource usage rate of available rack group 2 is 15%
  • the resource usage rate of available rack group 3 is 30%
  • the resource usage rate of available rack group 4 The resource utilization rate of the available rack group 5 is 35%
  • the resource utilization rate of the available rack group 5 is 50
  • the number of resources required is 2, then select 2 available rack groups with low resource utilization from the 5 available rack groups, namely Available rack group 1 and available rack group 2.
  • the selection method can be random selection or selection through preset rules. This application is not limited.
  • available rack group 1 and available rack group 2 For example, two available rack groups with low resource usage are selected, available rack group 1 and available rack group 2, and available rack group 1 has 2 unoccupied physical hosts, physical host 1 and physical host 2. There are 3 unoccupied physical hosts in the available rack group 2, physical host 3, physical host 4 and physical host 5.
  • the selected physical host SN and IP address are returned to the terminal where the user is located.
  • Case 2 The required resources are virtual host resources.
  • Select an available rack group with the same amount of resources as the required resource from the available rack group select an IP address with the same number of resources as the required resource from the available rack group with a small resource usage, and use the resource Select the resource name from the available rack group with low rate, determine the parent machine SN and virtual host IP address corresponding to the virtual host according to the IP address and resource name; send the parent machine SN and virtual host IP address to the user's terminal.
  • IP address pool is allocated the same number of IP addresses as the required resources, and the physical host name is incrementally allocated according to the CMDB, and the allocated IP address and physical host name are returned to the user.
  • the host name creation rule can be: CN+city+IDC+number.
  • the first host name created by the rule engine is CNSZFT05010001
  • the second host name is CNSZFT05010002
  • FT represents a 0501 computer room
  • 0001 represents the serial number.
  • the above is an explanation of resource allocation when the number of required resources is not greater than the number of available rack groups. If the number of required resources is greater than the number of available rack groups, it means that the rack group cannot meet the required resources. If the required resources are If it is a physical host resource, the available resources of at least one available rack group in the available rack group can be repeatedly allocated.
  • the following is an example to illustrate that the required resources are physical host resources.
  • the number of physical host resources required is 4, the available rack group is available rack group 1, available rack group 2, and available rack group 3.
  • the number of physical resources required 4 is greater than the number of available rack groups 3.
  • the available rack group 3 was repeatedly allocated.
  • the required resource is a virtual host resource, and the number of required resources is greater than the number of available rack groups, and is not greater than the number of available physical hosts of the business system corresponding to the required resource, then from the available physical hosts of the business system The host selects the available resources that are the same as the required number of resources for allocation.
  • the available resources with the same amount of resources as the required resources are selected from the available physical hosts of the business system for allocation, and the AZ of Openstack can be obtained based on the rack group, that is, the set of unoccupied physical hosts. Then, from the IP address pool of the virtual network segment, an IP address equal to the required number of resources is allocated, the physical host name is incrementally allocated according to the CMDB, and the allocated IP address and physical host name are sent to the terminal where the user is located.
  • the AZ of Openstack is obtained based on the rack group, which can be defined rules created in advance when building Openstack, that is, there is a corresponding relationship between the rack group and the AZ. After the rack group is determined, the AZ can be determined according to the corresponding relationship ;
  • the IP address pool of the virtual network can be a virtual network segment created in advance when Openstack is built, and the virtual network segment constitutes the IP address pool of the virtual network.
  • the required resources are virtual host resources, and the number of required resources is greater than the number of available rack groups, and is greater than the number of available resources in the business system corresponding to the required resources, it means that the existing resources cannot meet the required resources. Therefore, an abnormal prompt is displayed and no resource allocation is performed.
  • Embodiment 1 Physical host resource allocation.
  • FIG. 2 it is a schematic diagram of a physical host resource allocation process provided by an embodiment of the present invention.
  • S203 Determine whether the number of instances in the resource application information is less than the number of available rack groups in the live network, if so, perform S204, otherwise perform S211;
  • S205 Select an available rack group with the same number of instances as the available rack group with a small resource usage rate from the available rack groups;
  • Embodiment 2 Virtual host resource allocation.
  • FIG. 3 it is a schematic diagram of a virtual host resource allocation process provided by an embodiment of the present invention.
  • S303 Determine whether N is less than the number of available rack groups in the live network, if so, perform S304, otherwise perform S312;
  • S308 Select N IP addresses from the IP address pool of the virtual network segments of the N hosts;
  • S313 Determine whether N is less than the number of hosts in the affinity group, if so, perform S314, otherwise perform S316;
  • S315 Establish an OpenStack AZ based on the available rack group, and execute S307;
  • the embodiment of the present invention also provides a resource allocation device. Since the device corresponds to the device corresponding to the resource allocation method in the embodiment of the present invention, and the principle of the device to solve the problem is similar to the method, the The implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • FIG. 4 it is a schematic structural diagram of a resource allocation device provided by an embodiment of the present invention.
  • the device includes: a determining module 400 and an allocation module 401:
  • the determining module 400 is used to determine the required amount of resources
  • the allocation module 401 if the number of required resources is not greater than the number of available rack groups established based on the TOR of the data center, is used to select from the available rack groups the same as the number of required resources
  • the available resources are allocated, wherein the available rack group is a rack group for which available resources exist in the rack group.
  • the allocation module 401 is further configured to:
  • the required resources are physical host resources. If the number of required resources is greater than the number of available rack groups, at least one available rack group in the available rack group The available resources are repeatedly allocated;
  • the required resources are virtual host resources, if the number of required resources is greater than the number of available rack groups, and the number of required resources is not greater than the number of available physical hosts in the business system corresponding to the required resources
  • the number of available resources is selected from the number of available physical hosts in the business system, which is the same as the required number of resources, for allocation.
  • the allocation module 401 is further configured to:
  • the required resource is a virtual host resource, if the number of required resources is greater than the number of available rack groups, and if the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, Then no resource allocation is performed.
  • the required resources are physical host resources
  • the allocation module 401 is specifically configured to:
  • the required resource is a virtual host resource; the allocation module 401 is specifically configured to:
  • the SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
  • another resource allocation device is provided in the embodiment of the present invention. Since the device corresponds to the device corresponding to the resource allocation method in the embodiment of the present invention, and the principle of the device to solve the problem is similar to that of the method, The implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • the device 500 includes:
  • Communication interface 501 memory 502 and processor 503;
  • the processor 503 communicates with other devices through the communication interface 501.
  • the other devices may be the aforementioned external online translation tools.
  • the communication interface 501 can provide an application programming interface solution.
  • the processor 503 can send the aforementioned translation parameters etc. to an external online translation tool through the communication interface 501; the memory 502 is used to store program instructions; the processor 503 is used to call the program instructions stored in the memory 502 and execute according to the obtained program The method in the above embodiment.
  • the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and may implement or Perform the methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
  • the general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory is used to store program instructions.
  • the memory can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it can be volatile. Volatile memory (volatile memory), such as random-access memory (RAM).
  • the memory may also be any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function, for storing program instructions and/or data.
  • the embodiments of the present application do not limit the specific connection medium between the aforementioned communication interface, memory, and processor, such as a bus.
  • the bus can be divided into an address bus, a data bus, and a control bus.
  • an embodiment of the present invention also provides a readable storage medium for resource allocation, including program code, and when the program code runs on a computing device, the program code is used to make the computing device execute the resource allocation method A step of.
  • this application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium to be used by the instruction execution system or Used in conjunction with the instruction execution system.
  • a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or transmit a program for use by an instruction execution system, device, or device, or in combination with an instruction execution system, Device or equipment use.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are a resource allocation method, apparatus and device, relating to the field of cloud computing of Fintech and used for solving the problem in the prior art of wasting time due to a slow resource allocation process during resource allocation. In the present invention, firstly, the number of required resources is determined; and if it is determined that the number of required resources is not greater than the number of available rack groups established on the basis of TOR, available resources, the number of which is the same as that of the required resources, are selected from the available rack groups so as to be allocated, wherein the available rack groups here are rack groups in which there are available resources. When it is determined that the number of required resources is not greater than the number of available rack groups, resources, the number of which is the same as that of the required resources, are selected from the rack groups so as to be allocated, such that there is no need to manually select available resources from a resource pool, thereby improving a resource allocation process and saving time.

Description

一种资源分配方法、装置及设备Resource allocation method, device and equipment
相关申请的交叉引用Cross references to related applications
本申请要求在2019年06月19日提交中国专利局、申请号为201910532166.0、申请名称为“一种资源分配方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 19, 2019, the application number is 201910532166.0, and the application name is "a resource allocation method, device and equipment", the entire content of which is incorporated herein by reference Applying.
技术领域Technical field
本发明涉及金融科技(Fintech)的云计算技术领域,特别涉及一种资源分配方法、装置及设备。The present invention relates to the field of cloud computing technology of financial technology (Fintech), and particularly relates to a resource allocation method, device and equipment.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,云计算也是,目前在云计算领域中,众多拥有较大IT资源和软件系统的企业,都会在自己的数据中心部署内部云计算环境,其中最重要的技术是虚拟化以及支撑虚拟化的资源池管理模式和技术,比如云计算环境使用KVM虚拟化技术,在IaaS(基础设施即服务,Infrastructure as a Service)层采用传统的虚拟化架构方案。为了保证系统的稳定性和高可用性,当前的应用高可用规则如下:With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming to Fintech, as is cloud computing. At present, in the field of cloud computing, many have large IT resources and software System enterprises will deploy internal cloud computing environments in their own data centers. The most important technology is virtualization and resource pool management modes and technologies that support virtualization. For example, cloud computing environments use KVM virtualization technology. Facilities as a service, Infrastructure as a Service layer adopts traditional virtualization architecture scheme. In order to ensure the stability and high availability of the system, the current application high availability rules are as follows:
一、原应用高可用规则1. The original application high availability rules
1、核心子系统(A,B1类)实例数不小于3,非核心子系统实例数不小于2;1. The number of instances of core subsystems (A, B1) is not less than 3, and the number of instances of non-core subsystems is not less than 2;
2、一个子系统,在单个DCN的实例数至少部署在两个不同的机柜上面。2. For a subsystem, the number of instances of a single DCN is deployed on at least two different cabinets.
二、同城多中心多活下的应用高可用规则2. Application high-availability rules under multiple centers and multiple activities in the same city
1、一种子系统的实例部署的IDC(Internet Data Center,互联网数据中心)数不小于2;1. The number of IDC (Internet Data Center, Internet Data Center) deployed in an instance of a subsystem is not less than 2;
2、重要子系统(A,B1,B2类),在单个DCN(Data Center Node,数据中心节点)内的实例数不小于2;2. Important subsystems (type A, B1, B2), the number of instances in a single DCN (Data Center Node, data center node) is not less than 2;
3、重要子系统(A,B1,B2类),在单个DCN内的实例数至少部署在两个不同的机柜上。3. Important subsystems (Class A, B1, B2). The number of instances in a single DCN is deployed in at least two different cabinets.
现有方案中主机资源分配包括物理主机和虚拟主机分配,首先根据资源需求方的需求,从CMDB中按照物理区域筛选未分配的机器,进行物理机部署、母机投放、虚拟化等一系列操作,形成资源池,再从资源池中人工挑选满足上述两个高可用规则的资源,最后根据 子系统分配DCN、应用域等信息,并交付给资源需求方。The host resource allocation in the existing solution includes the allocation of physical hosts and virtual hosts. First, according to the needs of the resource demander, unallocated machines are screened from the CMDB according to the physical area, and a series of operations such as physical machine deployment, mother machine placement, and virtualization are performed. A resource pool is formed, and resources that meet the above two high-availability rules are manually selected from the resource pool. Finally, information such as DCN and application domains is allocated according to the subsystem and delivered to the resource demander.
由于资源分配时需要人工挑选资源,因此资源分配的进程缓慢,耗时较久。Since resources need to be selected manually during resource allocation, the process of resource allocation is slow and takes a long time.
发明内容Summary of the invention
本发明提供一种资源分配方法、装置及设备,用以解决现有技术中存在的进行资源分配时,资源分配进程缓慢,浪费时间的问题。The present invention provides a resource allocation method, device and equipment, which are used to solve the problem of slow resource allocation process and waste of time in the prior art when resource allocation is performed.
第一方面,本发明实施例提供一种资源分配方法,该方法包括:In the first aspect, an embodiment of the present invention provides a resource allocation method, which includes:
确定需要的资源数量;Determine the amount of resources needed;
若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。If the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, then the available resources with the same number of required resources are selected from the available rack groups for allocation, where The available rack group is a rack group with available resources in the rack group.
上述方法,首先确定需要的资源数量,如果确定需要的资源数量不大于基于TOR建立的可用机架组的数量,那么从该可用机架组中选择与该需要的资源数量相同的可用资源进行分配,这里的可用机架组为在该机架组中存在可用资源的机架组,由于在确定需要的资源数量不大于可用机架组的数量时,从该机架组中选择与需要的资源数量相同的资源进行分配,从而无需人工在资源池中挑选可用资源,提高资源分配的进程,节省时间。In the above method, first determine the number of required resources. If it is determined that the number of required resources is not greater than the number of available rack groups established based on TOR, then select the available resources from the available rack groups that are the same as the required number of resources for allocation , The available rack group here is a rack group with available resources in the rack group, because when it is determined that the number of required resources is not greater than the number of available rack groups, select the required resources from the rack group The same amount of resources are allocated, eliminating the need to manually select available resources in the resource pool, improving the process of resource allocation and saving time.
在一种可能的实现方式中,所述确定需要的资源数量之后,还包括:In a possible implementation manner, after the determining the required amount of resources, the method further includes:
所述需要的资源为物理主机资源,若所述需要的资源数量大于所述可用机架组的数量,则将所述可用机架组中至少一个可用机架组的可用资源进行重复分配;The required resources are physical host resources, and if the number of required resources is greater than the number of available rack groups, the available resources of at least one available rack group in the available rack group are repeatedly allocated;
所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,且不大于所述需要的资源对应的业务系统中可用物理主机的数量,则从所述业务系统中可用物理主机的数量中选择与所述需要的资源数量相同的可用资源进行分配。The required resource is a virtual host resource. If the number of required resources is greater than the number of available rack groups, and is not greater than the number of available physical hosts in the business system corresponding to the required resource, then From the number of available physical hosts in the business system, the available resources that are the same as the required number of resources are selected for allocation.
上述方法,在确定需要的资源数量之后,根据需要的资源不同,处理方式也不同,如果需要的资源为物理主机资源,且需要的资源数量大于可用机架组的数量,则将所述机架组中至少一个可用机架组的可用资源进行重复分配;如果需要的资源为虚拟主机资源,且需要的资源数量大于可用机架组的数量,不大于需要的资源对应的业务系统的可用物理主机的数量,则从该业务系统的可用物理主机中选择与需要的资源数量相同的可用资源进行分配。In the above method, after determining the number of required resources, the processing methods are different depending on the required resources. If the required resources are physical host resources and the number of required resources is greater than the number of available rack groups, then the rack The available resources of at least one available rack group in the group are repeatedly allocated; if the required resources are virtual host resources, and the number of required resources is greater than the number of available rack groups, and not greater than the available physical hosts of the business system corresponding to the required resources The number of available resources is selected from the available physical hosts of the business system with the same number of resources needed for allocation.
在一种可能的实现方式中,所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,还包括:In a possible implementation manner, the required resources are virtual host resources, and if the number of required resources is greater than the number of available rack groups, the method further includes:
若所述需要的资源数量大于所述需要的资源对应的业务系统中可用资源的数量,则不 进行资源分配。If the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, no resource allocation is performed.
上述方法,如果需要的资源为虚拟主机资源,且需要的资源数量大于可用机架组的数量,且大于需要的资源对应的业务系统中可用资源的数量,则进行异常提示,说明可用资源不够,无法进行资源分配。In the above method, if the required resource is a virtual host resource, and the number of required resources is greater than the number of available rack groups, and is greater than the number of available resources in the business system corresponding to the required resources, an exception prompt will be made to indicate that the available resources are insufficient. Unable to allocate resources.
在一种可能的实现方式中,所述需要的资源为物理主机资源;In a possible implementation manner, the required resources are physical host resources;
所述从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,包括:The selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
针对一个资源使用率小的可用机架组,从所述资源使用率小的可用机架组中选择一个可用物理机SN和IP地址;For an available rack group with a small resource usage rate, select an available physical machine SN and IP address from the available rack group with a small resource usage rate;
将选择的一个可用物理机SN和IP地址发送给用户所在终端。Send the selected available physical machine SN and IP address to the terminal where the user is located.
上述方法,给出了当需要的资源为物理主机资源时,如何从可用机架组中选择与需要的资源数量相同的可用资源进行分配。The above method shows how to select and allocate the same amount of available resources from the available rack group when the required resources are physical host resources.
在一种可能的实现方式中,所述需要的资源为虚拟主机资源;In a possible implementation manner, the required resources are virtual host resources;
所述从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,包括:The selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
从所述资源使用率小的可用机架组中选择与所述需要的资源数量相同的IP地址,以及从所述资源使用率小的可用机架组中选择资源名称;Selecting an IP address with the same amount of resources from the available rack group with a low resource usage rate, and selecting a resource name from the available rack group with a low resource usage rate;
根据所述IP地址和所述资源名称确定虚拟主机对应的母机SN和虚拟主机IP地址;Determining the parent machine SN and the virtual host IP address corresponding to the virtual host according to the IP address and the resource name;
将所述母机SN和虚拟主机IP地址发送给用户所在终端。The SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
上述方法,给出了当需要的资源为虚拟主机资源时,如何从可用机架组中选择与需要的资源数量相同的可用资源进行分配。The above method shows how to select and allocate the same amount of available resources from the available rack group when the required resources are virtual host resources.
第二方面,本发明实施例提供一种资源分配装置,该装置包括:In a second aspect, an embodiment of the present invention provides a resource allocation device, which includes:
确定模块,用于确定需要的资源数量;Determine module, used to determine the amount of resources needed;
分配模块,若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则用于从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。The allocation module, if the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, then it is used to select from the available rack groups the same number of available resources as the required number of resources Resources are allocated, wherein the available rack group is a rack group for which there are available resources in the rack group.
在一种可能的实现方式中,所述分配模块还用于:In a possible implementation manner, the allocation module is further used to:
所述确定需要的资源数量之后,所述需要的资源为物理主机资源,若所述需要的资源数量大于所述可用机架组的数量,则所述可用机架组中至少一个可用机架组的可用资源进行重复分配;After the number of required resources is determined, the required resources are physical host resources. If the number of required resources is greater than the number of available rack groups, at least one available rack group in the available rack group The available resources are repeatedly allocated;
所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量, 且所述需要的资源数量不大于所述需要的资源对应的业务系统中可用物理主机的数量,则从所述业务系统中可用物理主机的数量中选择与所述需要的资源数量相同的可用资源进行分配。The required resources are virtual host resources, if the number of required resources is greater than the number of available rack groups, and the number of required resources is not greater than the number of available physical hosts in the business system corresponding to the required resources The number of available resources is selected from the number of available physical hosts in the business system, which is the same as the required number of resources, for allocation.
在一种可能的实现方式中,所述分配模块还用于:In a possible implementation manner, the allocation module is further used to:
所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,若所述需要的资源数量大于所述需要的资源对应的业务系统中可用资源的数量,则不进行资源分配。The required resource is a virtual host resource, if the number of required resources is greater than the number of available rack groups, and if the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, Then no resource allocation is performed.
在一种可能的实现方式中,所述需要的资源为物理主机资源,所述分配模块具体用于:In a possible implementation manner, the required resources are physical host resources, and the allocation module is specifically configured to:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
针对一个资源使用率小的可用机架组,从所述资源使用率小的可用机架组中选择一个可用物理机SN和IP地址;For an available rack group with a small resource usage rate, select an available physical machine SN and IP address from the available rack group with a small resource usage rate;
将选择的一个可用物理机SN和IP地址发送给用户所在终端。Send the selected available physical machine SN and IP address to the terminal where the user is located.
在一种可能的实现方式中,所述需要的资源为虚拟主机资源;所述分配模块具体用于:In a possible implementation manner, the required resources are virtual host resources; the allocation module is specifically configured to:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
从所述资源使用率小的可用机架组中选择与所述需要的资源数量相同的IP地址,以及从所述资源使用率小的可用机架组中选择资源名称;Selecting an IP address with the same amount of resources from the available rack group with a low resource usage rate, and selecting a resource name from the available rack group with a low resource usage rate;
根据所述IP地址和所述资源名称确定虚拟主机对应的母机SN和虚拟主机IP地址;Determining the parent machine SN and the virtual host IP address corresponding to the virtual host according to the IP address and the resource name;
将所述母机SN和虚拟主机IP地址发送给用户所在终端。The SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
第三方面,本发明实施例提供另一种资源分配设备,该设备包括:In the third aspect, an embodiment of the present invention provides another resource allocation device, which includes:
存储器以及处理器;Memory and processor;
存储器,用于存储程序指令;Memory, used to store program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行第一方面任一项所述的方法。The processor is configured to call program instructions stored in the memory, and execute the method according to any one of the first aspects according to the obtained program.
第四方面,本发明实施例还提供所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行第一方面中任一项所述的方法。In a fourth aspect, an embodiment of the present invention also provides that the computer-readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer executes the method described in any one of the first aspects.
另外,第二方面至第四方面中任一种实现方式所带来的技术效果可参见第一方面中不同实现方式所带来的技术效果,此处不再赘述。In addition, the technical effects brought about by any one of the implementation manners of the second aspect to the fourth aspect can be referred to the technical effects brought about by the different implementation manners of the first aspect, which will not be repeated here.
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the present invention will be more concise and understandable in the description of the following embodiments.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的 附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings may be obtained from these drawings without creative labor.
图1为本发明实施例提供一种资源分配的方法;FIG. 1 is a method for resource allocation provided by an embodiment of the present invention;
图2为本发明实施例提供的物理主机资源分配流程示意图;2 is a schematic diagram of a physical host resource allocation process provided by an embodiment of the present invention;
图3为本发明实施例提供的虚拟主机资源分配流程示意图;3 is a schematic diagram of a virtual host resource allocation process provided by an embodiment of the present invention;
图4为本发明实施例提供的第一种资源分配装置结构示意图;4 is a schematic structural diagram of a first resource allocation device provided by an embodiment of the present invention;
图5为本发明实施例提供的第二种资源分配装置结构示意图。Fig. 5 is a schematic structural diagram of a second resource allocation device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部份实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. . Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
本申请实施例提供一种资源分配方法、装置及设备,用以解决现有技术中存在的进行资源分配时,资源分配进程缓慢,浪费时间的问题。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiments of the present application provide a resource allocation method, device, and equipment, which are used to solve the problem of slow resource allocation process and waste of time in resource allocation in the prior art. Among them, the method and the device are based on the same inventive concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
以下,对本申请中的部分用词进行解释说明,以便于本领域技术人员理解。Hereinafter, some words in this application will be explained to facilitate the understanding of those skilled in the art.
1)、IaaS:Infrastructure as a Service,基础设施即服务,是云服务的最底层,主要提供一些基础资源。1) IaaS: Infrastructure as a Service, infrastructure as a service, is the bottom layer of cloud services and mainly provides some basic resources.
2)、ToR:Top of Rack,是一种数据中心的布线方式,就是在标准的42U的服务器机柜的最上面安装接入交换机。2) ToR: Top of Rack, is a wiring method for data centers, which is to install an access switch on the top of a standard 42U server cabinet.
3)、RACK:数据中心建设的统一标准,宽度是标准的19英寸,高度通常以“U”数来表示(1U=4.445cm),单个机柜为标准的42U高度。3). RACK: A unified standard for data center construction. The width is the standard 19 inches. The height is usually expressed by the number "U" (1U=4.445cm). A single cabinet is the standard 42U height.
4)、KVM:Kernel-based Virtual Machine的简称,是一个开源的系统虚拟化模块,基于硬件的完全虚拟化技术。4) KVM: Short for Kernel-based Virtual Machine, it is an open source system virtualization module based on hardware-based full virtualization technology.
5)、VM:虚拟机(Virtual Machine)指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。5) VM: Virtual Machine (Virtual Machine) refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.
6)、SystemID:指应用系统编号,每个业务系统有唯一的系统ID。6), SystemID: refers to the application system number, each business system has a unique system ID.
7)、DCN:Data Center Node,数据中心节点,指应用系统架构中的一个逻辑概念,不 代表实际的物理数据中心,但同一个DCN必然只属于某一个物理数据中心。7) DCN: Data Center Node, refers to a logical concept in the application system architecture. It does not represent the actual physical data center, but the same DCN must only belong to a certain physical data center.
8)、AppDomain:Application Domain,应用域,逻辑概念,应用所属的域。8) AppDomain: Application Domain, application domain, logical concept, domain to which the application belongs.
9)、Hostname:主机名称,用以显示或设置系统的主机名称。9) Hostname: host name, used to display or set the host name of the system.
10)、OpenStack:是一个开源的云计算管理平台项目,由几个主要的组件组合起来完成具体工作。OpenStack支持几乎所有类型的云环境,项目目标是提供实施简单、可大规模扩展、丰富、标准统一的云计算管理平台。OpenStack通过各种互补的服务提供了基础设施即服务(IaaS)的解决方案,每个服务提供API以进行集成。10), OpenStack: is an open source cloud computing management platform project, which is composed of several main components to complete specific tasks. OpenStack supports almost all types of cloud environments. The project goal is to provide a cloud computing management platform that is simple to implement, scalable, rich, and standardized. OpenStack provides infrastructure as a service (IaaS) solutions through a variety of complementary services, and each service provides APIs for integration.
11)、AZ:Availability Zone,可用区,,AZ简单来看可以理解成一些主机(host)的集合。在OpenStack中,Nova和Cinder模块在Mitaka版本之前已经集成了AZ的功能。在Nova模块中,用户创建虚机时可以指定一个AZ,这样虚机就会在这个AZ所包含的主机上生成。在Cinder模块中,用户可以在创建卷时指定AZ,这样卷会在指定的A所包含的主机中获得存储分配。11) AZ: Availability Zone, AZ can be understood simply as a collection of some hosts. In OpenStack, Nova and Cinder modules have integrated AZ functions before the Mitaka version. In the Nova module, the user can specify an AZ when creating a virtual machine, so that the virtual machine will be generated on the host contained in the AZ. In the Cinder module, users can specify AZ when creating a volume, so that the volume will be allocated storage in the host included in the specified A.
12)、Affinity Group:OpenStack关联组,确保实例在相同或不同的计算管理程序主机上。12) Affinity Group: OpenStack association group to ensure that the instances are on the same or different computing hypervisor hosts.
13)、Image:镜像,指系统镜像。13). Image: Mirror, refers to the system mirror.
14)、SN:Serial Number,产品序列号,产品序列号是为了验证“产品的合法身份”而引入的一个概念,它是用来保障用户的正版权益,享受合法服务的,一套正版的产品只对应一组产品序列号。14), SN: Serial Number, product serial number, product serial number is a concept introduced to verify the "legal identity of the product", it is used to protect the legitimate rights and interests of users, enjoy legitimate services, a set of genuine products Only corresponds to a set of product serial numbers.
15)、CMDB:Configuration Management Database,配置管理数据库,,CMDB存储与管理企业IT架构中设备的各种配置信息,它与所有服务支持和服务交付流程都紧密相联,支持这些流程的运转、发挥配置信息的价值,同时依赖于相关流程保证数据的准确性。15), CMDB: Configuration Management Database, configuration management database, CMDB stores and manages various configuration information of the equipment in the enterprise IT architecture. It is closely connected with all service support and service delivery processes to support the operation and play of these processes The value of the configuration information depends on the relevant processes to ensure the accuracy of the data.
16)、ITSM:ITService Management,IT服务管理,IT服务管理是一套帮助企业对IT系统的规划、研发、实施和运营进行有效管理的方法,是一套方法论,本文泛指ITSM管理平台。16), ITSM: ITService Management, IT service management, IT service management is a set of methods to help companies effectively manage the planning, research and development, implementation and operation of IT systems. It is a set of methodology. This article refers to ITSM management platform in general.
另外,需要说明的是,本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示后续任意一种情况:a,b,c,d和b,a和c,b和c,a和b和c。In addition, it should be noted that in this application, "at least one" means one or more, and "multiple" means two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship. "The following at least one item (a)" or similar expressions refers to any combination of these items, including any combination of a single item (a) or plural items (a). For example, at least one item (a) of a, b, or c can represent any of the following situations: a, b, c, d and b, a and c, b and c, a and b and c.
随着业务的快速扩展,数据中心规模逐渐扩大,业务申请资源需求愈发频繁,新项目上线、服务器迁移、服务器过保、硬件故障等需要快速新增或替换节点场景逐渐增多,目前,在进行资源分配时,从资源申请到资源分配,全流程人工介入较多,因此资源分配的交付流程缓慢,而且,在人工介入时,人员对资源利用情况没有宏观的认识,所以有可能会导致资源利用不均衡,增大了应用稳定运行的安全隐患,这种安全隐患会导致银行业务(贷款业务、存款业务或其他金融业务)的安全性低,不符合银行等金融机构的监管要求。With the rapid expansion of business, the scale of data centers has gradually expanded, and business application resource requirements have become more frequent. The number of scenarios that require rapid addition or replacement of nodes, such as new project launches, server migration, server out-of-guarantee, and hardware failure, has gradually increased. In resource allocation, there are more manual interventions in the whole process from resource application to resource allocation. Therefore, the delivery process of resource allocation is slow. Moreover, when manual intervention, personnel have no macro understanding of resource utilization, which may lead to resource utilization Imbalance increases the security risks of stable operation of applications. Such security risks can lead to low security of banking services (loan business, deposit business or other financial services), which does not meet the regulatory requirements of banks and other financial institutions.
如果从资源申请到资源分配不需要人员参与,完全实现自动化,则会提高资源分配的进程。需要说明的是,本发明实施例描述的应用场景是为了更加清楚的说明本发明实施例的技术方案,并不构成对于本发明实施例提供的技术方案的限定,本领域普通技术人员可知,随着新应用场景的出现,本发明实施例提供的技术方案对于类似的技术问题,同样适用。If personnel are not required to participate in the process from resource application to resource allocation and fully automated, it will improve the process of resource allocation. It should be noted that the application scenarios described in the embodiments of the present invention are to illustrate the technical solutions of the embodiments of the present invention more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those of ordinary skill in the art will know that With the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
针对上述应用场景,本发明实施例提供一种资源分配的方法,如图1所示,该方法具体包括如下步骤:In view of the foregoing application scenarios, an embodiment of the present invention provides a resource allocation method. As shown in FIG. 1, the method specifically includes the following steps:
S100,确定需要的资源数量;S100, determine the number of resources needed;
S101,若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。S101: If the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, select available resources with the same number of required resources from the available rack groups for allocation , Wherein the available rack group is a rack group with available resources in the rack group.
本发明实施例中,首先确定需要的资源数量,如果确定需要的资源数量不大于基于TOR建立的可用机架组的数量,那么从该可用机架组中选择与该需要的资源数量相同的可用资源进行分配,这里的可用机架组为在该机架组中存在可用资源的机架组,由于在确定需要的资源数量不大于可用机架组的数量时,从该机架组中选择与需要的资源数量相同的资源进行分配,从而无需人工在资源池中挑选可用资源,提高了资源分配的进程,节省时间。In the embodiment of the present invention, the number of required resources is first determined. If it is determined that the number of required resources is not greater than the number of available rack groups established based on TOR, then the available rack group with the same number of required resources is selected from the available rack group. Resources are allocated. The available rack group here refers to the rack group with available resources in the rack group. When it is determined that the number of resources required is not greater than the number of available rack groups, select the rack group and Resources with the same number of required resources are allocated, so that there is no need to manually select available resources in the resource pool, which improves the process of resource allocation and saves time.
当资源需求方需要资源时,会下发一个资源请求信息,资源请求信息中会携带需要的资源以及需要的资源数量,比如DCN、Appdomain、SystemId、Image、物理区、机器型号、实例数等信息,然后从资源请求信息中确定需要的资源以及需要的资源数量。When the resource demander needs resources, a resource request message will be issued. The resource request message will carry the required resources and the number of required resources, such as DCN, Appdomain, SystemId, Image, physical zone, machine model, number of instances, etc. , And then determine the required resources and the number of required resources from the resource request information.
其中,物理区指的是划分的物理区域,比如,管理区、外联区、服务器群区等;机器型号可以按照业务的需求按需创建对应的资源,有些业务需求会对机器型号、Image有对应的要求。Among them, the physical area refers to the divided physical area, such as the management area, the external area, the server group area, etc.; the machine model can be created according to the needs of the business, and the corresponding resources can be created according to the needs of the business. Corresponding requirements.
需要说明的是,这里的资源可以是物理主机资源,也可以是虚拟主机资源,还可以是物理主机资源和虚拟主机资源的组合。It should be noted that the resources here may be physical host resources, virtual host resources, or a combination of physical host resources and virtual host resources.
比如,资源需求方A下发一个资源请求信息,资源请求信息中确定的资源为需要的物理主机资源为5个,虚拟主机资源为3个。For example, the resource demander A issues a resource request message, and the resource determined in the resource request message is 5 physical host resources and 3 virtual host resources.
确定了需要的资源数量后,将需要的资源数量与基于TOR建立的可用机架组的数量进行比较,如果需要的资源数量不大于可用机架组的数量,则从可用机架组中选择与需要的资源数量相同的可用资源进行分配,这里的可用机架组为在机架组中存在可用资源的机架组。After determining the number of required resources, compare the number of required resources with the number of available rack groups established based on TOR. If the number of required resources is not greater than the number of available rack groups, select and Available resources with the same number of required resources are allocated, and the available rack group here is a rack group with available resources in the rack group.
这里的需要的资源数量和后续的实例数量相同,都代表资源需求方需要的资源数。The number of required resources here is the same as the number of subsequent instances, and both represent the number of resources required by the resource demander.
需要说明的是,两个机架组成一个机架组,常规的机架是42U,21个机位,常规的物理主机是2U,所以一个机架最多可以放置21个物理主机,一个机架组最多可以有42个物理主机。It should be noted that two racks form a rack group. The conventional rack is 42U and has 21 seats. The conventional physical host is 2U, so a rack can hold up to 21 physical hosts and one rack group. There can be up to 42 physical hosts.
如果物理主机被占用了,则该物理主机不可再进行分配。如果一个机架组中有42个物理主机,存在至少一个物理主机未被占用,则说明该机架组为可用机架组。If the physical host is occupied, the physical host can no longer be allocated. If there are 42 physical hosts in a rack group and at least one physical host is not occupied, it means that the rack group is an available rack group.
在对需要的资源数量与可用机架组的数量进行比较时,如果需要的资源数量不大于基于TOR建立的可用机架组的数量,则从可用机架组中选择与需要的资源数量相同的可用资源进行分配,下面分别对需要的资源为物理主机资源和需要的资源为虚拟主机资源进行说明。When comparing the number of required resources with the number of available rack groups, if the number of required resources is not greater than the number of available rack groups based on TOR, select the same number of resources from the available rack groups The available resources are allocated. The following describes the required resources as physical host resources and the required resources as virtual host resources.
情形一、需要的资源为物理主机资源。Case 1: The required resources are physical host resources.
首先从可用机架组中选择与需要的资源数量相同的资源使用率小的可用机架组,然后针对一个资源使用率小的可用机架组,从资源使用率小的可用机架组中选择一个可用物理机SN和IP地址,最后将选择的一个可用物理机SN和IP地址发送给用户所在终端。First, select an available rack group with a small resource usage rate from the available rack groups with the same amount of resources as needed, and then select an available rack group with a small resource usage rate from the available rack group with a small resource usage rate An available physical machine SN and IP address, and finally the selected available physical machine SN and IP address are sent to the user's terminal.
其中,可用机架组的资源使用率,也就是在该机架组下,未被占用的物理主机的数量与物理主机的总数量进行比值,结果即为该可用机架组的资源使用率。Among them, the resource usage rate of the available rack group, that is, the ratio of the number of unoccupied physical hosts under the rack group to the total number of physical hosts, and the result is the resource usage rate of the available rack group.
比如,在机架组1下有42个物理主机,其中有21个物理主机被占用,则机架组1的资源使用率为50%。For example, if there are 42 physical hosts in rack group 1, 21 of which are occupied, the resource utilization rate of rack group 1 is 50%.
从可用机架组中选择与需要的资源数量相同的资源使用率小的可用机架组,可以计算所有可用机架组的资源使用率,然后从所有机架组中选择与需要的资源数量相同的资源使用率小的可用机架组。Select an available rack group with a small resource usage rate from the available rack groups that has the same number of resources as needed. You can calculate the resource usage rate of all available rack groups, and then select from all rack groups the same number of resources as required Available rack groups with small resource usage.
比如,有5个可用机架组,分别为可用机架组1,可用机架组2,可用机架组3,可用机架组4,可用机架组5,分别计算出每个可用机架组的资源使用率,可用机架组1的资源使用率为10%,可用机架组2的资源使用率为15%,可用机架组3的资源使用率为30%,可用机架组4的资源使用率为35%,可用机架组5的资源使用率为50,需要的资源数量为 2,则从5个可用机架组中选择2个资源使用率小的可用机架组,即可用机架组1和可用机架组2。For example, there are 5 available rack groups, which are available rack group 1, available rack group 2, available rack group 3, available rack group 4, available rack group 5, and calculate each available rack separately The resource usage rate of the group, the resource usage rate of available rack group 1 is 10%, the resource usage rate of available rack group 2 is 15%, the resource usage rate of available rack group 3 is 30%, and the resource usage rate of available rack group 4 The resource utilization rate of the available rack group 5 is 35%, the resource utilization rate of the available rack group 5 is 50, and the number of resources required is 2, then select 2 available rack groups with low resource utilization from the 5 available rack groups, namely Available rack group 1 and available rack group 2.
选择了与需要的资源数量相同的资源使用率小的可用机架组后,针对一个资源使用率小的可用机架组,从该资源使用率小的可用机架组中选择一个可用物理机SN和IP地址。After selecting an available rack group with a small resource usage rate that is the same as the required number of resources, for an available rack group with a small resource usage rate, select an available physical machine SN from the available rack group with a small resource usage rate And IP address.
从资源使用率小的可用机架组中选择一个可用的物理机SN和IP地址,选择方式可以是随机选择,也可以通过预设规则选择,对此本申请不做限制。Select an available physical machine SN and IP address from a group of available racks with a low resource utilization rate. The selection method can be random selection or selection through preset rules. This application is not limited.
比如,选择了2个资源使用率小的可用机架组,可用机架组1和可用机架组2,可用机架组1中有2个未被占用的物理主机,物理主机1和物理主机2,可用机架组2中有3个未被占用的物理主机,物理主机3、物理主机4和物理主机5,从每个选择的可用机架组中选择一个可用物理主机SN和IP地址,选择方式可以为随机选择,也可以根据预设规则选择。For example, two available rack groups with low resource usage are selected, available rack group 1 and available rack group 2, and available rack group 1 has 2 unoccupied physical hosts, physical host 1 and physical host 2. There are 3 unoccupied physical hosts in the available rack group 2, physical host 3, physical host 4 and physical host 5. Choose an available physical host SN and IP address from each selected available rack group, The selection method can be selected randomly or according to preset rules.
选择了物理主机SN和IP地址后,将选择的物理主机SN和IP地址返回给用户所在终端。After selecting the physical host SN and IP address, the selected physical host SN and IP address are returned to the terminal where the user is located.
情形二、需要的资源为虚拟主机资源。Case 2: The required resources are virtual host resources.
从可用机架组中选择与需要的资源数量相同的资源使用率小的可用机架组,从资源使用率小的可用机架组中选择与需要的资源数量相同的IP地址,以及从资源使用率小的可用机架组中选择资源名称,根据IP地址和资源名称确定虚拟主机对应的母机SN和虚拟主机IP地址;将母机SN和虚拟主机IP地址发送给用户所在终端。Select an available rack group with the same amount of resources as the required resource from the available rack group, select an IP address with the same number of resources as the required resource from the available rack group with a small resource usage, and use the resource Select the resource name from the available rack group with low rate, determine the parent machine SN and virtual host IP address corresponding to the virtual host according to the IP address and resource name; send the parent machine SN and virtual host IP address to the user's terminal.
从可用机架组中选择与需要的资源数量相同的资源使用率小的可用机架组,和情形一中相同,此处不再重复赘述。Select an available rack group with a smaller resource usage rate that is the same as the required number of resources from the available rack groups, which is the same as in scenario 1, and will not be repeated here.
从资源使用率小的可用机架组中选择与需要的资源数量相同的IP地址,可以基于机架组计算出Openstack的AZ,也就是未被占用的物理主机的集合,然后从虚拟网段的IP地址池中分配出与所述需要的资源数量相同的IP地址,并根据CMDB中递增分配物理主机名称,将分配出的IP地址和物理主机名称返回给用户。Select an IP address with the same amount of resources from the available rack group with low resource usage. Based on the rack group, you can calculate the Openstack AZ, that is, the set of unoccupied physical hosts, and then select the IP address from the virtual network segment. The IP address pool is allocated the same number of IP addresses as the required resources, and the physical host name is incrementally allocated according to the CMDB, and the allocated IP address and physical host name are returned to the user.
需要说明的是,主机名称的创建规则可以为:CN+city+IDC+编号,比如,使用规则引擎创建的第一台主机名称为CNSZFT05010001,第二台主机名称为CNSZFT05010002,以此类推,其中,CN代表china(中国),SZ代表深圳,FT代表某0501机房,0001代表编号。It should be noted that the host name creation rule can be: CN+city+IDC+number. For example, the first host name created by the rule engine is CNSZFT05010001, the second host name is CNSZFT05010002, and so on, where CN Represents China (China), SZ represents Shenzhen, FT represents a 0501 computer room, and 0001 represents the serial number.
以上是对需要的资源数量不大于可用机架组的数量的情况进行资源分配的说明,如果需要的资源数量大于可用机架组的数量,说明机架组不能满足需要的资源,如果需要的资源为物理主机资源,则可以对可用机架组中至少一个可用机架组的可用资源进行重复分配。The above is an explanation of resource allocation when the number of required resources is not greater than the number of available rack groups. If the number of required resources is greater than the number of available rack groups, it means that the rack group cannot meet the required resources. If the required resources are If it is a physical host resource, the available resources of at least one available rack group in the available rack group can be repeatedly allocated.
下面对需要的资源为物理主机资源进行举例说明。The following is an example to illustrate that the required resources are physical host resources.
比如,需要的物理主机资源的数量为4,可用机架组为可用机架组1,可用机架组2,可用机架组3,需要的物理资源的数量4大于可用机架组的数量3,此时可以从可用机架组1中随机选择一个可用物理主机,从机架组2中随机选择一个可用物理主机,从可用机架组3中随机选择两个可用物理主机进行资源分配,此时,可用机架组3进行了重复分配。For example, the number of physical host resources required is 4, the available rack group is available rack group 1, available rack group 2, and available rack group 3. The number of physical resources required 4 is greater than the number of available rack groups 3. At this time, you can randomly select an available physical host from the available rack group 1, randomly select an available physical host from the rack group 2, and randomly select two available physical hosts from the available rack group 3 for resource allocation. At the time, the available rack group 3 was repeatedly allocated.
如果需要的资源为虚拟主机资源,且需要的资源数量大于可用机架组的数量,且不大于所述需要的资源对应的业务系统的可用物理主机的数量,则从所述业务系统的可用物理主机中选择与所述需要的资源数量相同的可用资源进行分配。If the required resource is a virtual host resource, and the number of required resources is greater than the number of available rack groups, and is not greater than the number of available physical hosts of the business system corresponding to the required resource, then from the available physical hosts of the business system The host selects the available resources that are the same as the required number of resources for allocation.
一种实施方式中,从业务系统的可用物理主机中选择与所述需要的资源数量相同的可用资源进行分配,可以基于机架组得到Openstack的AZ,也就是未被占用的物理主机的集合,然后从虚拟网段的IP地址池中分配出与所述需要的资源数量相同的IP地址,并根据CMDB中递增分配物理主机名称,将分配出的IP地址和物理主机名称发送给用户所在终端。In one embodiment, the available resources with the same amount of resources as the required resources are selected from the available physical hosts of the business system for allocation, and the AZ of Openstack can be obtained based on the rack group, that is, the set of unoccupied physical hosts. Then, from the IP address pool of the virtual network segment, an IP address equal to the required number of resources is allocated, the physical host name is incrementally allocated according to the CMDB, and the allocated IP address and physical host name are sent to the terminal where the user is located.
这里基于机架组得到Openstack的AZ,可以是在搭建Openstack时预先创建好的定义规则,也就是机架组和AZ之间存在对应关系,确定了机架组后,即可根据对应关系确定AZ;Here, the AZ of Openstack is obtained based on the rack group, which can be defined rules created in advance when building Openstack, that is, there is a corresponding relationship between the rack group and the AZ. After the rack group is determined, the AZ can be determined according to the corresponding relationship ;
虚拟网的IP地址池,可以是在搭建Openstack时预先创建好虚拟网段,虚拟网段构成虚拟网的IP地址池。The IP address pool of the virtual network can be a virtual network segment created in advance when Openstack is built, and the virtual network segment constitutes the IP address pool of the virtual network.
如果需要的资源为虚拟主机资源,且需要的资源数量大于可用机架组的数量,且大于所述需要的资源对应的业务系统中可用资源的数量,则说明现有资源不能满足需要的资源,因此显示异常提示,不进行资源分配。If the required resources are virtual host resources, and the number of required resources is greater than the number of available rack groups, and is greater than the number of available resources in the business system corresponding to the required resources, it means that the existing resources cannot meet the required resources. Therefore, an abnormal prompt is displayed and no resource allocation is performed.
下面以具体的实施例进行说明。Specific examples are described below.
实施例一:物理主机资源分配。Embodiment 1: Physical host resource allocation.
如图2所示,为本发明实施例提供的物理主机资源分配流程示意图。As shown in FIG. 2, it is a schematic diagram of a physical host resource allocation process provided by an embodiment of the present invention.
S200,确定现网CMDB中可用机架组数量;S200: Determine the number of rack groups available in the CMDB on the live network;
S201,接收用户提交的ITSM资源申请信息;S201: Receive ITSM resource application information submitted by a user;
S202,从该ITSM资源申请信息中获取实例数;S202: Obtain the number of instances from the ITSM resource application information;
S203,判断资源申请信息中实例数是否小于现网中可用机架组数量,如果是,则执行S204,否则执行S211;S203: Determine whether the number of instances in the resource application information is less than the number of available rack groups in the live network, if so, perform S204, otherwise perform S211;
S204,计算每个可用机架组的资源使用率;S204: Calculate the resource usage rate of each available rack group;
S205,从可用机架组中选择与实例数相同的资源使用率小的可用机架组;S205: Select an available rack group with the same number of instances as the available rack group with a small resource usage rate from the available rack groups;
S206,从选择的每个资源使用率小的可用机架组选取具体的RACK;S206: Select a specific RACK from each selected available rack group with a small resource usage rate;
S207,从每个可用机架组中筛选具体机位中的物理主机;S207, screening physical hosts in specific machine positions from each available rack group;
S208,获取筛选的物理主机的SN和IP地址;S208: Obtain the SN and IP address of the physical host to be screened;
S209,将获取的SN和IP地址传入物理机纳管平台进行分配;S209: Pass the acquired SN and IP address to the physical machine hosting platform for distribution;
S210,将分配的SN和IP地址同步到CMDB;S210: Synchronize the assigned SN and IP address to the CMDB;
S211,选择至少一个机架组进行重复分配;S211: Select at least one rack group for repeated allocation;
S212,从可用机架组中选择具体的RACK,执行S207。S212: Select a specific RACK from the available rack group, and execute S207.
实施例二:虚拟主机资源分配。Embodiment 2: Virtual host resource allocation.
如图3所示,为本发明实施例提供的虚拟主机资源分配流程示意图。As shown in FIG. 3, it is a schematic diagram of a virtual host resource allocation process provided by an embodiment of the present invention.
S300,确定现网CMDB中可用机架组的数量;S300: Determine the number of available rack groups in the CMDB on the live network;
S301,接收用户提交的ITSM资源申请信息;S301: Receive ITSM resource application information submitted by the user;
S302,从该ITSM资源申请信息中获取实例数N;S302: Obtain the number of instances N from the ITSM resource application information;
S303,确定N是否小于现网中可用机架组数量,如果是,则执行S304,否则执行S312;S303: Determine whether N is less than the number of available rack groups in the live network, if so, perform S304, otherwise perform S312;
S304,计算每个可用机架组的资源使用率;S304: Calculate the resource usage rate of each available rack group;
S305,从可用机架组中选择与N个资源使用率小的可用机架组;S305: Select N available rack groups with low resource usage from the available rack groups;
S306,以N个使用率小的可用机架组建立OpenStack的AZ;S306: Establish OpenStack AZ with N available rack groups with low usage rate;
S307,从AZ中选择N个主机;S307: Select N hosts from AZ;
S308,从N个主机的虚拟网段的IP地址池中选择N个IP地址;S308: Select N IP addresses from the IP address pool of the virtual network segments of the N hosts;
S309,根据CMDB中递增确定主机名称;S309: Determine the host name according to the increment in the CMDB;
S310,基于主机名称和N个IP地址,确定母机SN和对应的IP地址;S310, based on the host name and N IP addresses, determine the SN of the parent machine and the corresponding IP address;
S311,将确定的母机SN和对应的IP地址同步到CMDB;S311: Synchronize the determined parent machine SN and corresponding IP address to the CMDB;
S312,将可用机架组中的可用主机组成亲合组;S312, forming an affinity group of available hosts in the available rack group;
S313,判断N是否小于亲合组中主机数量,如果是,则执行S314,否则执行S316;S313: Determine whether N is less than the number of hosts in the affinity group, if so, perform S314, otherwise perform S316;
S314,从亲和组中随机选择N个主机;S314, randomly selecting N hosts from the affinity group;
S315,基于可用机架组建立OpenStack的AZ,执行S307;S315: Establish an OpenStack AZ based on the available rack group, and execute S307;
S316,显示异常信息,不进行分配。S316: Display abnormal information and do not allocate.
基于同一发明构思,本发明实施例中还提供了一种资源分配装置,由于该装置对应的是本发明实施例资源分配方法对应的装置,并且该装置解决问题的原理与该方法相似,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present invention also provides a resource allocation device. Since the device corresponds to the device corresponding to the resource allocation method in the embodiment of the present invention, and the principle of the device to solve the problem is similar to the method, the The implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
如图4所示,为本发明实施例提供的一种资源分配装置结构示意图,该装置包括:确 定模块400和分配模块401:As shown in FIG. 4, it is a schematic structural diagram of a resource allocation device provided by an embodiment of the present invention. The device includes: a determining module 400 and an allocation module 401:
确定模块400,用于确定需要的资源数量;The determining module 400 is used to determine the required amount of resources;
分配模块401,若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则用于从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。The allocation module 401, if the number of required resources is not greater than the number of available rack groups established based on the TOR of the data center, is used to select from the available rack groups the same as the number of required resources The available resources are allocated, wherein the available rack group is a rack group for which available resources exist in the rack group.
可选的,所述分配模块401还用于:Optionally, the allocation module 401 is further configured to:
所述确定需要的资源数量之后,所述需要的资源为物理主机资源,若所述需要的资源数量大于所述可用机架组的数量,则所述可用机架组中至少一个可用机架组的可用资源进行重复分配;After the number of required resources is determined, the required resources are physical host resources. If the number of required resources is greater than the number of available rack groups, at least one available rack group in the available rack group The available resources are repeatedly allocated;
所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,且所述需要的资源数量不大于所述需要的资源对应的业务系统中可用物理主机的数量,则从所述业务系统中可用物理主机的数量中选择与所述需要的资源数量相同的可用资源进行分配。The required resources are virtual host resources, if the number of required resources is greater than the number of available rack groups, and the number of required resources is not greater than the number of available physical hosts in the business system corresponding to the required resources The number of available resources is selected from the number of available physical hosts in the business system, which is the same as the required number of resources, for allocation.
可选的,所述分配模块401还用于:Optionally, the allocation module 401 is further configured to:
所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,若所述需要的资源数量大于所述需要的资源对应的业务系统中可用资源的数量,则不进行资源分配。The required resource is a virtual host resource, if the number of required resources is greater than the number of available rack groups, and if the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, Then no resource allocation is performed.
可选的,所述需要的资源为物理主机资源,所述分配模块401具体用于:Optionally, the required resources are physical host resources, and the allocation module 401 is specifically configured to:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
针对一个资源使用率小的可用机架组,从所述资源使用率小的可用机架组中选择一个可用物理机SN和IP地址;For an available rack group with a small resource usage rate, select an available physical machine SN and IP address from the available rack group with a small resource usage rate;
将选择的一个可用物理机SN和IP地址发送给用户所在终端。Send the selected available physical machine SN and IP address to the terminal where the user is located.
可选的,所述需要的资源为虚拟主机资源;所述分配模块401具体用于:Optionally, the required resource is a virtual host resource; the allocation module 401 is specifically configured to:
从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
从所述资源使用率小的可用机架组中选择与所述需要的资源数量相同的IP地址,以及从所述资源使用率小的可用机架组中选择资源名称;Selecting an IP address with the same amount of resources from the available rack group with a low resource usage rate, and selecting a resource name from the available rack group with a low resource usage rate;
根据所述IP地址和所述资源名称确定虚拟主机对应的母机SN和虚拟主机IP地址;Determining the parent machine SN and the virtual host IP address corresponding to the virtual host according to the IP address and the resource name;
将所述母机SN和虚拟主机IP地址发送给用户所在终端。The SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
基于同一发明构思,本发明实施例中还提供了另一种资源分配装置,由于该装置对应的是本发明实施例资源分配方法对应的装置,并且该装置解决问题的原理与该方法相似,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, another resource allocation device is provided in the embodiment of the present invention. Since the device corresponds to the device corresponding to the resource allocation method in the embodiment of the present invention, and the principle of the device to solve the problem is similar to that of the method, The implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
如图5所示,为本发明实施例提供的一种资源分配设备结构示意图,该设备500包括:As shown in FIG. 5, it is a schematic structural diagram of a resource allocation device provided by an embodiment of the present invention. The device 500 includes:
通信接口501,存储器502以及处理器503;Communication interface 501, memory 502 and processor 503;
其中,所述处理器503通过所述通信接口501与其它设备进行通信,比如,其它设备可以是前述外部在线翻译工具。其中,通信接口501可以提供应用程序编程接口的解决方案。The processor 503 communicates with other devices through the communication interface 501. For example, the other devices may be the aforementioned external online translation tools. Among them, the communication interface 501 can provide an application programming interface solution.
处理器503可以通过通信接口501向外部在线翻译工具发送前述翻译参数等;存储器502,用于存储程序指令;处理器503,用于调用所述存储器502中存储的程序指令,按照获得的程序执行上述实施例中的方法。The processor 503 can send the aforementioned translation parameters etc. to an external online translation tool through the communication interface 501; the memory 502 is used to store program instructions; the processor 503 is used to call the program instructions stored in the memory 502 and execute according to the obtained program The method in the above embodiment.
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and may implement or Perform the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
在本申请实施例中,存储器,用于存储程序指令,存储器可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。本申请实施例中不限定上述通信接口、存储器以及处理器之间的具体连接介质,比如总线,总线可以分为地址总线、数据总线、控制总线等。In the embodiment of the present application, the memory is used to store program instructions. The memory can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it can be volatile. Volatile memory (volatile memory), such as random-access memory (RAM). The memory may also be any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function, for storing program instructions and/or data. The embodiments of the present application do not limit the specific connection medium between the aforementioned communication interface, memory, and processor, such as a bus. The bus can be divided into an address bus, a data bus, and a control bus.
进一步地,本发明实施例还提供一种资源分配的可读存储介质,包括程序代码,当所述程序代码在计算设备上运行时,所述程序代码用于使所述计算设备执行资源分配方法的步骤。Further, an embodiment of the present invention also provides a readable storage medium for resource allocation, including program code, and when the program code runs on a computing device, the program code is used to make the computing device execute the resource allocation method A step of.
以上参照示出根据本申请实施例的方法、装置(系统)和/或计算机程序产品的框图和/或流程图描述本申请。应理解,可以通过计算机程序指令来实现框图和/或流程图示图的一个块以及框图和/或流程图示图的块的组合。可以将这些计算机程序指令提供给通用计算机、专用计算机的处理器和/或其它可编程数据处理装置,以产生机器,使得经由计算机处理器和/或其它可编程数据处理装置执行的指令创建用于实现框图和/或流程图块中所指定的功能/动作的方法。The foregoing describes the present application with reference to block diagrams and/or flowcharts showing methods, devices (systems) and/or computer program products according to embodiments of the present application. It should be understood that one block of the block diagram and/or flowchart diagram and a combination of the blocks in the block diagram and/or flowchart diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, and/or other programmable data processing devices to produce a machine, so that the instructions executed via the computer processor and/or other programmable data processing devices are created for A method of implementing the functions/actions specified in the block diagram and/or flowchart block.
相应地,还可以用硬件和/或软件(包括固件、驻留软件、微码等)来实施本申请。更 进一步地,本申请可以采取计算机可使用或计算机可读存储介质上的计算机程序产品的形式,其具有在介质中实现的计算机可使用或计算机可读程序代码,以由指令执行系统来使用或结合指令执行系统而使用。在本申请上下文中,计算机可使用或计算机可读介质可以是任意介质,其可以包含、存储、通信、传输、或传送程序,以由指令执行系统、装置或设备使用,或结合指令执行系统、装置或设备使用。Correspondingly, hardware and/or software (including firmware, resident software, microcode, etc.) can also be used to implement this application. Furthermore, this application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium to be used by the instruction execution system or Used in conjunction with the instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or transmit a program for use by an instruction execution system, device, or device, or in combination with an instruction execution system, Device or equipment use.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (11)

  1. 一种资源分配方法,其特征在于,该方法包括:A resource allocation method, characterized in that the method includes:
    确定需要的资源数量;Determine the amount of resources needed;
    若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。If the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, then the available resources with the same number of required resources are selected from the available rack groups for allocation, where The available rack group is a rack group with available resources in the rack group.
  2. 如权利要求1所述的方法,其特征在于,所述确定需要的资源数量之后,还包括:The method according to claim 1, wherein after the determining the required amount of resources, the method further comprises:
    所述需要的资源为物理主机资源,若所述需要的资源数量大于所述可用机架组的数量,则对所述可用机架组中至少一个可用机架组的可用资源进行重复分配;The required resources are physical host resources, and if the number of required resources is greater than the number of available rack groups, the available resources of at least one available rack group in the available rack group are repeatedly allocated;
    所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,且不大于所述需要的资源对应的业务系统的可用物理主机的数量,则从所述业务系统的可用物理主机中选择与所述需要的资源数量相同的可用资源进行分配。The required resource is a virtual host resource. If the number of required resources is greater than the number of available rack groups and not greater than the number of available physical hosts of the business system corresponding to the required resource, then The available physical hosts of the business system are selected and allocated with the same amount of available resources as the required resources.
  3. 如权利要求2所述的方法,其特征在于,所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,还包括:The method according to claim 2, wherein the required resources are virtual host resources, and if the number of required resources is greater than the number of available rack groups, the method further comprises:
    若所述需要的资源数量大于所述需要的资源对应的业务系统中可用资源的数量,则不进行资源分配。If the number of required resources is greater than the number of available resources in the business system corresponding to the required resources, no resource allocation is performed.
  4. 如权利要求1所述的方法,其特征在于,所述需要的资源为物理主机资源;The method of claim 1, wherein the required resources are physical host resources;
    所述从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,包括:The selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
    从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
    针对一个资源使用率小的可用机架组,从所述资源使用率小的可用机架组中选择一个可用物理机序列号SN和网络协议IP地址;For an available rack group with a small resource usage rate, select an available physical machine serial number SN and a network protocol IP address from the available rack group with a small resource usage rate;
    将选择的一个可用物理机SN和IP地址发送给用户所在终端。Send the selected available physical machine SN and IP address to the terminal where the user is located.
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述需要的资源为虚拟主机资源;The method according to any one of claims 1 to 4, wherein the required resource is a virtual host resource;
    所述从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,包括:The selecting from the available rack group the same amount of available resources as the required resources to allocate includes:
    从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
    从所述资源使用率小的可用机架组中选择与所述需要的资源数量相同的IP地址,以及从所述资源使用率小的可用机架组中选择资源名称;Selecting an IP address with the same amount of resources from the available rack group with a low resource usage rate, and selecting a resource name from the available rack group with a low resource usage rate;
    根据所述IP地址和所述资源名称确定虚拟主机对应的母机SN和虚拟主机IP;Determining the parent machine SN and the virtual host IP corresponding to the virtual host according to the IP address and the resource name;
    将所述母机SN和虚拟主机IP地址发送给用户所在终端。The SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
  6. 一种资源分配装置,其特征在于,该装置包括:A resource allocation device, characterized in that the device includes:
    确定模块,用于确定需要的资源数量;Determine module, used to determine the amount of resources needed;
    分配模块,若所述需要的资源数量不大于基于数据中心的布线方式TOR建立的可用机架组的数量,则用于从所述可用机架组中选择与所述需要的资源数量相同的可用资源进行分配,其中所述可用机架组为在所述机架组中存在可用资源的机架组。The allocation module, if the number of required resources is not greater than the number of available rack groups established based on the data center wiring method TOR, then it is used to select from the available rack groups the same number of available resources as the required number of resources Resources are allocated, wherein the available rack group is a rack group for which there are available resources in the rack group.
  7. 如权利要求6所述的装置,其特征在于,所述分配模块还用于:The device according to claim 6, wherein the distribution module is further configured to:
    所述确定需要的资源数量之后,所述需要的资源为物理主机资源,若所述需要的资源数量大于所述可用机架组的数量,则对所述可用机架组中至少一个可用机架组的可用资源进行重复分配;After the number of required resources is determined, the required resources are physical host resources. If the number of required resources is greater than the number of the available rack group, then at least one available rack in the available rack group The available resources of the group are repeatedly allocated;
    所述需要的资源为虚拟主机资源,若所述需要的资源数量大于所述可用机架组的数量,且所述需要的资源数量不大于所述需要的资源对应的业务系统中可用物理主机的数量,则从所述业务系统中可用物理主机的数量中选择与所述需要的资源数量相同的可用资源进行分配。The required resources are virtual host resources, if the number of required resources is greater than the number of available rack groups, and the number of required resources is not greater than the number of available physical hosts in the business system corresponding to the required resources The number of available resources is selected from the number of available physical hosts in the business system, which is the same as the required number of resources, for allocation.
  8. 如权利要求6所述的装置,其特征在于,所述需要的资源为物理主机资源,所述分配模块具体用于:7. The device of claim 6, wherein the required resource is a physical host resource, and the allocation module is specifically configured to:
    从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
    针对一个资源使用率小的可用机架组,从所述资源使用率小的可用机架组中选择一个可用物理机SN和IP地址;For an available rack group with a small resource usage rate, select an available physical machine SN and IP address from the available rack group with a small resource usage rate;
    将选择的一个可用物理机SN和IP地址发送给用户所在终端。Send the selected available physical machine SN and IP address to the terminal where the user is located.
  9. 如权利要求6-8任一项所述的装置,其特征在于,所述需要的资源为虚拟主机资源;所述分配模块具体用于:8. The device according to any one of claims 6-8, wherein the required resource is a virtual host resource; and the allocation module is specifically configured to:
    从所述可用机架组中选择与所述需要的资源数量相同的资源使用率小的可用机架组;Selecting, from the available rack groups, an available rack group that has the same amount of resources as the required resource and has a low resource usage rate;
    从所述资源使用率小的可用机架组中选择与所述需要的资源数量相同的IP地址,以及从所述资源使用率小的可用机架组中选择资源名称;Selecting an IP address with the same amount of resources from the available rack group with a low resource usage rate, and selecting a resource name from the available rack group with a low resource usage rate;
    根据所述IP地址和所述资源名称确定虚拟主机对应的母机SN和虚拟主机IP地址;Determining the parent machine SN and the virtual host IP address corresponding to the virtual host according to the IP address and the resource name;
    将所述母机SN和虚拟主机IP地址发送给用户所在终端。The SN of the parent machine and the IP address of the virtual host are sent to the terminal where the user is located.
  10. 一种资源分配设备,其特征在于,包括:A resource allocation device, characterized in that it comprises:
    存储器以及处理器;Memory and processor;
    存储器,用于存储程序指令;Memory, used to store program instructions;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1~5任一项所述的方法。The processor is configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 5 according to the obtained program.
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机 指令,当所述计算机指令在计算机上运行时,使得计算机执行权利要求1~5中任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer, the computer executes the method described in any one of claims 1 to 5 method.
PCT/CN2020/092740 2019-06-19 2020-05-27 Resource allocation method, apparatus and device WO2020253490A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910532166.0A CN110287025A (en) 2019-06-19 2019-06-19 A kind of resource allocation methods, device and equipment
CN201910532166.0 2019-06-19

Publications (1)

Publication Number Publication Date
WO2020253490A1 true WO2020253490A1 (en) 2020-12-24

Family

ID=68004791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/092740 WO2020253490A1 (en) 2019-06-19 2020-05-27 Resource allocation method, apparatus and device

Country Status (2)

Country Link
CN (1) CN110287025A (en)
WO (1) WO2020253490A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287025A (en) * 2019-06-19 2019-09-27 深圳前海微众银行股份有限公司 A kind of resource allocation methods, device and equipment
CN113949637A (en) * 2021-10-28 2022-01-18 中国建设银行股份有限公司 Intelligent distribution and deployment method and device for switch resources

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327095A (en) * 2013-06-20 2013-09-25 电子科技大学 Extensible data center network architecture and implementation method
CN103797463A (en) * 2011-07-27 2014-05-14 阿尔卡特朗讯公司 Method and apparatus for assignment of virtual resources within a cloud environment
CN105404545A (en) * 2015-12-03 2016-03-16 中国联合网络通信集团有限公司 Virtual machine allocating method and apparatus
CN108037984A (en) * 2017-11-28 2018-05-15 深圳前海微众银行股份有限公司 Method for managing resource, system and the readable storage medium storing program for executing of data analysis
US20180254999A1 (en) * 2017-03-06 2018-09-06 Linkedin Corporation Multidimensional resource allocation in data centers
CN110287025A (en) * 2019-06-19 2019-09-27 深圳前海微众银行股份有限公司 A kind of resource allocation methods, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103797463A (en) * 2011-07-27 2014-05-14 阿尔卡特朗讯公司 Method and apparatus for assignment of virtual resources within a cloud environment
CN103327095A (en) * 2013-06-20 2013-09-25 电子科技大学 Extensible data center network architecture and implementation method
CN105404545A (en) * 2015-12-03 2016-03-16 中国联合网络通信集团有限公司 Virtual machine allocating method and apparatus
US20180254999A1 (en) * 2017-03-06 2018-09-06 Linkedin Corporation Multidimensional resource allocation in data centers
CN108037984A (en) * 2017-11-28 2018-05-15 深圳前海微众银行股份有限公司 Method for managing resource, system and the readable storage medium storing program for executing of data analysis
CN110287025A (en) * 2019-06-19 2019-09-27 深圳前海微众银行股份有限公司 A kind of resource allocation methods, device and equipment

Also Published As

Publication number Publication date
CN110287025A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN109582433B (en) Resource scheduling method and device, cloud computing system and storage medium
CN104253865B (en) A kind of two-level management method of mixed type desktop cloud service platform
CN106385329B (en) Processing method, device and the equipment of resource pool
CN107547595B (en) Cloud resource scheduling system, method and device
US8695079B1 (en) Allocating shared resources
CN103078965B (en) The IP address management method of virtual machine
CN105579965A (en) Client-premise resource control via provider-defined interfaces
EP3442201B1 (en) Cloud platform construction method and cloud platform
WO2020253490A1 (en) Resource allocation method, apparatus and device
CN107666493B (en) Database configuration method and equipment thereof
CN103118073B (en) Virtual machine data persistence storage system and method in cloud environment
JP2009237826A (en) Storage system and volume management method therefor
US10761869B2 (en) Cloud platform construction method and cloud platform storing image files in storage backend cluster according to image file type
EP3637252A1 (en) Virtual machine deployment method and omm virtual machine
JP2013174945A (en) Thin client system, connection management server, connection management method and connection management program
Ma et al. vLocality: Revisiting data locality for MapReduce in virtualized clouds
Mylavarapu et al. An optimized capacity planning approach for virtual infrastructure exhibiting stochastic workload
CN107209706A (en) The application of maintenance and the method and system of desktop are received for connecting devices to
CN104809026B (en) A kind of method that CPU computing resources are borrowed using remote node
CN113535087A (en) Data processing method, server and storage system in data migration process
US20100269119A1 (en) Event-based dynamic resource provisioning
CN111915811A (en) Method and equipment for controlling cabinet access by multiple hosts
Nivetha et al. Modeling fuzzy based replication strategy to improve data availabiity in cloud datacenter
CN110798362A (en) Multi-data center online management system and management method based on Internet of things
US9229659B2 (en) Identifying and accessing reference data in an in-memory data grid

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: 20827514

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: 20827514

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 29/03/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20827514

Country of ref document: EP

Kind code of ref document: A1