CN112667364A - Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core - Google Patents

Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core Download PDF

Info

Publication number
CN112667364A
CN112667364A CN202110015450.8A CN202110015450A CN112667364A CN 112667364 A CN112667364 A CN 112667364A CN 202110015450 A CN202110015450 A CN 202110015450A CN 112667364 A CN112667364 A CN 112667364A
Authority
CN
China
Prior art keywords
bound
vcpu
virtual machine
core
binding
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202110015450.8A
Other languages
Chinese (zh)
Other versions
CN112667364B (en
Inventor
高泽旭
刘丽萍
黎星
赵涛
霍达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202110015450.8A priority Critical patent/CN112667364B/en
Publication of CN112667364A publication Critical patent/CN112667364A/en
Application granted granted Critical
Publication of CN112667364B publication Critical patent/CN112667364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a virtual mixed deployment method, a virtual mixed deployment device, virtual mixed deployment equipment and a virtual mixed deployment storage medium for bound cores and non-bound cores, wherein the virtual mixed deployment method comprises the steps of constructing a vCPU floating group set model and a vCPU statistical model; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the core-bound virtual machine or the non-core-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the core-bound virtual machine and the non-core-bound virtual machine can be supported, the utilization rate of pCPU of the host machine is improved, the material cost is saved, the computing performance of the virtual machine is improved, and the computing resource scheduling success rate is improved.

Description

Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core
Technical Field
The invention relates to the technical field of virtualization, in particular to a method, a device, equipment and a storage medium for virtual mixed deployment of bound cores and non-bound cores.
Background
By using a virtualization technology, multiple services are deployed on the same physical server and multiple virtual machines need to be deployed at the same time, because the services of each virtual machine are different, physical resources are occupied to different degrees, some services depend on the performance of a CPU (central processing unit) to complete real-time calculation, and some services depend on other capabilities such as storage or a network.
Generally, the support for the mixed deployment of the core-bound virtual machine and the non-core-bound virtual machine is limited, and there are the following implementation modes: one implementation is that a fixed bound core and non-bound core physical Central Processing Unit (pCPU) available interval needs to be set for a host, and the two cannot be used in a mixed manner, that is, a bound core virtual machine cannot be created in a pCPU interval of a non-bound core virtual machine, and a non-bound core virtual machine cannot be created in a pCPU interval of the bound core virtual machine, if a certain type of virtual machine in the environment reaches an upper limit of pCPU resource occupation, resources which have reached the upper limit type cannot be created, and the other type has surplus, so that the waste of computing resources is caused, the flexibility of the pCPU resource is greatly limited, and the utilization rate of physical resources is reduced; another implementation is to not set the pCPU available interval, but to use both the bound and non-bound core types in a mixture; in the scheme, the pCPU bound by the core-bound virtual machine cannot achieve the purpose of exclusive resource, and a virtual Central Processing Unit (vCPU) of a non-core-bound virtual machine can be dispatched to the pCPU bound by the core-bound virtual machine, so that the resource of the core-bound vCPU and the non-core-bound vCPU is preempted, and the computing performance of the virtual machine is greatly influenced; in the scenario of over-allocation of vCPU resources, the second scheme does not distinguish when the vCPU resource occupation of the bound virtual machine and the non-bound virtual machine is counted, and cannot accurately reflect the vCPU resource occupation quantity of the host machine in the mixed deployment scenario, so that the resource scheduling success rate during virtual machine creation is influenced.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for virtual mixed deployment of bound cores and non-bound cores, and aims to solve the technical problems that the pCPU resources in the prior art are low in flexibility and physical resource utilization rate, the computing performance of a virtual machine is influenced, and the success rate of resource scheduling is low when the virtual machine is created.
In a first aspect, the present invention provides a virtual mixed deployment method of bound cores and non-bound cores, which includes the following steps:
constructing a vCPU floating group set model and a vCPU statistical model;
when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host;
when the virtual machine is deleted, acquiring the resource occupation amount of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the resource occupation amount of the virtual machine.
Optionally, the constructing a vCPU floating group set model and a vCPU statistical model includes:
acquiring an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set;
and acquiring a vCPU over-rate ratio, and constructing a vCPU statistical model according to the vCPU over-rate ratio.
Optionally, the obtaining an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set includes:
acquiring an available pCPU set and a bound pCPU set;
calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine;
and constructing a vCPU floating group set model according to the scheduling range of the virtual machine.
Optionally, the obtaining a vCPU excess ratio and constructing a vCPU statistical model according to the vCPU excess ratio includes:
obtaining a vCPU over-rate ratio and obtaining an available pCPU set;
calculating the product of the number of the available pCPU and the excess ratio of the vCPU to obtain the vCPU available amount of the target host machine;
calculating the product of the number of the core binding virtual machines and the vCPU over-rate ratio to obtain a vCPU occupation value of the core binding virtual machines;
calculating the product of the number of the non-core-binding virtual machines and 1 to obtain the vCPU occupation value of the non-core-binding virtual machines;
and constructing a vCPU statistical model according to the vCPU occupation value.
Optionally, when the core binding virtual machine is deployed, querying the vCPU remaining conditions and the vCPU over-rate ratio of all the host machines;
determining the occupancy amount of the bound vCPU of the bound virtual machine through the vCPU statistical model;
selecting a host machine meeting the occupation amount of the bound vCPU as a target host machine;
determining a pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine on a target host machine through the vCPU floating group set model;
adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set;
and acquiring the binding dependent resources of the binding virtual machine, and calling the corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependent resources.
Optionally, when deploying a non-core-bound virtual machine, determining a target host according to the vCPU floating group set model and the vCPU statistical model, and deploying the non-core-bound virtual machine by using the target host, includes:
when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines;
determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model;
selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine;
determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine;
and acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources.
Optionally, when a virtual machine is deleted, acquiring the occupied amount of the virtual machine resources on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the occupied amount of the virtual machine resources, including the following steps:
when a core binding virtual machine is deleted, acquiring and releasing the core binding vCPU occupation amount of the core binding virtual machine according to the vCPU statistical model, releasing a pCPU set bound by the core binding virtual machine through the vCPU floating group set model, updating the vCPU floating group set model, adjusting the pCPU scheduling ranges of all non-core binding virtual machines on a target host machine according to the VFG set, and calling a bottom layer interface to delete the core binding virtual machine, core binding dependent resources and core binding resources;
when a non-core-bound virtual machine is deleted, counting the occupation amount of a non-core-bound vCPU of the non-core-bound virtual machine according to the vCPU floating group set model, releasing the occupation amount, and calling a bottom layer interface to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources.
In a second aspect, to achieve the above object, the present invention further provides a hybrid virtual hybrid deployment apparatus for binding and non-binding, including:
the model component module is used for constructing a vCPU floating group set model and a vCPU statistical model;
the deployment module is used for determining a target host according to the vCPU floating group set model and the vCPU statistical model when deploying the bound virtual machine or the non-bound virtual machine, and deploying the bound virtual machine or the non-bound virtual machine by using the target host;
and the deleting module is used for acquiring the occupied amount of the resources of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model when the virtual machine is deleted, and releasing the occupied amount of the resources of the virtual machine.
In a third aspect, to achieve the above object, the present invention further provides a bound and non-bound virtual mixed deployment device, where the bound and non-bound virtual mixed deployment device includes: a memory, a processor, and a bound and non-bound virtual hybrid deployment program stored on the memory and executable on the processor, the bound and non-bound virtual hybrid deployment program configured to implement the steps of the bound and non-bound virtual hybrid deployment method as recited in the claims above.
In a fourth aspect, to achieve the above object, the present invention further provides a storage medium, where a bound and non-bound virtual mixed deployment program is stored, and when executed by a processor, the storage medium implements the steps of the bound and non-bound virtual mixed deployment method as described above.
The invention provides a virtual mixed deployment method of bound cores and non-bound cores, which comprises the steps of constructing a vCPU floating group set model and a vCPU statistical model; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the bound virtual machine and the non-bound virtual machine can be supported, the utilization rate of pCPU resources of the host machine is improved, the material cost is saved, the pCPU resources of the bound virtual machine and the non-bound virtual machine on the same host machine are effectively prevented from being occupied, the computing performance of the virtual machine is improved, and the computing resource scheduling success rate is improved by counting the vCPU occupation of the bound virtual machine under the situation of vCPU over-allocation in the host machine.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a virtual hybrid deployment method of bound and non-bound cores according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a virtual hybrid deployment method of bound and non-bound cores according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a virtual hybrid deployment method of bound and non-bound cores according to the present invention;
FIG. 5 is a schematic diagram illustrating that a native OpenStack may seize a vCPU resource of a bound core and a non-bound core in the prior art;
FIG. 6 is a flowchart illustrating a fourth embodiment of a virtual hybrid deployment method of bound and non-bound cores according to the present invention;
FIG. 7 is a schematic diagram of VFG dynamic update after a new core-bound virtual machine is deployed in the core-bound and non-core-bound virtual hybrid deployment method of the present invention;
FIG. 8 is a flowchart illustrating a fifth embodiment of a virtual hybrid deployment method of bound and unbound cores according to the present invention;
FIG. 9 is a flowchart illustrating a sixth embodiment of a virtual hybrid deployment method of bound and non-bound cores according to the present invention;
fig. 10 is a functional block diagram of a first embodiment of the virtual hybrid deployment apparatus with bound and non-bound cores according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The solution of the embodiment of the invention is mainly as follows: constructing a vCPU floating group set model and a vCPU statistical model; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the bound virtual machine and the non-bound virtual machine can be supported, the utilization rate of pCPU resources of the host machine is improved, the material cost is saved, the pCPU resources of the bound virtual machine and the non-bound virtual machine on the same host machine are effectively prevented from being seized, and the computing performance of the virtual machine is improved, under the situation of vCPU over-allocation in a host machine, the vCPU occupation of the bound virtual machine is counted, so that the success rate of computing resource scheduling is improved, and the technical problems that the pCPU resource in the prior art is low in flexibility and physical resource utilization rate, the computing performance of the virtual machine is influenced, and the success rate of resource scheduling is low when the virtual machine is established are solved.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a Wi-Fi interface). The Memory 1005 may be a high-speed RAM Memory or a Non-Volatile Memory (Non-Volatile Memory), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a bound and non-bound virtual hybrid deployment program.
The device calls a virtual mixed deployment program of bound cores and non-bound cores stored in a memory 1005 through a processor 1001 and executes the following operations:
constructing a vCPU floating group set model and a vCPU statistical model;
when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host;
when the virtual machine is deleted, acquiring the resource occupation amount of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the resource occupation amount of the virtual machine.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
acquiring an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set;
and acquiring a vCPU over-rate ratio, and constructing a vCPU statistical model according to the vCPU over-rate ratio.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
acquiring an available pCPU set and a bound pCPU set;
calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine;
and constructing a vCPU floating group set model according to the scheduling range of the virtual machine.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
obtaining a vCPU over-rate ratio and obtaining an available pCPU set;
calculating the product of the number of the available pCPU and the excess ratio of the vCPU to obtain the vCPU available amount of the target host machine;
calculating the product of the number of the core binding virtual machines and the vCPU over-rate ratio to obtain a vCPU occupation value of the core binding virtual machines;
calculating the product of the number of the non-core-binding virtual machines and 1 to obtain the vCPU occupation value of the non-core-binding virtual machines;
and constructing a vCPU statistical model according to the vCPU occupation value.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
when the core binding virtual machine is deployed, querying the vCPU residual conditions and the vCPU over-rate ratio of all the host machines;
determining the occupancy amount of the bound vCPU of the bound virtual machine through the vCPU statistical model;
selecting a host machine meeting the occupation amount of the bound vCPU as a target host machine;
determining a pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine on a target host machine through the vCPU floating group set model;
adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set;
and acquiring the binding dependent resources of the binding virtual machine, and calling the corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependent resources.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines;
determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model;
selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine;
determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine;
and acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources.
Further, the processor 1001 may call the bound and non-bound virtual hybrid deployment program stored in the memory 1005, and also perform the following operations:
when a core binding virtual machine is deleted, acquiring and releasing the core binding vCPU occupation amount of the core binding virtual machine according to the vCPU statistical model, releasing a pCPU set bound by the core binding virtual machine through the vCPU floating group set model, updating the vCPU floating group set model, adjusting the pCPU scheduling ranges of all non-core binding virtual machines on a target host machine according to the VFG set, and calling a bottom layer interface to delete the core binding virtual machine, core binding dependent resources and core binding resources;
when a non-core-bound virtual machine is deleted, counting the occupation amount of a non-core-bound vCPU of the non-core-bound virtual machine according to the vCPU floating group set model, releasing the occupation amount, and calling a bottom layer interface to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources.
According to the scheme, a vCPU floating group set model and a vCPU statistical model are constructed; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the bound virtual machine and the non-bound virtual machine can be supported, the utilization rate of pCPU resources of the host machine is improved, the material cost is saved, the pCPU resources of the bound virtual machine and the non-bound virtual machine on the same host machine are effectively prevented from being occupied, the computing performance of the virtual machine is improved, and the computing resource scheduling success rate is improved by counting the vCPU occupation of the bound virtual machine under the situation of vCPU over-allocation in the host machine.
Based on the hardware structure, the embodiment of the virtual mixed deployment method of bound cores and non-bound cores is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a virtual hybrid deployment method of a bound core and a non-bound core according to the present invention.
In a first embodiment, the virtual hybrid deployment method of bound cores and non-bound cores includes the following steps:
and step S10, constructing a vCPU floating group set model and a vCPU statistical model.
It should be noted that the VCPU Floating Group (VFG) aggregation model is a dynamic aggregation model for recording the pCPU scheduling range corresponding to the unbound vCPU, and the vCPU statistical model is a virtual CPU for counting the bound/unbound virtual machines, that is, a vCPU quantity statistical model for counting the actual occupation situation of the vCPU.
Step S20, when deploying the bound core virtual machine or the non-bound core virtual machine, determining a target host according to the vCPU floating group set model and the vCPU statistical model, and deploying the bound core virtual machine or the non-bound core virtual machine by using the target host.
It should be noted that, in the field of computing virtual machines, virtual machine vCPU scheduling types may be divided into a bound virtual machine and a non-bound virtual machine; the core binding virtual machine is to bind the vCPU of the virtual machine to one or more pCPUs of a host machine for execution, monopolize the pCPUs and not allow the vCPU of other virtual machines to use; the non-core-binding virtual machines mean that vCPUs of the virtual machines are distributed by a core scheduling strategy, and resources are possibly preempted under the condition of high load among the non-core-binding virtual machines; when a certain service depends on the computing power of the CPU seriously, the service can be deployed on the binding virtual machine; when a certain service is not sensitive to the CPU computing capacity, the service can be deployed on a non-binding virtual machine.
It can be understood that, when the virtual machine is deployed, the current resource surplus can be obtained, and the target host is determined according to the resource surplus to deploy the corresponding bound virtual machine or non-bound virtual machine, so that the vCPU resource utilization rate of the host can be improved, the vCPU resource preemption phenomenon of the bound virtual machine and the non-bound virtual machine on the same host is avoided, and the computing performance of the two virtual machines is improved.
In a specific implementation, an optimal target host machine can be selected by scheduling a resource scheduler in response to a resource request of a virtual machine and comparing the calculated demand of each resource with the resource residual amount of the host machine, so that the corresponding bound virtual machine or non-bound virtual machine can be deployed through the target host machine.
And step S30, when the virtual machine is deleted, acquiring the occupied amount of the virtual machine resources on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the occupied amount of the virtual machine resources.
It should be understood that, when a virtual machine is deleted, the resource occupation amount of the virtual machine can be obtained, and the resource depended by the relevant virtual machine is released, so that the utilization rate of the resource is improved, the accuracy of computing resource scheduling is improved, and the success rate of resource scheduling is improved.
According to the scheme, a vCPU floating group set model and a vCPU statistical model are constructed; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the bound virtual machine and the non-bound virtual machine can be supported, the utilization rate of pCPU resources of the host machine is improved, the material cost is saved, the pCPU resources of the bound virtual machine and the non-bound virtual machine on the same host machine are effectively prevented from being occupied, the computing performance of the virtual machine is improved, and the computing resource scheduling success rate is improved by counting the vCPU occupation of the bound virtual machine under the situation of vCPU over-allocation in the host machine.
Further, fig. 3 is a flowchart illustrating a second embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention, and as shown in fig. 3, the second embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention is proposed based on the first embodiment, and in this embodiment, the step S10 specifically includes the following steps:
and S11, acquiring an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set.
It should be noted that, the set of available CPUs in the available pCPU set, that is, the combination of the CPUs already bound in the bound pCPU set, that is, the pCPU set, and the bound pCPU set can construct a vCPU floating group set model, that is, the vCPU floating group set model is dynamically changed along with the change of the number of CPUs in the available pCPU set and the bound pCPU set, so as to cause the floating of the CPUs in the vCPU floating group set model.
And step S12, acquiring a vCPU over-rate ratio, and constructing a vCPU statistical model according to the vCPU over-rate ratio.
It can be understood that the vCPU over-Ratio (vCPU Allocation Ratio) is a distribution Ratio of all current vcpus acquired in real time, and the vCPU occupancy amount of the virtual machine can be determined by the vCPU over-Ratio, so as to construct a vCPU statistical model.
According to the scheme, the method comprises the steps of obtaining an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set; the method comprises the steps of obtaining a vCPU excess ratio, constructing a vCPU statistical model according to the vCPU excess ratio, preparing for mixed deployment of the bound and non-bound virtual machines, and improving deployment speed and efficiency.
Further, fig. 4 is a flowchart illustrating a third embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention, and as shown in fig. 4, the third embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention is proposed based on the second embodiment, in this embodiment, the step S11 specifically includes the following steps:
and step S111, acquiring an available pCPU set and a bound pCPU set.
It should be noted that, the manner of obtaining the available pCPU set and the bound pCPU set may be to obtain corresponding CPU data through data interaction with the host, so as to determine the available pCPU set and the bound pCPU set.
And step S112, calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine.
It is understood that the remaining non-bound-core virtual machines are obtained by calculating the difference between the pCPU in the available pCPU set and the pCPU in the bound pCPU set, i.e., screening out the pCPU in the available pCPU set that has been bound.
And S113, constructing a vCPU floating group set model according to the scheduling range of the virtual machine.
It should be understood that the pCPU scheduling range corresponding to the vCPU of the non-bound virtual machine can be dynamically defined according to the available pCPU set ca (cpu available) and the bound pCPU set cb (cpu binding) on the host:
VFG=CA-CB
establishing a dynamic VCPU Floating Group (VFG) set model, and dynamically defining a pCPU scheduling range corresponding to a vCPU of a non-bound core virtual machine according to an available pCPU set CA and a bound pCPU set CB on a host machine, wherein the VFG is used for determining the scheduling range of the non-bound core; namely that only bound cores can be scheduled in the CB (fixed in a one-to-one correspondence), and non-bound cores are scheduled in the VFG; therefore, the complex scene of elastic mixed deployment of the bound core virtual machine and the non-bound core virtual machine is supported.
In a specific implementation, as shown in fig. 5, fig. 5 is a schematic diagram that native OpenStack in the prior art may preempt resources of a bound core and a non-bound core vCPU, and as shown in fig. 5, a scene support limit for mixed deployment of a bound core virtual machine and a non-bound core virtual machine in native OpenStack is: 1. one implementation is that a fixed bound core and non-bound core pCPU available interval is required to be set for a host machine, and the bound core and the non-bound core pCPU available interval cannot be used in a mixed way, namely, a bound core virtual machine cannot be created in the pCPU interval of a non-bound core virtual machine, and a non-bound core virtual machine cannot be created in the pCPU interval of the bound core virtual machine; therefore, if one type of environment reaches the upper limit of resources and the other type of environment has surplus, the resources reaching the upper limit cannot be created, the flexibility of the vCPU resources is greatly limited, and the resource utilization rate is reduced; 2. one is to use the mixture of the available pCPU and the available pCPU without setting the available pCPU interval. According to the scheme, the vCPU of the core binding virtual machine is non-exclusive, so that the vCPU of the core binding and the vCPU of the non-core binding cause resource preemption to influence the computing performance of the virtual machine; 3. under the situation of over-allocation of vCPU resources, the second scheme is to count vCPU resource occupation of the bound core virtual machine and the non-bound core virtual machine without distinguishing, so that the success rate of resource scheduling is influenced.
In a specific implementation, the range CA of one available pCPU of a null host is {1, 2.., 8}, and then the current vCPU floating group VFG is also {1, 2.., 8 }; after a 2vCPU binding virtual machine M is deployed on a host machine, if a pCPU bound to the host machine is {1, 2}, a set CB is {1, 2}, and VFG (1, 2., 8} - {1, 2} - {3, 4., 8} is dynamically updated, so that the vCPU of a non-binding virtual machine is scheduled in the range of {3, 4., 8}, and the contention of computing resources of the non-binding virtual machine and the binding virtual machine is avoided; when a non-core-bound virtual machine N is deployed on a host, the scheduling range of the vCPU of the virtual machine N may be specified according to the set range of the current VFG, for example, the vCPU resource of the host is 8 × 10 — 80; the resource of the core-bound virtual machine M is 2 × 10 ═ 20, and the currently available non-core-bound vCPU resource is 60, that is, according to CR ═ 10, it can deploy 60 maximum vCPU non-core-bound virtual machines, that is, according to the CU's computing scheme, it can deploy 60/10 ═ 6vCPU core-bound virtual machines.
In the embodiment, by the above scheme, the available pCPU set and the bound pCPU set are obtained; calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine; the vCPU floating group set model is established according to the virtual machine scheduling range, preparation can be made for mixed deployment of the bound and non-bound virtual machines, the deployment speed and efficiency are improved, the vCPU is reasonably scheduled in a certain range, and the contention of computing resources of the non-bound virtual machines and the bound virtual machines is avoided.
Further, fig. 6 is a flowchart illustrating a fourth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention, and as shown in fig. 6, the fourth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention is proposed based on the second embodiment, and in this embodiment, the step S12 specifically includes the following steps:
and step S121, obtaining the vCPU over-rate ratio and obtaining an available pCPU set.
It should be noted that the vCPU over-divide Ratio is a value of the vCPU over-divide Ratio (CR), the available pCPU sets correspond to a plurality of pcpus, the corresponding available pCPU sets can be generated by summarizing the available pcpus, and the number of available pcpus at the current time can be determined by the available pCPU sets.
And S122, calculating the product of the number of the available pCPU and the excess ratio of the vCPU to obtain the vCPU available amount of the target host machine.
It can be understood that the vCPU occupancy value, i.e. the vCPU available amount of the target host, can be obtained by multiplying the vCPU number by the vCPU overage ratio value.
And S123, calculating the product of the number of the core binding virtual machines and the vCPU over-rate ratio to obtain the vCPU occupation value of the core binding virtual machines.
It should be noted that the vCPU occupancy value of the core binding virtual machine, that is, the available amount of the vCPU of the core binding virtual machine, may be obtained after multiplying the vCPU excess ratio value by the number of the core binding virtual machines.
And step S124, calculating the product of the number of the non-core-bound virtual machines and 1 to obtain the vCPU occupation value of the non-core-bound virtual machines.
It can be understood that, when calculating the vCPU occupancy value of the non-core-bound virtual machine, the calculation multiple is 1, that is, the vCPU occupancy value of the non-core-bound virtual machine can be obtained by multiplying the number of the non-core-bound virtual machines by 1.
It should be understood that a statistical vCPU mathematical model, i.e., U-CJ CR, may be constructed based on the vCPU occupancy value, where U is the vCPU occupancy value, CJ is the number of pcpus in the bundled pCPU set, and CR is the vCPU over-rating.
In a specific implementation, as shown in fig. 7, fig. 7 is a schematic diagram of VFG dynamic update after a core-bound virtual machine is newly deployed by the core-bound and non-core-bound virtual mixed deployment method of the present invention, and as shown in fig. 7, a dynamic VCPU Floating Group (VFG) aggregation model is established, and a pCPU scheduling range corresponding to a vCPU of a non-core-bound virtual machine is dynamically defined according to a pCPU aggregation CA available on a host and a pCPU aggregation CB already bound to support a complex scenario of elastic mixed deployment of a core-bound virtual machine and a non-core-bound virtual machine: such as: 1) an empty (no vm) host available pCPU range CA is {1, 2.., 8}, then the current VFG is also {1, 2.., 8 }; 2) after a 2vCPU binding virtual machine is deployed on a host machine, if the pCPU bound to the host machine is {1, 2}, the set CB is {1, 2}, and the VFG is dynamically updated to be {1, 2,. multidot.8 } - {1, 2} - {3, 4,. multidot.8 }, the vCPU of a non-binding virtual machine is scheduled in the range of {3, 4,. multidot.8 }, so that the contention of computing resources of the non-binding virtual machine and the binding virtual machine is avoided; 3) in a similar way, after one binding virtual machine is deleted, the bound pCPU is released and added into the set of VFGs; and under the situation of over-allocation of vCPU resources, reestablishing a vCPU statistical model of the bound virtual machine. Using the value of the over-partition ratio CR (vCPU allocation ratio) of the vCPU as a multiple to calculate the number of vCPU resource occupation (CbindU, CPU bound used) of the binding virtual machine; and the statistics of the non-binding virtual machines remain unchanged, i.e., the calculation multiple is 1.
CbindU=Cbind×CR
Such as: the vCPU over-rate CR of a host is 10, the pCPU number of the host is 6, and the total available vCPU is: 6 × CR is 60, theoretically 6 bound vcpus or 60 non-bound vcpus can be deployed; 1) when a non-core-bound virtual machine A of a 2vCPU is deployed, the statistics of the vCPU resource number occupied by the A in the host machine are as follows: 2 × 1 ═ 2; 2) when a 2vCPU (Cbind) binding virtual machine B is deployed, the vCPU resource number occupied by the B in the host machine is counted as B; 2 × CR ═ 20; the statistical result of the original scheme is consistent with the non-binding core and is 2, which is contrary to the theoretical value.
In a specific implementation, the statistics of the non-core-bound virtual machines are kept unchanged, that is, the calculation multiple is 1, if the vCPU excess ratio CR of the host is 10 and the number CJ of available pcpus of the host is 6, the total amount of the vcpus available is 6 × CR 60, and theoretically, 6 core-bound vcpus or 60 non-core-bound virtual machines can be deployed independently; when a non-core-bound virtual machine A with two vCPUs is deployed, the statistics of the vCPUs occupied by A in the host machine is as follows: 2 x 1 ═ 2; when a core binding virtual machine B with two vCPUs is deployed, the number of the vCPUs occupied by the machine B in the host machine is counted as 2 x CR (20); the statistical result of the openstack sourcing scheme in the prior art is 2 consistent with that of the non-bound vCPU, which is contrary to the theoretical value, and the actual vCPU number occupied by the bound virtual machine cannot be reflected correctly.
According to the scheme, the number of pCPU in the bound pCPU set is obtained by obtaining the vCPU over-dividing ratio; calculating the product of the pCPU number and the vCPU over-dividing ratio to obtain a vCPU occupation value of the core binding virtual machine; and constructing a vCPU statistical model according to the vCPU occupation value, and calculating vCPU occupation of the binding virtual machine more optimally, so that the resource utilization rate is improved, the accuracy of computing resource scheduling is improved, and the success rate of resource scheduling is improved.
Further, fig. 8 is a flowchart illustrating a fifth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention, and as shown in fig. 8, based on the first embodiment, the fifth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention is proposed, in this embodiment, when deploying a binding virtual machine, the step S20 specifically includes the following steps:
and step S21, when the core binding virtual machine or the non-core binding virtual machine is deployed, querying the vCPU residual conditions and the vCPU over-rate ratio of all the hosts.
It should be noted that, when deploying the bound or non-bound virtual machine, the resource scheduler may query the vCPU remaining conditions (i.e., subtracting the used vCPU number from the total vCPU number) and the vCPU excess ratio of all the current hosts.
In a specific implementation, when deploying a bound or non-bound virtual machine, the resource request of the virtual machine may be responded, and scheduling is performed by the resource scheduler, so that the required amount of each resource, such as the amount of vcpus, the size of memory, the size of a disk, and the like, may be calculated, and thus the resource surplus of all hosts is compared, and an optimal target host is selected.
And step S22, determining the occupation amount of the bound cores vCPU of the bound core virtual machine through the vCPU statistical model.
It can be understood that the occupancy amount, i.e. the demand amount, of the bound cores vCPU of the bound core virtual machine can be determined through the vCPU statistical model.
And step S23, selecting the host machine meeting the occupation amount of the bound vCPU as a target host machine.
It should be understood that the host machines meeting the binding vCPU occupancy may be selected as the target host machines through the sorting, for example, the host machine with the largest vCPU occupancy determination resource residual amount is screened out as the target host machine, and of course, other screening conditions may also be set to determine the target host machine, which is not limited in this embodiment.
And step S24, determining a pCPU dispatching set corresponding to the vCPU of the non-core-bound virtual machine on the target host machine through the vCPU floating group set model.
It can be understood that the pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine is determined on the target host machine through the vCPU floating group aggregation model.
And step S25, adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set.
It should be understood that the pCPU scheduling scope of the non-bound virtual machine may be adjusted through the pCPU scheduling set, and is generally checked and preempted for resources to which the pCPU scheduling scope is directed.
And step S26, acquiring the binding dependent resources of the binding virtual machine, and calling the corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependent resources.
It can be understood that, through the core binding dependent resource of the core binding virtual machine, the corresponding virtual machine can be incubated by using the bottom layer interface through the corresponding core binding dependent resource, that is, the core binding virtual machine is incubated according to the adjusted scheduling range and the bottom layer interface corresponding to the core binding dependent resource call, and the core binding virtual machine is incubated according to the adjusted scheduling range and the bottom layer interface corresponding to the core binding dependent resource call.
When deploying the non-core-bound virtual machine, the step S20 specifically includes the following steps:
when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines;
determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model;
selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine;
determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine;
and acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources.
It should be noted that, the resources corresponding to the non-core deployment request may be checked and preempted in response to the non-core deployment request, and after the vCPU floating group set model is called, the pCPU scheduling range of the non-core binding virtual machine may be determined.
It can be understood that according to the pCPU scheduling scope, the non-bound core dependent resources of the corresponding non-bound core virtual machine can be scheduled from the resource pool,
in a specific implementation, when a binding virtual machine is deployed, a pCPU set CB bound by a vCPU of the binding virtual machine can be determined, and then a pCPU scheduling set corresponding to the vCPU of a non-binding virtual machine is calculated by using a VFG model according to the available pCPU set CA on a host machine; and then adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the host machine to be VFG according to the VFG set of the dynamically updated host machine, wherein the method for adjusting the VFG scheduling ranges can be realized by the following steps: establishing a corresponding Linux CGroup according to the VFG and dynamically adjusting the Linux CGroup or adjusting the Linux CGroup through a vcpupin interface of Libvirt; when the non-binding virtual machine is deployed, a current host machine VFG set can be obtained to set the pCPU scheduling range of the non-binding virtual machine to be VFG, and then corresponding non-binding dependent resources are created.
It should be understood that the created resources may utilize the bottom layer interface to hatch the corresponding virtual machine, that is, the core-bound virtual machine is hatched according to the adjusted scheduling range and the bottom layer interface corresponding to the core-bound dependent resource call, and the core-unbound virtual machine is hatched according to the adjusted scheduling range and the bottom layer interface corresponding to the core-unbound dependent resource call.
According to the scheme, when the core binding virtual machine is deployed, the vCPU residual conditions and the vCPU over-rate ratio of all the host machines are inquired; determining the occupancy amount of the bound vCPU of the bound virtual machine through the vCPU statistical model; selecting a host machine meeting the occupation amount of the bound vCPU as a target host machine; determining a pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine on a target host machine through the vCPU floating group set model; adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set; acquiring a binding dependency resource of the binding virtual machine, and calling a corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependency resource; when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines; determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model; selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine; determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine; acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources; the method can support the elastic mixed deployment of the core binding virtual machine and the non-core binding virtual machine, improves the utilization rate of the pCPU of the host machine, saves the material cost, and effectively avoids the occupation of the pCPU of the core binding virtual machine and the non-core binding virtual machine on the same host machine, thereby improving the computing performance of the virtual machine.
Further, fig. 9 is a flowchart illustrating a sixth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention, and as shown in fig. 9, the sixth embodiment of the virtual mixed deployment method of binding and non-binding according to the present invention is proposed based on the first embodiment, in this embodiment, the step S30 specifically includes the following steps:
and S31, when deleting the core binding virtual machine, acquiring the core binding vCPU occupation amount of the core binding virtual machine according to the vCPU statistical model and releasing the core binding vCPU occupation amount, releasing the pCPU set bound by the core binding virtual machine through the vCPU floating group set model, updating the vCPU floating group set model, adjusting the pCPU dispatching ranges of all non-core binding virtual machines on a target host machine according to the VFG set, and calling a bottom interface to delete the core binding virtual machine, the core binding dependent resources and the core binding resources.
It should be noted that, when deleting a core binding virtual machine, the virtual machine resource occupation amount on the host machine to which the core binding virtual machine belongs may be obtained according to the vCPU statistical model, and then the core binding vCPU occupation amount of the core binding virtual machine is released, and the pCPU set bound by the core binding virtual machine may be released by using the vCPU floating set model, so as to dynamically update the vCPU floating set model, and according to the dynamically updated pCPU scheduling range of the non-core binding virtual machine on the host machine, the bottom interface is called to delete the virtual machine and delete other dependent resources.
Step S32, when deleting the non-core-bound virtual machine, counting the non-core-bound vCPU occupation amount of the non-core-bound virtual machine according to the vCPU floating group set model and releasing, and calling a bottom layer interface to delete the non-core-bound virtual machine, the non-core-bound dependent resources and the non-core-bound resources.
It can be understood that when a non-core-bound virtual machine is deleted, the occupied amount of the non-core-bound vCPU of the non-core-bound virtual machine is counted and released according to the vCPU floating group set model, that is, the pCPU scheduling ranges of all the non-core-bound virtual machines on the host are adjusted to be VFG, a bottom layer interface can be called to delete the virtual machine and delete other dependent resources, the bottom layer interface is called to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources, that is, a target interface is called to delete the core-bound virtual machine or the non-core-bound virtual machine, and the resources dependent on the core-bound virtual machine or the non-core-bound virtual machine are deleted.
According to the scheme, when the core binding virtual machine is deleted, the core binding vCPU occupation amount of the core binding virtual machine is obtained and released according to the vCPU statistical model, the pCPU set bound by the core binding virtual machine is released through the vCPU floating set model, the vCPU floating set model is updated, the pCPU dispatching ranges of all non-core binding virtual machines on a target host machine are adjusted according to the VFG set, and a bottom layer interface is called to delete the core binding virtual machine, the core binding dependent resources and the core binding resources; when a non-core-bound virtual machine is deleted, counting the occupation amount of a non-core-bound vCPU of the non-core-bound virtual machine according to the vCPU floating group set model, releasing the occupation amount, and calling a bottom layer interface to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources; the method can improve the success rate of computing resource scheduling by counting the vCPU occupation of the bound virtual machine under the situation of vCPU over-distribution in the host machine.
Correspondingly, the invention further provides a virtual mixed deployment device of bound cores and non-bound cores.
Referring to fig. 10, fig. 10 is a functional block diagram of a first embodiment of a virtual hybrid deployment apparatus of a bound core and a non-bound core according to the present invention.
In a first embodiment of the virtual hybrid deployment apparatus for binding and non-binding cores of the present invention, the virtual hybrid deployment apparatus for binding and non-binding cores includes:
and the model component module 10 is used for constructing a vCPU floating group set model and a vCPU statistical model.
And the deployment module 20 is configured to, when deploying a bound or non-bound virtual machine, determine a target host according to the vCPU floating group aggregation model and the vCPU statistical model, and deploy the bound or non-bound virtual machine by using the target host.
And the deleting module 30 is configured to, when a virtual machine is deleted, obtain the occupied amount of the virtual machine resources on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and release the occupied amount of the virtual machine resources.
The steps implemented by each functional module of the binding and non-binding virtual mixed deployment device may refer to each embodiment of the binding and non-binding virtual mixed deployment method of the present invention, and are not described herein again.
In addition, an embodiment of the present invention further provides a storage medium, where a bound and non-bound virtual hybrid deployment program is stored on the storage medium, and when executed by a processor, the bound and non-bound virtual hybrid deployment program implements the following operations:
constructing a vCPU floating group set model and a vCPU statistical model;
when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host;
when the virtual machine is deleted, acquiring the resource occupation amount of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the resource occupation amount of the virtual machine.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
acquiring an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set;
and acquiring a vCPU over-rate ratio, and constructing a vCPU statistical model according to the vCPU over-rate ratio.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
acquiring an available pCPU set and a bound pCPU set;
calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine;
and constructing a vCPU floating group set model according to the scheduling range of the virtual machine.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
obtaining a vCPU over-rate ratio and obtaining an available pCPU set;
calculating the product of the number of the available pCPU and the excess ratio of the vCPU to obtain the vCPU available amount of the target host machine;
calculating the product of the number of the core binding virtual machines and the vCPU over-rate ratio to obtain a vCPU occupation value of the core binding virtual machines;
calculating the product of the number of the non-core-binding virtual machines and 1 to obtain the vCPU occupation value of the non-core-binding virtual machines;
and constructing a vCPU statistical model according to the vCPU occupation value.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
when the core binding virtual machine is deployed, querying the vCPU residual conditions and the vCPU over-rate ratio of all the host machines;
determining the occupancy amount of the bound vCPU of the bound virtual machine through the vCPU statistical model;
selecting a host machine meeting the occupation amount of the bound vCPU as a target host machine;
determining a pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine on a target host machine through the vCPU floating group set model;
adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set;
and acquiring the binding dependent resources of the binding virtual machine, and calling the corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependent resources.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines;
determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model;
selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine;
determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine;
and acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources.
Further, when executed by the processor, the virtual hybrid deployment program with bound cores and non-bound cores further implements the following operations:
when a core binding virtual machine is deleted, acquiring and releasing the core binding vCPU occupation amount of the core binding virtual machine according to the vCPU statistical model, releasing a pCPU set bound by the core binding virtual machine through the vCPU floating group set model, updating the vCPU floating group set model, adjusting the pCPU scheduling ranges of all non-core binding virtual machines on a target host machine according to the VFG set, and calling a bottom layer interface to delete the core binding virtual machine, core binding dependent resources and core binding resources;
when a non-core-bound virtual machine is deleted, counting the occupation amount of a non-core-bound vCPU of the non-core-bound virtual machine according to the vCPU floating group set model, releasing the occupation amount, and calling a bottom layer interface to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources.
According to the scheme, a vCPU floating group set model and a vCPU statistical model are constructed; when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host; when the virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound virtual machine belongs is obtained according to the vCPU statistical model, the virtual machine resource occupation amount is released, the elastic mixed deployment of the bound virtual machine and the non-bound virtual machine can be supported, the utilization rate of pCPU resources of the host machine is improved, the material cost is saved, the pCPU resources of the bound virtual machine and the non-bound virtual machine on the same host machine are effectively prevented from being occupied, the computing performance of the virtual machine is improved, and the computing resource scheduling success rate is improved by counting the vCPU occupation of the bound virtual machine under the situation of vCPU over-allocation in the host machine.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A virtual mixed deployment method of bound cores and non-bound cores is characterized by comprising the following steps:
constructing a vCPU floating group set model and a vCPU statistical model;
when a core binding virtual machine or a non-core binding virtual machine is deployed, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the core binding virtual machine or the non-core binding virtual machine is deployed by using the target host;
when the virtual machine is deleted, acquiring the resource occupation amount of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model, and releasing the resource occupation amount of the virtual machine.
2. The bound and non-bound virtual mixed deployment method of claim 1, wherein the constructing a vCPU floating group set model and a vCPU statistical model comprises:
acquiring an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model according to the available pCPU set and the bound pCPU set;
and acquiring a vCPU over-rate ratio, and constructing a vCPU statistical model according to the vCPU over-rate ratio.
3. The method for virtually mixed deployment of bound and unbound cores according to claim 2, wherein the obtaining an available pCPU set and a bound pCPU set, and constructing a vCPU floating group set model from the available pCPU set and the bound pCPU set comprises:
acquiring an available pCPU set and a bound pCPU set;
calculating the difference value between the available pCPU set and the bound pCPU set to obtain the virtual machine scheduling range of the non-core-bound virtual machine;
and constructing a vCPU floating group set model according to the scheduling range of the virtual machine.
4. The bound and non-bound virtual mixed deployment method of claim 2, wherein the obtaining a vCPU excess ratio and constructing a vCPU statistical model according to the vCPU excess ratio comprises:
obtaining a vCPU over-rate ratio and obtaining an available pCPU set;
calculating the product of the number of the available pCPU and the excess ratio of the vCPU to obtain the vCPU available amount of the target host machine;
calculating the product of the number of the core binding virtual machines and the vCPU over-rate ratio to obtain a vCPU occupation value of the core binding virtual machines;
calculating the product of the number of the non-core-binding virtual machines and 1 to obtain the vCPU occupation value of the non-core-binding virtual machines;
and constructing a vCPU statistical model according to the vCPU occupation value.
5. The hybrid deployment method of the bound core and the non-bound core virtual machine according to claim 1, wherein when deploying the bound core virtual machine, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the bound core virtual machine is deployed by using the target host, including:
when the core binding virtual machine is deployed, querying the vCPU residual conditions and the vCPU over-rate ratio of all the host machines;
determining the occupancy amount of the bound vCPU of the bound virtual machine through the vCPU statistical model;
selecting a host machine meeting the occupation amount of the bound vCPU as a target host machine;
determining a pCPU scheduling set corresponding to the vCPU of the non-bound virtual machine on a target host machine through the vCPU floating group set model;
adjusting the pCPU scheduling ranges of all the non-core-bound virtual machines on the target host machine according to the pCPU scheduling set;
and acquiring the binding dependent resources of the binding virtual machine, and calling the corresponding bottom layer interface to hatch the binding virtual machine according to the adjusted scheduling range and the binding dependent resources.
6. The hybrid deployment method of the bound and non-bound cores of claim 1, wherein when deploying the non-bound core virtual machine, a target host is determined according to the vCPU floating group set model and the vCPU statistical model, and the non-bound core virtual machine is deployed by using the target host, comprising:
when a non-core-bound virtual machine is deployed, querying the residual vCPU conditions of all host machines;
determining the occupation amount of a non-bound core vCPU of the non-bound core virtual machine through the vCPU statistical model;
selecting a host machine which meets the occupation amount of the non-bound cores vCPU as a target host machine;
determining a pCPU dispatching range of a non-bound virtual machine according to the vCPU floating group set model of the target host machine;
and acquiring non-core-binding dependent resources of the non-core-binding virtual machine, and calling a corresponding bottom layer interface to hatch the non-core-binding virtual machine according to the adjusted scheduling range and the non-core-binding dependent resources.
7. The hybrid deployment method of the bound and non-bound cores of any one of claims 1 to 6, wherein when a virtual machine is deleted, the virtual machine resource occupation amount on the host machine to which the bound virtual machine or the non-bound core virtual machine belongs is obtained according to the vCPU statistical model, and the virtual machine resource occupation amount is released, and the method comprises the following steps:
when a core binding virtual machine is deleted, acquiring and releasing the core binding vCPU occupation amount of the core binding virtual machine according to the vCPU statistical model, releasing a pCPU set bound by the core binding virtual machine through the vCPU floating group set model, updating the vCPU floating group set model, adjusting the pCPU scheduling ranges of all non-core binding virtual machines on a target host machine according to the VFG set, and calling a bottom layer interface to delete the core binding virtual machine, core binding dependent resources and core binding resources;
when a non-core-bound virtual machine is deleted, counting the occupation amount of a non-core-bound vCPU of the non-core-bound virtual machine according to the vCPU floating group set model, releasing the occupation amount, and calling a bottom layer interface to delete the non-core-bound virtual machine, non-core-bound dependent resources and non-core-bound resources.
8. A virtual hybrid deployment device of a bound core and a non-bound core, characterized in that the virtual hybrid deployment device of the bound core and the non-bound core comprises:
the model component module is used for constructing a vCPU floating group set model and a vCPU statistical model;
the deployment module is used for determining a target host according to the vCPU floating group set model and the vCPU statistical model when deploying the bound virtual machine or the non-bound virtual machine, and deploying the bound virtual machine or the non-bound virtual machine by using the target host;
and the deleting module is used for acquiring the occupied amount of the resources of the virtual machine on the host machine to which the bound virtual machine or the non-bound virtual machine belongs according to the vCPU statistical model when the virtual machine is deleted, and releasing the occupied amount of the resources of the virtual machine.
9. A bound and non-bound virtual hybrid deployment device, comprising: a memory, a processor and a bound and non-bound virtual hybrid deployment program stored on the memory and executable on the processor, the bound and non-bound virtual hybrid deployment program being configured to implement the steps of the bound and non-bound virtual hybrid deployment method according to any one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium stores thereon a bound and non-bound virtual hybrid deployment program, which when executed by a processor implements the steps of the bound and non-bound virtual hybrid deployment method according to any one of claims 1 to 7.
CN202110015450.8A 2021-01-05 2021-01-05 Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core Active CN112667364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110015450.8A CN112667364B (en) 2021-01-05 2021-01-05 Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110015450.8A CN112667364B (en) 2021-01-05 2021-01-05 Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core

