WO2022257388A1 - 一种虚拟机限速方法、装置、设备、存储介质和程序 - Google Patents

一种虚拟机限速方法、装置、设备、存储介质和程序 Download PDF

Info

Publication number
WO2022257388A1
WO2022257388A1 PCT/CN2021/135932 CN2021135932W WO2022257388A1 WO 2022257388 A1 WO2022257388 A1 WO 2022257388A1 CN 2021135932 W CN2021135932 W CN 2021135932W WO 2022257388 A1 WO2022257388 A1 WO 2022257388A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
target object
computing node
parameters
disk
Prior art date
Application number
PCT/CN2021/135932
Other languages
English (en)
French (fr)
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 WO2022257388A1 publication Critical patent/WO2022257388A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present application relates to the technical field of cloud computing of financial technology (Fintech), and relates to but not limited to a virtual machine speed limit method, device, electronic equipment, computer storage medium and computer program product.
  • some cloud computing vendors will take specific measures to limit the network bandwidth and IO speed of the virtual machines in the Openstack cluster, such as: on the integrated bridge (br-int) for specific virtual machines Set corresponding QoS queues and rules on the port (port) of the machine to control the flow of the virtual Layer 2 port; however, this method of speed limit setting is not clear and intuitive enough, which is not conducive to users directly querying the size of the QoS speed limit, which affects QoS speed limit effect.
  • the present application provides a virtual machine speed limit method, device, electronic equipment, computer storage medium and computer program product, which can solve the problem that the speed limit method is not clear and intuitive when limiting the speed of the disk or network of the virtual machine in the related art. It is not conducive for users to directly query the QoS rate limit.
  • the embodiment of the present application provides a method for limiting the speed of a virtual machine, which is applied to a virtual machine in an Openstack cluster, and the method includes:
  • the target object includes at least one of the system disk, data disk and network of the virtual machine;
  • adding the configuration items to the parameters of the target object includes:
  • the type template flavor corresponding to the system disk is obtained through the nova component;
  • the configuration items are used as parameters of the flavor corresponding to the system disk; the parameters of the target object include the parameters of the flavor corresponding to the system disk.
  • adding the configuration items to the parameters of the target object includes:
  • the cinder component is used to bind each configuration item to the storage type of the data disk to obtain a binding result
  • adding the configuration items to the parameters of the target object includes:
  • the flavor corresponding to the network is obtained through the nova component
  • the various configuration items are used as parameters of the flavor corresponding to the network; the parameters of the target object include parameters of the flavor corresponding to the network.
  • the method also includes:
  • the determining the weight value of each computing node in the at least one computing node includes:
  • the weight value of each computing node in the at least one computing node is determined based on the remaining resource size and the number of runnable virtual machines when each computing node in the at least one computing node executes each project.
  • the determining the target node for creating the virtual machine based on the weight value includes:
  • each computing node in the at least one computing node Based on the weight value of each computing node in the at least one computing node, determine a target weight value greater than a set threshold; determine the computing node corresponding to the target weight value as the target node for creating the virtual machine;
  • the method also includes:
  • the proxy node is pre-installed on the virtual machine;
  • the target data volume includes IO and/or bandwidth;
  • an alarm notification is triggered.
  • the embodiment of the present application also proposes a virtual machine speed limiting device, which is applied to a virtual machine in an Openstack cluster, and the device includes an acquisition module and a speed limiting module, wherein,
  • the obtaining module is configured to obtain various configuration items that limit the speed of the target object;
  • the target object includes at least one of the system disk, data disk and network of the virtual machine;
  • the speed limiting module is configured to add the various configuration items to the parameters of the target object, and limit the speed of the target object according to the parameters of the target object.
  • An embodiment of the present application provides an electronic device, the device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements one or more of the aforementioned technologies when executing the program The virtual machine speed limit method provided by the solution.
  • An embodiment of the present application provides a computer storage medium, and the computer storage medium stores a computer program; after the computer program is executed, the method for limiting the speed of a virtual machine provided by one or more of the foregoing technical solutions can be implemented.
  • the embodiment of the present application also provides a computer program product, including computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes to implement the aforementioned one or more The virtual machine speed limit method provided by the technical solution.
  • the embodiment of the present application proposes a virtual machine speed limit method, device, electronic equipment, computer storage medium and computer program product, the method is applied to the virtual machine in the Openstack cluster, and the method includes: obtaining Each configuration item of the speed; the target object includes at least one of the system disk, data disk, and network of the virtual machine; the various configuration items are added to the parameters of the target object, and according to the target object Parameters to limit the speed of the target object.
  • Fig. 1a is a schematic flowchart of a method for limiting the speed of a virtual machine in an embodiment of the present application
  • Fig. 1b is a schematic flow chart of limiting the speed of the system disk in the embodiment of the present application.
  • Fig. 1c is a schematic flow chart of limiting the speed of the data disk in the embodiment of the present application.
  • Fig. 1d is a schematic flow diagram of limiting the speed of the network in the embodiment of the present application.
  • Fig. 1e is a schematic flow diagram of determining a target node in an embodiment of the present application
  • FIG. 2 is a schematic diagram of the composition and structure of a virtual machine speed limiting device according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion, so that a method or device comprising a series of elements not only includes the explicitly stated elements, but also include other elements not explicitly listed, or also include elements inherent in implementing the method or apparatus.
  • an element defined by the phrase “comprising a " does not exclude the presence of additional related elements (such as steps in the method or A unit in an apparatus, for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
  • the method for limiting the speed of a virtual machine provided in the embodiment of the present application includes a series of steps, but the method for limiting the speed of a virtual machine provided in the embodiment of the present application is not limited to the steps described.
  • the virtual machine provided in the embodiment of the present application The speed limiting device includes a series of modules, but the virtual machine speed limiting device provided by the embodiment of the present application is not limited to including the modules explicitly recorded, and may also include the required settings for obtaining relevant task data or processing based on task data module.
  • the embodiments of the present application can be applied to a computer system composed of servers, and can operate together with many other general-purpose or special-purpose computing system environments or configurations.
  • the server may be a distributed cloud computing technology environment including a small computer system, a large computer system, and so on.
  • program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computing system storage media including storage devices.
  • the host machine represents one of the physical machines under the Openstack cluster.
  • the method for limiting the speed of a virtual machine can be implemented by using a processor in a device for limiting the speed of a virtual machine, and the above-mentioned processor can be an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor ( Digital Signal Processor, DSP), Digital Signal Processing Device (Digital Signal Processing Device, DSPD), Programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Logic Gate Array (Field Programmable Gate Array, FPGA), CPU At least one of (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • PLD Programmable Logic Device
  • FPGA Field Programmable Logic Gate Array
  • CPU At least one of (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • Fig. 1a is a schematic flow chart of a virtual machine speed limiting method in an embodiment of the present application, the method is applied to a virtual machine in an Openstack cluster, as shown in Fig. 1a, the method includes the following steps:
  • Step 100 Obtain various configuration items that limit the speed of the target object; the target object includes at least one of the system disk, data disk and network of the virtual machine.
  • the target object represents the target object of any virtual machine in the same Openstack cluster; the target object can include at least one of the system disk, data disk and network of the virtual machine; wherein, the system disk represents the storage operation
  • the disk of the system is similar to the C disk of the Linux system or Windows system; the data disk refers to the disk used to store data in addition to the operating system, usually referring to the D disk, E disk, and F disk.
  • the data disk can be partitioned according to the user disk It depends on the name; generally, documents, videos, music, applications, etc. are stored; here, the disk of the virtual machine can include the system disk and data disk of the virtual machine.
  • the network of the virtual machine can be divided into three modes, namely bridged (Bridged), network address translation (Network Address TranslatIOn, NAT), and host-only (Host-only).
  • a complete Openstack cluster usually consists of multiple computing nodes, network nodes, control nodes, and storage nodes, wherein the control node is responsible for controlling the remaining nodes, including virtual machine establishment, migration, network allocation, and storage allocation etc.; the computing node is responsible for running the virtual machine; the network node is responsible for the communication between the external network and the internal network; the storage node is responsible for the additional storage management of the virtual machine, etc.
  • each configuration item when it is determined that the target object includes the system disk of the virtual machine, each configuration item includes system disk read bandwidth value, system disk read IO value, system disk write bandwidth value, system disk write IO value , the total bandwidth value of the system disk and the total IO value of the system disk, it also includes other configuration items that can limit the speed of the system disk of the virtual machine.
  • each configuration item when it is determined that the target object includes the data disk of the virtual machine, each configuration item includes not only the total bandwidth value of the data disk and the total IO value of the data disk, but also other configuration items that can limit the speed of the data disk of the virtual machine.
  • each configuration item When it is determined that the target object includes the network of the virtual machine, each configuration item includes not only the average value of incoming network traffic and the average value of outgoing network traffic, but also other configuration items that can limit the speed of the network of the virtual machine.
  • bandwidth refers to the amount of data that can be successfully transmitted per unit of time
  • IO refers to Input Output Per Second (IOPS)
  • IOPS refers to the number of IO requests that the system can process per unit of time, generally processed per second
  • the number of IO requests is in units; the bandwidth unit is bytes/s, and the IO unit is times/s.
  • the Openstack cluster creates a cloud host
  • corresponding configuration items can be created for the target object of the specified virtual machine in the Openstack cluster, and then the configuration items that limit the speed of the target object can be obtained.
  • Step 101 Add each configuration item to the parameters of the target object, and limit the speed of the target object according to the parameters of the target object.
  • each configuration item may be added to the parameters of the target object.
  • adding each configuration item to the parameters of the target object may include: when it is determined that the target object includes a system disk, obtaining a type template flavor corresponding to the system disk through the nova component; using each configuration item as The parameters of the flavor corresponding to the system disk; the parameters of the target object include the parameters of the flavor corresponding to the system disk.
  • the nova component is the core component of the Openstack cluster, which is responsible for maintaining and managing the computing resources of the cloud environment.
  • the OpenStack cluster is a cloud operating system for Infrastructure as a Service (IaaS). Management is also implemented through Nova components.
  • the type template flavor is also called a virtual machine hardware template, and the type template flavor includes random access memory (Random Access Memory, RAM), disk size, and number of CPU cores.
  • the process of limiting the speed of the system disk may include: first, the bottom layer of the nova component creates or searches for a flavor and obtains the flavor_id; for example, the code for creating a new flavor is as follows:
  • the parameters of the system disk include parameters of the above-mentioned flavor corresponding to the system disk.
  • adding each configuration item to the parameter of the target object may include: when it is determined that the target object includes a data disk, bind each configuration item to the storage type of the data disk through the cinder component to obtain Binding result; add the binding result to the parameters of the data disk.
  • the core function of the cinder component is volume management, which allows volumes, volume types, volume snapshots, and volume backups to be processed; it can avoid single-node failures and provide block storage services for virtual machines.
  • each configuration item may include the total bandwidth value of the data disk and the total IO value of the data disk; wherein, the total bandwidth value total_bytes_sec of the data disk may be determined by formula (1):
  • bytes_min_value indicates the minimum value of the bandwidth setting
  • bytes_add_multiple indicates the step size of the bandwidth setting
  • size_gb indicates the size of the data disk.
  • KVM Kernel-based Virtual Machine
  • the process of limiting the speed of a data disk may include: first, setting the coefficient of the data disk, the type of the data disk, the minimum and maximum values of bandwidth and IOPS; Type, bandwidth, and the minimum and maximum values of IOPS calculate the total bandwidth value of the data disk and the total IO value of the data disk, and set these two configuration items of the data disk through the cinder component.
  • the corresponding code is as follows:
  • the data disk created at this time has the function of limiting the speed of the data disk.
  • adding each configuration item to the parameters of the target object may include: when it is determined that the target object includes a network, obtaining the flavor corresponding to the network through the nova component; using each configuration item as a flavor corresponding to the network The parameters of the flavor; the parameters of the target object include the parameters of the flavor corresponding to the network.
  • each configuration item may include an average value of incoming network traffic and an average value of outgoing network traffic
  • the process of limiting the speed of the network may include: first, the bottom layer of the nova component creates or searches for a flavor and obtains the flavor_id; for example, the code for creating a new flavor is as follows:
  • the parameters of the network include parameters of the above-mentioned flavor corresponding to the network.
  • At least one of IO and bandwidth of the target object can be limited according to the parameter of the target object.
  • the embodiment of the present application uses the nova component to implement the speed limit on the system disk and network of the virtual machine, and uses the cinder component to realize the speed limit on the data disk of the virtual machine;
  • speed limit it is not conducive to troubleshooting the cause of the fault and the problem that the speed limit effect is affected by the problem of the port.
  • the embodiment of the present application directly limits the speed of the system disk, data disk and network of the virtual machine through the acquired configuration items, so that When users choose to create a virtual machine, they are more intuitive and flexible to select the speed limit standard, which is convenient for users to directly query the size of the QoS speed limit to ensure the effect of QoS speed limit; solve the sudden increase in network traffic and network read and write load caused by the increase in business volume In the case of a large or large amount of bandwidth, the network congestion and delay caused by the problem provide a more guaranteed service capability for the specified network communication.
  • users can flexibly configure the speed limit size of the virtual machine's system disk, data disk, and network QoS when creating a cloud host according to the disk size, so that the speed limit is more in line with the standard.
  • the embodiment of the present application proposes a virtual machine speed limit method, device, electronic device, computer storage medium and computer program product, the method is applied to the virtual machine in the Openstack cluster, and the method includes: obtaining the speed limit for the target object Each configuration item; the target object includes at least one of the system disk, data disk and network of the virtual machine; each configuration item is added to the parameters of the target object, and the speed limit of the target object is performed according to the parameters of the target object.
  • the above method may further include the following steps:
  • Step A1 Obtain the resources required to create a virtual machine and the remaining resources of each computing node in the Openstack cluster.
  • Step A2 Filter each computing node according to the required resources and remaining resources, and obtain at least one computing node that satisfies the virtual machine creation condition.
  • Step A3 Determine a weight value of each computing node in the at least one computing node; and determine a target node for creating a virtual machine based on the weight value.
  • the required resources may include CPU resources, memory resources, and other resources required to create a virtual machine; computing nodes may provide resources for deploying virtual machines; wherein, each computing node may deploy one or more virtual machines; Each computing node corresponds to a physical machine.
  • the OpenStack cluster when creating a virtual machine, will define the resources required to create the virtual machine in the flavor, so that by specifying the flavor selected when creating the virtual machine, the resources required to create the virtual machine can be obtained;
  • CPU resources and memory resources are taken as examples for description.
  • the remaining resources of each computing node in the Openstack cluster can be obtained by invoking an agent node of the monitoring system.
  • the scheduling of the virtual machine is realized.
  • the scheduling process It can be divided into two steps: filter each computing node through a filter to obtain at least one computing node that satisfies the virtual machine creation condition; and then choose to create a virtual machine on the optimal (largest weight) computing node through weight calculation.
  • the filtering requirements are as follows:
  • actual_free_memory_mb indicates the actual remaining memory size of the computing node
  • total_memory_mb indicates the total memory size of the computing node
  • PROTECT_MEMORY_RATIO indicates the remaining protected memory ratio of the physical machine.
  • memory_mb indicates the size of the memory required to create the virtual machine
  • ram_allocation_ratio indicates the over-allocation ratio of the virtual machine memory, for example, the value can be 1.2, 1.5, etc.
  • memory_mb_used indicates the allocated memory size of the computing node.
  • vcpu indicates the CPU size required to create the virtual machine
  • cpu_allocation_ratio indicates the CPU over-allocation ratio of the virtual machine, for example, the value can be 1.2, 1.5, etc.
  • vcpus_used indicates the allocated CPU size of the computing node.
  • determining the weight value of each computing node in the at least one computing node may include: based on the remaining resource size and the number of runnable virtual machines when each computing node in the at least one computing node executes each project , to determine the weight value of each computing node in the at least one computing node.
  • the virtual machine is selected to be created on the optimal (largest weight value) computing node through weight calculation, and the selection requirements are as follows:
  • i ranges from 1 to n, and n represents a preset integer greater than 1; w1...wn represents different projects; wi_multiplie represents the remaining resource size of the computing node when executing the i-th project, which can be understood as a weighted index; norm(wi) calculates the number of virtual machines that can run when the node executes the i-th project; among them, the more the number of virtual machines that can run, the better the mutual exclusion and the greater the weight value.
  • the weight value of each computing node is obtained and sorted. The larger the weight value, the more remaining resources. For example, the computing node with the largest weight value can be selected as the best virtual machine creation node.
  • a target weight value greater than a set threshold may also be determined based on the weight value of each of the at least one computing node; and the computing node corresponding to the target weight value is determined as a target node for creating a virtual machine.
  • the value of the set threshold may be set according to actual conditions, for example, the value of the set threshold may be 0.8, 0.9, etc.; this is not limited in this embodiment of the present application.
  • the computing node with the most remaining resources is used as the optimal target node to create a virtual machine, which can maximize the resource utilization of the physical machine, avoid resource waste, and also improve the disk capacity of the virtual machine. High availability and low-level disaster recovery capabilities of network QoS speed limit.
  • the above method may further include: obtaining the target data volume of the target object through the proxy node; the proxy node is pre-installed on the virtual machine; the target data volume includes IO and/or bandwidth; when determining the target data volume of the target object When the set limit is exceeded, an alarm notification is triggered.
  • an agent node can be pre-installed on the virtual machine after setting the speed limit; by calling the agent node of the monitoring system to obtain the IO and bandwidth of the virtual machine's system disk, data disk, and network, the IO used by the virtual machine Compared with the bandwidth and the set limit, when the IO and bandwidth used by the virtual machine are greater than the set limit, the proxy node will trigger an alarm notification, so that the operation and maintenance personnel can quickly locate the area with abnormal QoS traffic and adjust the QoS rate limit.
  • the notification method of the alarm notification is not limited, for example, the operation and maintenance personnel may be notified by voice, text and other methods.
  • the embodiment of the present application monitors the QoS speed limit function of the system disk, data disk and network of the virtual machine to grasp the QoS service situation, so as to help network operation and maintenance personnel quickly find areas where QoS traffic exceptions may occur, and improve the fault rate. processing power.
  • the problem of network delay and congestion is solved in a certain sense.
  • the user can limit the speed of the system disk, data disk and network at the same time according to the performance requirements of the actual business on the virtual machine, or set at least one of the above three speed limit functions in a more flexible manner.
  • it also comprehensively considers the CPU, memory and other resources of the virtual host selected to create, and selects the best physical host to deploy the virtual host, thereby achieving the purpose of saving energy and improving resource utilization.
  • FIG. 2 is a schematic diagram of the composition and structure of a virtual machine speed limiting device according to an embodiment of the present application. As shown in FIG. 2 , the device includes an acquisition module 200 and a speed limiting module 201, wherein,
  • the obtaining module 200 is configured to obtain various configuration items for limiting the speed of the target object;
  • the target object includes at least one of the system disk, data disk and network of the virtual machine;
  • the speed limiting module 201 is configured to add various configuration items to the parameters of the target object, and limit the speed of the target object according to the parameters of the target object.
  • the speed limit module 201 is configured to add various configuration items to the parameters of the target object, including:
  • Each configuration item is used as the parameter of the flavor corresponding to the system disk; the parameters of the target object include the parameters of the flavor corresponding to the system disk.
  • the speed limit module 201 is configured to add various configuration items to the parameters of the target object, including:
  • the speed limit module 201 is configured to add various configuration items to the parameters of the target object, including:
  • the parameters of the target object include the parameters of the flavor corresponding to the network.
  • the above-mentioned apparatus further includes a determination module, the determination module is configured to:
  • the determining module configured to determine the weight value of each computing node in the at least one computing node includes:
  • the determination module configured to determine the target node for creating the virtual machine based on the weight value, includes:
  • the computing node corresponding to the target weight value or the computing node corresponding to the maximum weight value among the target weight values is determined as the target node for creating the virtual machine.
  • the above-mentioned device also includes a trigger module, and the trigger module is configured to:
  • the proxy node is pre-installed on the virtual machine; the target data volume includes IO and/or bandwidth;
  • an alarm notification is triggered.
  • the above-mentioned acquisition module 200, speed limit 201 module, determination module and trigger module can all be realized by a processor located in the electronic device, and the processor can be ASIC, DSP, DSPD, PLD, FPGA, CPU, control At least one of controllers, microcontrollers, and microprocessors.
  • each functional module in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or The contribution made by related technologies or all or part of the technical solution can be embodied in the form of software products, the computer software products are stored in a storage medium, and include several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read-only memory (Read Only Memory, ROM), RAM, magnetic disk or optical disk.
  • the computer program instructions corresponding to a method for limiting the speed of a virtual machine in this embodiment may be stored on a storage medium such as an optical disc, a hard disk, or a USB flash drive.
  • a storage medium such as an optical disc, a hard disk, or a USB flash drive.
  • FIG. 3 shows an electronic device 300 provided by an embodiment of the present application, which may include: a memory 301 and a processor 302; wherein,
  • memory 301 configured to store computer programs and data
  • the processor 302 is configured to execute the computer program stored in the memory, so as to implement any method for limiting the speed of a virtual machine in the foregoing embodiments.
  • the above-mentioned memory 301 can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 302.
  • volatile memory such as RAM
  • non-volatile memory such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 302.
  • the aforementioned processor 302 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different virtual machine speed limiting devices, other electronic devices for realizing the above processor functions may also be other, which are not specifically limited in this embodiment of the present application.
  • the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.
  • a computer-usable storage media including but not limited to disk storage and optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提出了一种虚拟机限速方法、装置、电子设备、计算机存储介质和计算机程序产品,该方法应用于Openstack集群中的虚拟机,该方法包括:获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。

Description

一种虚拟机限速方法、装置、设备、存储介质和程序
相关申请的交叉引用
本申请基于申请号为202110638646.2、申请日为2021年06月08日的中国专利申请提出,申请人为深圳前海微众银行股份有限公司,申请名称为“一种虚拟机限速方法、装置、设备和计算机存储介质”的技术方案,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及金融科技(Fintech)的云计算技术领域,涉及但不限于一种虚拟机限速方法、装置、电子设备、计算机存储介质和计算机程序产品。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性要求,也对技术提出了更高的要求。
在Openstack Neutron组件现有的功能中,并不能对虚拟网络进行服务质量(Quality of Service,QoS)控制;随着同一Openstack集群下虚拟机的数量不断增加,当其中某几台虚拟机磁盘或网络读写负荷较大或占用大量带宽时,由于该集群下物理机总的带宽和总的输入输出(InputOutput,IO)是固定的,从而会降低该集群下其它虚拟机使用的带宽和IO,造成虚拟机的网络或磁盘操作卡顿,严重影响虚拟机上的业务需求。
相关技术中,针对这种现状,某些云计算厂商会采取特定的措施,对Openstack集群中虚拟机的网络带宽和IO进行限速,比如:在集成网桥(br-int)上对特定虚拟机的端口(port)设置相应的QoS队列和规则,实现对虚拟二层端口流量进行控制;然而,这种限速设置的方式不够清晰、直观,不利 于用户直接查询QoS限速大小,影响QoS限速的效果。
发明内容
本申请提供一种虚拟机限速方法、装置、电子设备、计算机存储介质和计算机程序产品,可以解决相关技术中在对虚拟机的磁盘或网络进行限速时,限速方式不够清晰、直观,不利于用户直接查询QoS限速的问题。
本申请的技术方案是这样实现的:
本申请实施例提供了一种虚拟机限速方法,应用于Openstack集群中的虚拟机,所述方法包括:
获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;
将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。
在一些实施例中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
在确定所述目标对象包括系统盘的情况下,通过nova组件获取与所述系统盘对应的类型模板flavor;
将所述各个配置项作为与所述系统盘对应的flavor的参数;所述目标对象的参数包括所述与所述系统盘对应的flavor的参数。
在一些实施例中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
在确定所述目标对象包括数据盘的情况下,通过cinder组件将所述各个配置项与所述数据盘的存储类型进行绑定,得到绑定结果;
将所述绑定结果添加到所述数据盘的参数中。
在一些实施例中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
在确定所述目标对象包括网络的情况下,通过nova组件获取与所述网络对应的flavor;
将所述各个配置项作为与所述网络对应的flavor的参数;所述目标对象的参数包括与所述网络对应的flavor的参数。
在一些实施例中,所述方法还包括:
获取创建虚拟机所需的资源以及所述Openstack集群中各个计算节点的剩余资源;
根据所述所需的资源和所述剩余资源,对所述各个计算节点进行过滤,得到满足虚拟机创建条件的至少一个计算节点;
确定所述至少一个计算节点中每个计算节点的权重值;基于所述权重值,确定创建所述虚拟机的目标节点。
在一些实施例中,所述确定所述至少一个计算节点中每个计算节点的权重值,包括:
基于所述至少一个计算节点中每个计算节点执行每个项目时的剩余资源大小和可运行虚拟机的个数,确定所述至少一个计算节点中每个计算节点的权重值。
在一些实施例中,所述基于所述权重值,确定创建所述虚拟机的目标节点,包括:
基于所述至少一个计算节点中每个计算节点的权重值,确定大于设定阈值的目标权重值;将所述目标权重值对应的计算节点确定为创建所述虚拟机的目标节点;
或者,将所述至少一个计算节点中最大权重值对应的计算节点确定为创建所述虚拟机的目标节点。
在一些实施例中,所述方法还包括:
通过代理节点获取所述目标对象的目标数据量;所述代理节点预先安装在所述虚拟机上;所述目标数据量包括IO和/或带宽;
在确定所述目标对象的目标数据量大于设定限额时,触发报警通知。
本申请实施例还提出了一种虚拟机限速装置,应用于Openstack集群中的虚拟机,所述装置包括获取模块和限速模块,其中,
获取模块,配置为获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;
限速模块,配置为将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。
本申请实施例提供一种电子设备,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前述一个或多个技术方案提供的虚拟机限速方法。
本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有计算机程序;所述计算机程序被执行后能够实现前述一个或多个技术方案提供的虚拟机限速方法。
本申请实施例还提供了一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现前述一个或多个技术方案提供的虚拟机限速方法。
本申请实施例提出了一种虚拟机限速方法、装置、电子设备、计算机存储介质和计算机程序产品,所述方法应用于Openstack集群中的虚拟机,所述方法包括:获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。可以看出,本申请实施例中,在获取到Openstack集群中任意一个虚拟机的系统盘、数据盘和网络对应的各个配置项时,通过各个配置项对该虚拟机的系统盘、数据盘和网络中的至少一项进行限速,使得虚拟机使用的带宽和读写IO不会超额,从而保障了Openstack集群中各个虚拟机的业务需求;同时,因为是直接对虚拟机的系统盘、数据盘和网络进行限 速,使用户在选择创建虚拟机时对选择限速的标准更直观、灵活,便于用户直接查询QoS限速大小,确保QoS限速的效果。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本申请的实施例,并与说明书一起用于说明本申请的技术方案。
图1a是本申请实施例中的一种虚拟机限速方法的流程示意图;
图1b是本申请实施例中的对系统盘进行限速的流程示意图;
图1c是本申请实施例中的对数据盘进行限速的流程示意图;
图1d是本申请实施例中的对网络进行限速的流程示意图;
图1e是本申请实施例中的确定目标节点的流程示意图;
图2是本申请实施例的虚拟机限速装置的组成结构示意图;
图3是本申请实施例提供的电子设备的结构示意图。
具体实施方式
以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所提供的实施例仅仅用以解释本申请,并不用于限定本申请。另外,以下所提供的实施例是用于实施本申请的部分实施例,而非提供实施本申请的全部实施例,在不冲突的情况下,本申请实施例记载的技术方案可以任意组合的方式实施。
需要说明的是,在本申请实施例中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的方法或者装置不仅包括所明确记载的要素,而且还包括没有明确列出的其它要素,或者是还包括为实施方法或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的方法或者装置中还存在另外的相关要素(例如方法中的步骤或者装置中的单元,例如的单元可以是部分电路、部分处理器、部分程序或软件等等)。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,I和/或J,可以表示:单独存在I,同时存在I和J,单独存在J这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括I、J、R中的至少一种,可以表示包括从I、J和R构成的集合中选择的任意一个或多个元素。
例如,本申请实施例提供的虚拟机限速方法包含了一系列的步骤,但是本申请实施例提供的虚拟机限速方法不限于所记载的步骤,同样地,本申请实施例提供的虚拟机限速装置包括了一系列模块,但是本申请实施例提供的虚拟机限速装置不限于包括所明确记载的模块,还可以包括为获取相关任务数据、或基于任务数据进行处理时所需要设置的模块。
本申请实施例可以应用于服务端组成的计算机系统中,并可以与众多其它通用或专用计算系统环境或配置一起操作。这里,服务端可以是包括小型计算机系统﹑大型计算机系统的分布式云计算技术环境,等等。
服务端等电子设备可以通过程序模块的执行实现相应的功能。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务端可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。
对于Openstack集群下的虚拟机,在业务量增加导致的网络流量突增、网络读写负荷较大或占用大量带宽等情况下,会导致虚拟机出现网络阻塞和延迟等问题;相关技术中,为解决上述问题,通常对虚拟机的端口设置相应的QoS队列和规则,再基于QoS队列和规则进行流量控制,达到限速目的。然而,这种限速方式存在以下缺点:
1)限速设置的方式不够清晰,直观,不利于用户直接查询QoS限速大小。
2)在对虚拟机网络的端口流量进行限制时,若限制大小和预期不符,则不利于排查原因。
3)当虚拟机的端口出现问题时,会直接影响限速的预期效果。
4)若虚拟机所在的宿主机的资源不充足时,将会直接影响QoS限速的效果;这里,宿主机表示Openstack集群下的其中一个物理机。
针对上述技术问题,提出以下各实施例。
在本申请的一些实施例中,虚拟机限速方法可以利用虚拟机限速装置中的处理器实现,上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。
图1a是本申请实施例中的一种虚拟机限速方法的流程示意图,该方法应用于Openstack集群中的虚拟机,如图1a所示,该方法包括如下步骤:
步骤100:获取对目标对象进行限速的各个配置项;目标对象包括虚拟机的系统盘、数据盘和网络中的至少一项。
本申请实施例中,目标对象表示同一Openstack集群中任意一个虚拟机的目标对象;目标对象可以包括虚拟机的系统盘、数据盘和网络中的至少一项;其中,系统盘表示用于存储操作系统的磁盘,类似于Linux系统或Windows系统的C盘;数据盘表示除了操作系统以外,用来存储数据的磁盘,通常指的是D盘、E盘、F盘,数据盘可以按照用户磁盘分区名字而定;一般存储的是文档、视频、音乐、应用程序等等;这里,虚拟机的磁盘可以包括虚拟机的系统盘和数据盘。虚拟机的网络可以分为三种模式,分别是桥接(Bridged)、网络地址转换(Network Address TranslatIOn,NAT)、仅主机(Host-only)。
示例性地,一个完整的Openstack集群,通常由多个计算节点、网络节点、控制节点和存储节点组成,其中,控制节点负责对其余节点的控制,包含虚拟机建立、迁移、网络分配以及存储分配等;计算节点负责虚拟机运行;网络节点负责外网络与内网络之间的通信;存储节点负责虚拟机的额外存储管理等。
示例性地,在确定目标对象包括虚拟机的系统盘的情况下,各个配置项除了包括系统盘读取带宽值、系统盘读取IO值、系统盘写入带宽值、系统盘写入IO值、系统盘总带宽值和系统盘总IO值外,还包括其它可以对虚拟机的系统盘进行限速的配置项。在确定目标对象包括虚拟机的数据盘的情况下,各个配置项除了包括数据盘总带宽值和数据盘总IO值外,还包括其它可以对虚拟机的数据盘进行限速的配置项。在确定目标对象包括虚拟机的网络的情况下,各个配置项除了包括传入网络流量平均值和传出网络流量平均值外,还包括其它可以对虚拟机的网络进行限速的配置项。
这里,带宽指单位时间内可以成功传输的数据数量;IO表示每秒输入输出量(Input Output Per Second,IOPS),IOPS是指单位时间内系统能处理的IO请求数量,一般以每秒处理的IO请求数量为单位;其中,带宽单位为bytes/s,IO单位为次/s。
示例性地,可以在Openstack集群创建云主机时,对该Openstack集群中指定虚拟机的目标对象创建对应的各个配置项,进而,获取对目标对象进行限速的各个配置项。
步骤101:将各个配置项添加到目标对象的参数中,根据目标对象的参数对目标对象进行限速。
本申请实施例中,在根据上述步骤获取到对目标对象进行限速的各个配置项后,可以将各个配置项添加到目标对象的参数中。
在一些实施例中,将各个配置项添加到目标对象的参数中,可以包括:在确定目标对象包括系统盘的情况下,通过nova组件获取与系统盘对应的 类型模板flavor;将各个配置项作为与系统盘对应的flavor的参数;目标对象的参数包括与系统盘对应的flavor的参数。
这里,nova组件是Openstack集群自带的核心组件,负责维护和管理云环境的计算资源,OpenStack集群作为基础设施即服务(Infrastructure as a Service,IaaS)的云操作系统,OpenStack集群中虚拟机生命周期管理也是通过Nova组件来实现的。在Openstack集群中,类型模板flavor也称为虚机硬件模板,类型模板flavor包括随机存取存储器(Random Access Memory,RAM)、磁盘大小和CPU核数等。
示例性地,在获取到对系统盘进行限速的各个配置项后,在创建与该系统盘对应的flavor时,使用nova组件设置系统盘的各个配置项。参见图1b,对系统盘进行限速的流程可以包括:首先,nova组件底层新建或查找flavor并获取flavor_id;示例性地,新建flavor的代码如下所示:
$openstack flavor create--private p1.medium--id auto--ram 512--disk 40–vcpus4
然后,将对系统盘进行限速的各个配置项作为flavor的参数(即额外属性),设置到nova组件底层;示例性地,将系统盘写入带宽值disk_write_bytes_sec这个配置项作为flavor的参数的代码如下所示:
Figure PCTCN2021135932-appb-000001
这里,系统盘的参数包括与系统盘对应的上述flavor的参数。经过上述操作后,如果创建flavor,便可以通过nova组件底层选择带有系统盘限速的配置项。
在一些实施例中,将各个配置项添加到目标对象的参数中,可以包括:在确定目标对象包括数据盘的情况下,通过cinder组件将各个配置项与数据盘的存储类型进行绑定,得到绑定结果;将绑定结果添加到数据盘的参数中。
这里,cinder组件的核心功能是对卷的管理,允许对卷、卷的类型、卷的快照、卷备份进行处理;可以避免单节点故障,为虚拟机提供块存储服务。
示例性地,在确定目标对象包括数据盘的情况下,各个配置项可以包括数据盘总带宽值和数据盘总IO值;其中,数据盘总带宽值total_bytes_sec可以通过公式(1)进行确定:
total_bytes_sec=bytes_min_value+bytes_add_multiple*size_gb(1)
这里,bytes_min_value表示带宽设置的最小值,bytes_add_multiple表示带宽设置的步长,size_gb表示数据盘的大小。
示例性地,在获取到数据盘总带宽值和数据盘总IO值后,将这两个配置项设置在Openstack cinder的front-end端,即hypervisor端,再通过物理机的基于内核的虚拟机(Kernel-based Virtual Machine,KVM)层对数据盘进行限速。
示例性地,参见图1c,对数据盘进行限速的流程可以包括:首先,设定数据盘的系数、数据盘类型、带宽和IOPS的最小值、最大值;根据数据盘的系数、数据盘类型、带宽和IOPS的最小值、最大值计算出数据盘总带宽值和数据盘总IO值,通过cinder组件设置数据盘的这两个配置项,对应代码如下所示:
Figure PCTCN2021135932-appb-000002
然后,在cinder组件创建存储类型,并将这两个配置项与数据盘的存储类型进行绑定,得到绑定结果,对应代码如下所示:
$cinder qos-associate QOs ID VOLUME TYPE ID
最后,将该绑定结果作为一个属性添加到创建数据盘的参数中;此时创建的数据盘便带有对数据盘进行限速的功能。
在一些实施例中,将各个配置项添加到目标对象的参数中,可以包括:在确定目标对象包括网络的情况下,通过nova组件获取与网络对应的flavor;将各个配置项作为与网络对应的flavor的参数;目标对象的参数包括与网络对应的flavor的参数。
示例性地,在确定目标对象包括网络的情况下,各个配置项可以包括传入网络流量平均值和传出网络流量平均值;
示例性地,在创建与上述网络对应的flavor时,使用nova组件设置网络的各个配置项。参见图1d,对网络进行限速的流程可以包括:首先,nova组件底层新建或查找flavor并获取flavor_id;示例性地,新建flavor的代码如下所示:
$openstack flavor create--private pl.medium--id auto--ram 512--disk 40--vcpus 4
然后,将对网络进行限速的各个配置项作为flavor的参数(即额外属性),设置到nova组件底层中;对应代码如下所示:
Figure PCTCN2021135932-appb-000003
这里,网络的参数包括与网络对应的上述flavor的参数。经过上述操作后,如果创建flavor,便可以通过nova组件底层选择带有网络限速的配置项。
示例性地,在利用nova组和cinder组件将上述目标对象的各个配置项添加到目标对象的参数后,可以根据目标对象的参数对目标对象的IO和带宽中的至少一项进行限速。
可以看出,本申请实施例利用nova组件实现对虚拟机的系统盘和网络的限速,利用cinder组件实现对虚拟机的数据盘的限速;相比于相关技术中在通过虚拟机的端口进行限速时,不利于排查故障原因以及因为端口出现问题影响限速效果的问题,本申请实施例通过获取到的各个配置项直接对虚拟机的系统盘、数据盘和网络进行限速,使用户在选择创建虚拟机时对选择限速的标准更直观、灵活,便于用户直接查询QoS限速大小,确保QoS限速的效果;解决在业务量增加导致的网络流量突增、网络读写负荷较大或占用大量带宽等情况下,导致的网络阻塞和延迟等问题,为指定的网络通信提供了更有保障的服务能力。另外,用户可以根据磁盘大小,在创建云主机时灵活配置虚拟机的系统盘、数据盘和网络QoS的限速大小,使限速更符合标准。
本申请实施例提出了一种虚拟机限速方法、装置、电子设备、计算机存储介质和计算机程序产品,该方法应用于Openstack集群中的虚拟机,该方法包括:获取对目标对象进行限速的各个配置项;目标对象包括虚拟机的系统盘、数据盘和网络中的至少一项;将各个配置项添加到目标对象的参数中,根据目标对象的参数对目标对象进行限速。可以看出,本申请实施例中,在获取到Openstack集群中任意一个虚拟机的系统盘、数据盘和网络对应的各个配置项时,通过各个配置项对该虚拟机的系统盘、数据盘和网络中的至少一项进行限速,使得虚拟机使用的带宽和读写IO不会超额,从而保障了Openstack集群中各个虚拟机的业务需求;同时,因为是直接对虚拟机的系统盘、数据盘和网络进行限速,使用户在选择创建虚拟机时对选择限速的标准更直观、灵活,便于用户直接查询QoS限速大小,确保QoS限速的效果。
在一些实施例中,参照图1e,上述方法还可以包括以下步骤:
步骤A1:获取创建虚拟机所需的资源以及Openstack集群中各个计算节点的剩余资源。
步骤A2:根据所需的资源和剩余资源,对各个计算节点进行过滤,得到满足虚拟机创建条件的至少一个计算节点。
步骤A3:确定至少一个计算节点中每个计算节点的权重值;基于权重值,确定创建虚拟机的目标节点。
这里,所需的资源可以包括CPU资源、内存资源以及创建虚拟机所需的其它资源;计算节点可以提供用于部署虚拟机的资源;其中,每个计算节点可以部署一个或多个虚拟机;每个计算节点对应一个物理机。
示例性地,在创建虚拟机时,OpenStack集群会将创建该虚拟机所需的资源定义在flavor中,这样,通过指定创建虚拟机时选用的flavor,便可获取创建虚拟机所需的资源;下面,以CPU资源和内存资源为例进行说明。
示例性地,Openstack集群中各个计算节点的剩余资源可以通过调用监控系统的代理节点进行获取。
示例性地,在获取所需的资源和各个计算节点的剩余资源后,基于虚机调度服务nova-scheduler默认的调度器Filter Scheduler中的虚拟机调度策略,实现对虚拟机的调度,该调度过程可以分为两步:通过过滤器对各个计算节点进行过滤,得到满足虚拟机创建条件的至少一个计算节点;再通过权重计算选择在最优(权重值最大)的计算节点上创建虚拟机。
示例性地,在通过过滤器得到满足虚拟机创建条件的至少一个计算节点时,过滤要求如下:
a)当计算节点的真实剩余内存大于保护内存且可分配内存充足时,该计算节点的内存满足创建虚拟主机的要求,对应的表达式如公式(2)、公式(3)所示:
actual_free_memory_mb>total_memory_mb*PROTECT_MEMORY_RATIO(2)
这里,actual_free_memory_mb表示计算节点真实剩余内存大小;total_memory_mb表示计算节点总内存大小;PROTECT_MEMORY_RATIO表示物理机剩余保护内存比例。
memory_mb<total_memory_mb*ram_allocation_ratio-memory_mb_used(3)
这里,memory_mb表示创建虚拟机所需内存大小;ram_allocation_ratio表示虚拟机内存超额分配比,示例性地,取值可以为1.2、1.5等;memory_mb_used表示计算节点已分配内存大小。
b)当计算节点的可分配CPU充足时,该计算节点的CPU满足创建虚拟主机的要求,对应的表达式如公式(4)所示:
vcpu<total_vcpu*cpu_allocation_ratio-vcpus_used(4)
这里,vcpu表示创建虚拟机所需CPU大小;cpu_allocation_ratio表示虚拟机CPU超额分配比,示例性地,取值可以为1.2、1.5等;vcpus_used表示计算节点已分配CPU大小。
c)当上述虚拟机创建条件a)和b)均成立时,说明该计算节点的CPU、内存均满足创建虚拟主机的要求,即,可以得到满足虚拟机创建条件的至少一个计算节点。
在一些实施例中,确定至少一个计算节点中每个计算节点的权重值,可以包括:基于至少一个计算节点中每个计算节点执行每个项目时的剩余资源大小和可运行虚拟机的个数,确定至少一个计算节点中每个计算节点的权重值。
示例性地,在得到满足虚拟机创建条件的至少一个计算节点后,通过权重计算选择在最优(权重值最大)的计算节点上创建虚拟机,选择要求如下:
d)如果通过上述虚拟机创建条件a)和b)过滤后的计算节点只有一个,则将该计算节点确定为目标节点,即,该计算节点是能够创建虚拟机 的计算节点;如果有多个,则会对每个计算节点进行打分,得到每个计算节点的权重值weight,对应的表达式如公式(5)所示:
Figure PCTCN2021135932-appb-000004
这里,i取值1到n,n表示预设的大于1的整数;w1...wn表示不同的项目;wi_multiplie表示计算节点执行第i个项目时的剩余资源大小,可以理解为加权指标;norm(wi)计算节点执行第i个项目时可运行虚拟机的个数;其中,可运行虚拟机的数量越多,表示互斥性越好,权重值就越大。
e)通过d)计算后得出每个计算节点的权重值,对其进行排序,权重值越大说明剩余资源越多,示例性地,可以选择权重值最大的计算节点作为创建虚拟机最佳节点。还可以基于至少一个计算节点中每个计算节点的权重值,确定大于设定阈值的目标权重值;将目标权重值对应的计算节点确定为创建虚拟机的目标节点。
这里,设定阈值的取值可以根据实际情况进行设置,例如,设定阈值的取值可以为0.8、0.9等;本申请实施例对此不作限定。
可以看出,本申请实施例通过将剩余资源最多的计算节点作为最优的目标节点创建虚拟机,可以最大限度地提高物理机的资源利用率,避免资源的浪费,同时也提高了虚拟机磁盘和网络的QoS限速的高可用性和底层容灾能力。
在一些实施例中,上述方法还可以包括:通过代理节点获取目标对象的目标数据量;代理节点预先安装在虚拟机上;目标数据量包括IO和/或带宽;在确定目标对象的目标数据量大于设定限额时,触发报警通知。
示例性地,可以预先在设置限速后的虚拟机上安装代理节点;通过调用监控系统的代理节点来获取该虚拟机的系统盘、数据盘和网络的IO和带宽,将虚拟机使用的IO和带宽与设定限额进行比较,当虚拟机使用的IO和带宽大于设定限额时,代理节点会触发告警通知,以便运维人员快速定 位QoS流量异常的区域,调整QoS限速的额度。
这里,对于告警通知的通知方式不作限定,例如,可以通过语音、文本等方式通知运维人员。
可以看出,本申请实施例通过监控虚拟机的系统盘、数据盘和网络的QoS限速功能,掌握QoS业务情况,以帮助网络运维人员快速发现有可能出现QoS流量异常的区域,提高故障处理能力。
本申请实施例,通过在nova组件或cinder组件对系统盘、数据盘和网络进行限速,从某种意义上解决了网络延迟和阻塞的问题。示例性地,用户可以根据实际业务对虚拟机的性能要求,同时对系统盘、数据盘和网络进行限速,也可以针对上述三种的至少一种限速功能进行设置,以更灵活的方式满足业务需求;同时,也综合考虑所选择创建虚拟主机的CPU、内存等各个资源,选出最佳的物理主机进行部署虚拟主机,进而达到节省能耗、提高资源利用率的目的。
图2是本申请实施例的虚拟机限速装置的组成结构示意图,如图2所示,该装置包括获取模块200和限速模块201,其中,
获取模块200,配置为获取对目标对象进行限速的各个配置项;目标对象包括虚拟机的系统盘、数据盘和网络中的至少一项;
限速模块201,配置为将各个配置项添加到目标对象的参数中,根据目标对象的参数对目标对象进行限速。
在一些实施例中,限速模块201,配置为将各个配置项添加到目标对象的参数中,包括:
在确定目标对象包括系统盘的情况下,通过nova组件获取与系统盘对应的类型模板flavor;
将各个配置项作为与系统盘对应的flavor的参数;目标对象的参数包括与系统盘对应的flavor的参数。
在一些实施例中,限速模块201,配置为将各个配置项添加到目标对象 的参数中,包括:
在确定目标对象包括数据盘的情况下,通过cinder组件将各个配置项与数据盘的存储类型进行绑定,得到绑定结果;
将绑定结果添加到数据盘的参数中。
在一些实施例中,限速模块201,配置为将各个配置项添加到目标对象的参数中,包括:
在确定目标对象包括网络的情况下,通过nova组件获取与网络对应的flavor;
将各个配置项作为与网络对应的flavor的参数;目标对象的参数包括与网络对应的flavor的参数。
在一些实施例中,上述装置还包括确定模块,确定模块,配置为:
获取创建虚拟机所需的资源以及Openstack集群中各个计算节点的剩余资源;
根据所需的资源和剩余资源,对各个计算节点进行过滤,得到满足虚拟机创建条件的至少一个计算节点;
确定至少一个计算节点中每个计算节点的权重值;基于权重值,确定创建虚拟机的目标节点。
在一些实施例中,确定模块,配置为确定至少一个计算节点中每个计算节点的权重值,包括:
基于至少一个计算节点中每个计算节点执行每个项目时的剩余资源大小和可运行虚拟机的个数,确定至少一个计算节点中每个计算节点的权重值。
在一些实施例中,确定模块,配置为基于权重值,确定创建虚拟机的目标节点,包括:
基于至少一个计算节点中每个计算节点的权重值,确定大于设定阈值的目标权重值;
将目标权重值对应的计算节点或目标权重值中最大权重值对应的计算节点确定为创建虚拟机的目标节点。
在一些实施例中,上述装置还包括触发模块,触发模块,配置为:
通过代理节点获取目标对象的目标数据量;代理节点预先安装在虚拟机上;目标数据量包括IO和/或带宽;
在确定目标对象的目标数据量大于设定限额时,触发报警通知。
在实际应用中,上述获取模块200、限速201模块、确定模块和触发模块均可以由位于电子设备中的处理器实现,该处理器可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
具体来讲,本实施例中的一种虚拟机限速方法对应的计算机程序指令可以被存储在光盘、硬盘、U盘等存储介质上,当存储介质中的与一种虚拟机限速方法对应的计算机程序指令被一电子设备读取或被执行时,实现前述实施例的任意一种虚拟机限速方法。
基于前述实施例相同的技术构思,参见图3,其示出了本申请实施例提供的电子设备300,可以包括:存储器301和处理器302;其中,
存储器301,配置为存储计算机程序和数据;
处理器302,配置为执行存储器中存储的计算机程序,以实现前述实施例的任意一种虚拟机限速方法。
在实际应用中,上述存储器301可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM、快闪存储器(flash memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器302提供指令和数据。
上述处理器302可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的虚拟机限速设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。
在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。
本申请所提供的各方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的各产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的各方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、 或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。

Claims (12)

  1. 一种虚拟机限速方法,应用于Openstack集群中的虚拟机,所述方法包括:
    获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;
    将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。
  2. 根据权利要求1所述的方法,其中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
    在确定所述目标对象包括系统盘的情况下,通过nova组件获取与所述系统盘对应的类型模板flavor;
    将所述各个配置项作为与所述系统盘对应的flavor的参数;所述目标对象的参数包括所述与所述系统盘对应的flavor的参数。
  3. 根据权利要求1所述的方法,其中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
    在确定所述目标对象包括数据盘的情况下,通过cinder组件将所述各个配置项与所述数据盘的存储类型进行绑定,得到绑定结果;
    将所述绑定结果添加到所述数据盘的参数中。
  4. 根据权利要求1所述的方法,其中,所述将所述各个配置项添加到所述目标对象的参数中,包括:
    在确定所述目标对象包括网络的情况下,通过nova组件获取与所述网络对应的flavor;
    将所述各个配置项作为与所述网络对应的flavor的参数;所述目标对象的参数包括与所述网络对应的flavor的参数。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    获取创建虚拟机所需的资源以及所述Openstack集群中各个计算节点的剩余资源;
    根据所述所需的资源和所述剩余资源,对所述各个计算节点进行过滤,得到满足虚拟机创建条件的至少一个计算节点;
    确定所述至少一个计算节点中每个计算节点的权重值;基于所述权重值,确定创建所述虚拟机的目标节点。
  6. 根据权利要求5所述的方法,其中,所述确定所述至少一个计算节点中每个计算节点的权重值,包括:
    基于所述至少一个计算节点中每个计算节点执行每个项目时的剩余资源大小和可运行虚拟机的个数,确定所述至少一个计算节点中每个计算节点的权重值。
  7. 根据权利要求5或6所述的方法,其中,所述基于所述权重值,确 定创建所述虚拟机的目标节点,包括:
    基于所述至少一个计算节点中每个计算节点的权重值,确定大于设定阈值的目标权重值;将所述目标权重值对应的计算节点确定为创建所述虚拟机的目标节点;
    或者,将所述至少一个计算节点中最大权重值对应的计算节点确定为创建所述虚拟机的目标节点。
  8. 根据权利要求1至6任一项所述的方法,其中,所述方法还包括:
    通过代理节点获取所述目标对象的目标数据量;所述代理节点预先安装在所述虚拟机上;所述目标数据量包括IO和/或带宽;
    在确定所述目标对象的目标数据量大于设定限额时,触发报警通知。
  9. 一种虚拟机限速装置,应用于Openstack集群中的虚拟机,所述装置包括:
    获取模块,配置为获取对目标对象进行限速的各个配置项;所述目标对象包括所述虚拟机的系统盘、数据盘和网络中的至少一项;
    限速模块,配置为将所述各个配置项添加到所述目标对象的参数中,根据所述目标对象的参数对所述目标对象进行限速。
  10. 一种电子设备,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至8任一项所述的方法。
  11. 一种计算机存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现权利要求1至8任一项所述的方法。
  12. 一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行权利要求1至8任一项所述的方法。
PCT/CN2021/135932 2021-06-08 2021-12-07 一种虚拟机限速方法、装置、设备、存储介质和程序 WO2022257388A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110638646.2 2021-06-08
CN202110638646.2A CN113326097A (zh) 2021-06-08 2021-06-08 一种虚拟机限速方法、装置、设备和计算机存储介质

Publications (1)

Publication Number Publication Date
WO2022257388A1 true WO2022257388A1 (zh) 2022-12-15

Family

ID=77420249

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/135932 WO2022257388A1 (zh) 2021-06-08 2021-12-07 一种虚拟机限速方法、装置、设备、存储介质和程序

Country Status (2)

Country Link
CN (1) CN113326097A (zh)
WO (1) WO2022257388A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326097A (zh) * 2021-06-08 2021-08-31 深圳前海微众银行股份有限公司 一种虚拟机限速方法、装置、设备和计算机存储介质
CN114884816B (zh) * 2022-06-17 2024-02-13 中国联合网络通信集团有限公司 数据包限速规则处理方法、装置、设备、存储介质
CN116405391A (zh) * 2023-04-10 2023-07-07 长扬科技(北京)股份有限公司 基于OpenStack的虚拟机节点筛选方法、系统和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346264A (zh) * 2016-05-05 2017-11-14 北京金山云网络技术有限公司 一种虚拟机负载均衡调度的方法、装置和服务器设备
CN110046026A (zh) * 2019-04-22 2019-07-23 无锡华云数据技术服务有限公司 云主机指定虚拟磁盘限速方法、计算设备及云平台
CN110635999A (zh) * 2018-06-22 2019-12-31 复旦大学 一种基于路由器虚拟化技术的云计算平台网络控制方法
CN111901385A (zh) * 2020-06-30 2020-11-06 广东浪潮大数据研究有限公司 一种云硬盘限速方法、系统、装置及计算机可读存储介质
CN113326097A (zh) * 2021-06-08 2021-08-31 深圳前海微众银行股份有限公司 一种虚拟机限速方法、装置、设备和计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346264A (zh) * 2016-05-05 2017-11-14 北京金山云网络技术有限公司 一种虚拟机负载均衡调度的方法、装置和服务器设备
CN110635999A (zh) * 2018-06-22 2019-12-31 复旦大学 一种基于路由器虚拟化技术的云计算平台网络控制方法
CN110046026A (zh) * 2019-04-22 2019-07-23 无锡华云数据技术服务有限公司 云主机指定虚拟磁盘限速方法、计算设备及云平台
CN111901385A (zh) * 2020-06-30 2020-11-06 广东浪潮大数据研究有限公司 一种云硬盘限速方法、系统、装置及计算机可读存储介质
CN113326097A (zh) * 2021-06-08 2021-08-31 深圳前海微众银行股份有限公司 一种虚拟机限速方法、装置、设备和计算机存储介质

Also Published As

Publication number Publication date
CN113326097A (zh) 2021-08-31

Similar Documents

Publication Publication Date Title
WO2022257388A1 (zh) 一种虚拟机限速方法、装置、设备、存储介质和程序
US8856484B2 (en) Mass storage system and methods of controlling resources thereof
EP3507692B1 (en) Resource oversubscription based on utilization patterns in computing systems
US9635101B2 (en) Proposed storage system solution selection for service level objective management
US7587492B2 (en) Dynamic performance management for virtual servers
US20190163371A1 (en) Next generation storage controller in hybrid environments
JP5744707B2 (ja) メモリ使用量照会ガバナのためのコンピュータ実装方法、コンピュータ・プログラム、およびシステム(メモリ使用量照会ガバナ)
US10394606B2 (en) Dynamic weight accumulation for fair allocation of resources in a scheduler hierarchy
CN108023958B (zh) 一种基于云平台资源监视的资源调度系统
US8924658B1 (en) Dynamic storage management using virtual storage appliances
WO2019148841A1 (zh) 一种分布式存储系统、数据处理方法和存储节点
WO2020134364A1 (zh) 一种虚拟机迁移方法、云计算管理平台和存储介质
WO2014206266A1 (zh) 一种云计算环境下的自动伸缩方法和系统
US11204702B2 (en) Storage domain growth management
CN105404542A (zh) 云计算系统及在其上运行高性能计算的方法
JP6993495B2 (ja) クラウド・ネットワーキングにおけるスケーラブルな統計及び分析メカニズム
US20160364268A1 (en) Computer system, management computer, and management method
US10761726B2 (en) Resource fairness control in distributed storage systems using congestion data
US11297147B2 (en) Managed data export to a remote network from edge devices
CN107872480B (zh) 大数据集群数据平衡方法和装置
US10594620B1 (en) Bit vector analysis for resource placement in a distributed system
CN110908783A (zh) 一种云数据中心虚拟机的管控方法、系统及设备
US20220318070A1 (en) Scheduling workloads based on predicted magnitude of storage capacity savings achieved through deduplication
US10721181B1 (en) Network locality-based throttling for automated resource migration
TWI522829B (zh) 具有輕量級容器節點的儲存系統

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

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

Country of ref document: EP

Kind code of ref document: A1