Publications (2)

Publication Number Publication Date
CN112667364A true CN112667364A (en) 2021-04-16
CN112667364B CN112667364B (en) 2022-07-01

Family

ID=75413332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110015450.8A Active CN112667364B (en) 2021-01-05 2021-01-05 Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core

Country Status (1)

Country Link
CN (1) CN112667364B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023273238A1 (en) * 2021-06-29 2023-01-05 天翼云科技有限公司 Graphics processing resource allocating method and apparatus, device, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968746A (en) * 2010-09-02 2011-02-09 北京航空航天大学 Method for implementing organizational architecture mode of kernel-based virtual machine (KVM)
CN103678003A (en) * 2013-12-18 2014-03-26 华中科技大学 Virtual CPU scheduling method capable of enhancing real-time performance
CN103677990A (en) * 2013-12-13 2014-03-26 清华大学 Virtual machine real-time task scheduling method and device and virtual machine
US20160162336A1 (en) * 2013-08-26 2016-06-09 Vmware, Inc. Cpu scheduler configured to support latency sensitive virtual machines
US20160306647A1 (en) * 2013-12-20 2016-10-20 Huawei Technologies Co., Ltd. Method for affinity binding of interrupt of virtual network interface card, and computer device
CN111190691A (en) * 2019-12-25 2020-05-22 中国建设银行股份有限公司 Automatic migration method, system, device and storage medium suitable for virtual machine
CN111694658A (en) * 2020-04-30 2020-09-22 北京城市网邻信息技术有限公司 CPU resource allocation method, device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968746A (en) * 2010-09-02 2011-02-09 北京航空航天大学 Method for implementing organizational architecture mode of kernel-based virtual machine (KVM)
US20160162336A1 (en) * 2013-08-26 2016-06-09 Vmware, Inc. Cpu scheduler configured to support latency sensitive virtual machines
CN103677990A (en) * 2013-12-13 2014-03-26 清华大学 Virtual machine real-time task scheduling method and device and virtual machine
CN103678003A (en) * 2013-12-18 2014-03-26 华中科技大学 Virtual CPU scheduling method capable of enhancing real-time performance
US20160306647A1 (en) * 2013-12-20 2016-10-20 Huawei Technologies Co., Ltd. Method for affinity binding of interrupt of virtual network interface card, and computer device
CN111190691A (en) * 2019-12-25 2020-05-22 中国建设银行股份有限公司 Automatic migration method, system, device and storage medium suitable for virtual machine
CN111694658A (en) * 2020-04-30 2020-09-22 北京城市网邻信息技术有限公司 CPU resource allocation method, device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
乾龙_HERON: "KVM上如何绑定虚拟机vcpu与物理cpu", 《HTTPS://BLOG.CSDN.NET/QIANLONG4526888/ARTICLE/DETAILS/42554265》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023273238A1 (en) * 2021-06-29 2023-01-05 天翼云科技有限公司 Graphics processing resource allocating method and apparatus, device, and storage medium

Also Published As

Publication number Publication date
CN112667364B (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN108614726B (en) Virtual machine creation method and device
US20200137151A1 (en) Load balancing engine, client, distributed computing system, and load balancing method
AU2013277589B2 (en) Offloading virtual machine flows to physical queues
CN106371894B (en) Configuration method and device and data processing server
CN111324435A (en) Distributed task scheduling and registering method, device and distributed task scheduling system
CN111026500B (en) Cloud computing simulation platform, and creation method, device and storage medium thereof
CN114327843A (en) Task scheduling method and device
CN112667364B (en) Virtual mixed deployment method, device, equipment and storage medium for bound core and non-bound core
CN111443985A (en) Method and equipment for instantiating virtual network function
WO2013139037A1 (en) Method and device for scheduling resources
WO2023221844A1 (en) Resource scheduling method, device, and storage medium
CN111736957A (en) Multi-type service mixed deployment method, device, equipment and storage medium
KR20220070020A (en) Network resource management method, system, network device and readable storage medium
EP3698246A1 (en) Management of a virtual network function
US10884781B2 (en) Method and apparatus for a virtual machine
CN110795202B (en) Resource allocation method and device of virtualized cluster resource management system
CN112261125B (en) Centralized unit cloud deployment method, device and system
CN109218259B (en) License management method and device, APPLM functional entity and computer readable storage medium
CN114448909B (en) Network card queue polling method and device based on ovs, computer equipment and medium
CN107634978A (en) A kind of resource regulating method and device
CN115964152A (en) GPU resource scheduling method, equipment and storage medium
CN110119300A (en) The load-balancing method and device of dummy unit cluster
CN107346262A (en) The method and controller of a kind of task immigration
CN115248731A (en) Resource deployment method and device, and storage medium
CN113204434B (en) Planned task execution method and device based on k8s and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant