CN111400020B - Virtual machine scheduling method and device and computer readable storage medium - Google Patents

Virtual machine scheduling method and device and computer readable storage medium Download PDF

Info

Publication number
CN111400020B
CN111400020B CN201910000542.1A CN201910000542A CN111400020B CN 111400020 B CN111400020 B CN 111400020B CN 201910000542 A CN201910000542 A CN 201910000542A CN 111400020 B CN111400020 B CN 111400020B
Authority
CN
China
Prior art keywords
weight
vram
vcpu
virtual machine
hypervisor server
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.)
Active
Application number
CN201910000542.1A
Other languages
Chinese (zh)
Other versions
CN111400020A (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.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910000542.1A priority Critical patent/CN111400020B/en
Publication of CN111400020A publication Critical patent/CN111400020A/en
Application granted granted Critical
Publication of CN111400020B publication Critical patent/CN111400020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention provides a virtual machine scheduling method, a virtual machine scheduling device and a computer readable storage medium, wherein the method comprises the following steps: determining relevant feature values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of average virtual processors (vCPU) and the amount of average memory required for the pre-created plurality of virtual machines; and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight.

Description

Virtual machine scheduling method and device and computer readable storage medium
Technical Field
The present invention relates to the field of mobile communications technologies, and in particular, to a virtual machine scheduling method, a virtual machine scheduling device, and a computer readable storage medium.
Background
In the virtual layer product of network function virtualization (Network Function Virtualization, NFV), one de facto standard for VIM is commercial enhancement with open source OpenStack software. Typically, an OpenStack manages a large number of Hypervisor servers (also called VMMs), and when a virtual machine is being created, the Nova-scheduler of the OpenStack Nova component needs to go through a series of algorithms to calculate on which Hypervisor server the virtual machine should be created.
When creating a virtual machine, specification of the virtual machine needs to be specified, and the virtual machine specification includes the number of vCPU needed by the virtual machine and the memory size. In NFV scenarios, CPU core binding techniques are typically used, i.e. one vCPU of a virtual machine may monopolize one CPU physical core or one hyper-thread of one CPU physical core, based on performance considerations.
In the implementation of the community version OpenStack, a Weight algorithm is a simpler Weight algorithm, namely, the situation of the remaining memory of the Hypervisor is judged, and the Weight of the Hypervisor server with the largest remaining memory is the highest. When the weights of the hypervisors are the same, one Hypervisor server is randomly selected to create a virtual machine. In the implementation of community version OpenStack, the nova-scheduler selects which Hypervisor server creates a virtual machine from according to a filter algorithm and a weight algorithm, one pass is required when each virtual machine is created, and the creation process of multiple virtual machines is not linked in the scheduling algorithm.
However, in the NFV scenario, when VNFM or NFVO deploys VNFs, a lot of virtual machines need to be created, and the number of vCPU and the memory size required for these virtual machines are greatly different according to VNFs of different vendors and different VNFC types. In the related technical scheme, the weight algorithm cannot sense the differences in the NFV scene, so that a plurality of resource fragments are likely to exist on a certain Hypervisor server, and the resource fragments can cause the waste of server resources, thereby influencing purchasing cost, energy conservation and emission reduction.
Disclosure of Invention
In view of this, embodiments of the present invention desire to provide a virtual machine scheduling method, apparatus, and computer-readable storage medium.
In order to achieve the above object, the technical solution of the embodiment of the present invention is as follows:
the embodiment of the invention provides a virtual machine scheduling method, which comprises the following steps:
determining relevant characteristic values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight.
Wherein said determining on which Hypervisor server each of said virtual machines should be created comprises:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining a total weight of the corresponding Hypervisor server based on each weight factor of the Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
Wherein said determining on which Hypervisor server each of said virtual machines should be created is formulated by:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
Wherein said determining on which Hypervisor server each of said virtual machines should be created is formulated by:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is The number of vCPU's remaining for a single Hypervisor server, vRAM The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
Optionally, when determining that the sizes of all the hypervisors are the same or the differences are within a preset range, the method further includes:
vCPU based on the number of vCPUs left by Hypervisor server after virtual machine creation The remainder is * And the vRAM capacity vRAM of the Hypervisor server remaining after the virtual machine is created The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
Wherein the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the pre-established minimum virtual machine specification, but the residual quantity of the memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
Wherein, the Weight factor Weight2 is used for reducing resource fragments generated by the following cases:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
The embodiment of the invention also provides a virtual machine scheduling device, which comprises:
the determining module is used for determining relevant characteristic values in the Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
and the processing module is used for determining which Hypervisor server each virtual machine is to be created on based on the related characteristic values and combining a weight algorithm one by one, wherein the Hypervisor server is the Hypervisor server with the highest total weight.
The embodiment of the invention also provides a virtual machine scheduling device, which comprises: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to execute the steps of the above method when running the computer program.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of the above method.
The embodiment of the invention provides a virtual machine scheduling method, a device and a computer readable storage medium, which are used for determining relevant characteristic values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of average virtual processors (vCPU) and the amount of average memory required for the pre-created plurality of virtual machines; and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight. According to the embodiment of the invention, the characteristic values (at least comprising the number of the average virtual processors vCPU and the number of the required average memory) of the network elements in the NFV scene are introduced into the weight algorithm, the weight algorithm is adjusted, and the characteristic values are introduced into a formula, so that a batch of virtual machines required by the VNF are determined to be created on which Hypervisor server one by one, and resource fragments (hyper threads and memories of CPU physical cores or physical cores which cannot be used by the virtual machines any more) of a server resource pool can be ensured to be minimum as much as possible, so that purchase cost is reduced as a whole, and the effects of energy conservation and emission reduction are achieved. In addition, the embodiment of the invention can adjust the creation position of the virtual machine at any time according to the service condition in the actual deployment scheme and the dynamic state of the resource use, and optimize the fragments of the resource pool.
In addition, in the implementation of proposal, the virtual machine does not need to be migrated, and the continuity of running service is maintained, so that the operations of online of new service, capacity expansion of the existing service and the like do not impact the existing production.
Drawings
FIG. 1 is a schematic flow chart of a virtual machine scheduling method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a virtual machine scheduling apparatus according to an embodiment of the present invention.
Detailed Description
The invention is described below with reference to the drawings and examples.
The embodiment of the invention provides a virtual machine scheduling method, as shown in fig. 1, which comprises the following steps:
step 101: determining relevant characteristic values in the NFV scene; the relevant characteristic value at least comprises: the number of average vcpus and the number of average memories required for the plurality of virtual machines pre-created;
step 102: and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight.
Here, the correlation characteristic value may further include: network bandwidth characteristic values, storage capacity characteristic values, and the like.
According to the embodiment of the invention, the characteristic values (at least comprising the number of the average virtual processors vCPU and the number of the required average memory) of the network elements in the NFV scene are introduced into the weight algorithm, the weight algorithm is adjusted, and the characteristic values are introduced into a formula, so that a batch of virtual machines required by the VNF are determined to be created on which Hypervisor server one by one, and resource fragments (hyper threads and memories of CPU physical cores or physical cores which cannot be used by the virtual machines any more) of a server resource pool can be ensured to be minimum as much as possible, so that purchase cost is reduced as a whole, and the effects of energy conservation and emission reduction are achieved.
In an embodiment of the present invention, the determining on which Hypervisor server each of the virtual machines should be created includes:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining a total weight of the corresponding Hypervisor server based on each weight factor of the Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
In the embodiment of the present invention, the determining which Hypervisor server each virtual machine should be created on is represented by the following formula:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
Here, the total weight may be determined by one or more weight factors, and the specific implementation process may refer to an actual network situation.
In one embodiment, the determining on which Hypervisor server each of the virtual machines should be created is expressed by the following formula:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is The number of vCPU's remaining for a single Hypervisor server, vRAM The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
Here, the total weight is determined by a weight factor.
In one embodiment, when it is determined that the sizes of all the hypervisors are the same or the differences are within a preset range, the method further includes:
vCPU based on the number of vCPUs left by Hypervisor server after virtual machine creation The remainder is * And the vRAM capacity vRAM of the Hypervisor server remaining after the virtual machine is created The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
Here, the total weight is determined by two weight factors.
In the embodiment of the invention, the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the number of completely allocated or remaining CPU cores (vCPU) is lower than the number required by the pre-created minimum virtual machine specification, but the remaining memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
In the embodiment of the present invention, the Weight factor Weight2 is used to reduce resource fragments generated in the following cases:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
In order to implement the method, an embodiment of the present invention further provides a virtual machine scheduling device, as shown in fig. 2, where the device includes:
a determining module 201, configured to determine a relevant feature value in a network function virtualization NFV scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
and the processing module 202 is configured to determine, one by one, on which Hypervisor server each virtual machine should be created based on the relevant feature values and in combination with a weighting algorithm, where the Hypervisor server is the Hypervisor server with the highest total weight.
In an embodiment of the present invention, the processing module 202 determines on which Hypervisor server each of the virtual machines should be created, including:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining a total weight of the corresponding Hypervisor server based on each weight factor of the Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
In an embodiment of the present invention, the processing module 202 determines on which Hypervisor server each of the virtual machines should be created, by the following formula:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
In an embodiment of the present invention, the processing module 202 determines on which Hypervisor server each of the virtual machines should be created, by the following formula:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is For a single HypThe number of remaining vcpus, vRAM, of ervisor servers The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
In one embodiment, the processing module 202 is further configured to, when determining that the sizes of all the hypervisors are the same or the difference is within a preset range, further determine the number vCPU of vcpus remaining in the hypervisors after the virtual machine is created The remainder is * And the vRAM capacity vRAM of the Hypervisor server remaining after the virtual machine is created The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
In the embodiment of the invention, the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the pre-established minimum virtual machine specification, but the residual quantity of the memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
In the embodiment of the present invention, the Weight factor Weight2 is used to reduce resource fragments generated in the following cases:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
The embodiment of the invention also provides a virtual machine scheduling device, which comprises: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor, when executing the computer program, performs:
determining relevant characteristic values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight.
The processor, when determining on which Hypervisor server each of the virtual machines should be created, is further configured to execute, when running the computer program:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining a total weight of the corresponding Hypervisor server based on each weight factor of the Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
In the embodiment of the present invention, the determining which Hypervisor server each virtual machine should be created on is represented by the following formula:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
In the embodiment of the present invention, the determining which Hypervisor server each virtual machine should be created on is represented by the following formula:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the method comprises the steps ofThe vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is The number of vCPU's remaining for a single Hypervisor server, vRAM The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
When determining that the sizes of all the hypervisors are the same or the differences are within the preset range, the processor is further configured to execute, when executing the computer program:
vCPU based on the number of vCPUs left by Hypervisor server after virtual machine creation The remainder is * And the vRAM capacity vRAM of the Hypervisor server remaining after the virtual machine is created The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
Wherein the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the pre-established minimum virtual machine specification, but the residual quantity of the memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
Wherein, the Weight factor Weight2 is used for reducing resource fragments generated by the following cases:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
It should be noted that: in the apparatus provided in the above embodiment, only the division of each program module is used for illustration when virtual machine scheduling is performed, and in practical application, the processing allocation may be performed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules, so as to complete all or part of the processing described above. In addition, the apparatus provided in the foregoing embodiments and the corresponding method embodiments belong to the same concept, and specific implementation processes of the apparatus and the corresponding method embodiments are detailed in the method embodiments, which are not described herein again.
In an exemplary embodiment, the present invention further provides a computer readable storage medium, which may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above-described memories, such as a mobile phone, computer, tablet device, personal digital assistant, or the like.
The embodiment of the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs:
determining relevant characteristic values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
and determining on which Hypervisor server each virtual machine should be created one by one based on the related eigenvalue and combining with a weight algorithm, wherein the Hypervisor server is the Hypervisor server with the highest total weight.
The determining on which Hypervisor server each of the virtual machines should be created, when executed by the processor, further performs:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining a total weight of the corresponding Hypervisor server based on each weight factor of the Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
In the embodiment of the present invention, the determining which Hypervisor server each virtual machine should be created on is represented by the following formula:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
In the embodiment of the present invention, the determining which Hypervisor server each virtual machine should be created on is represented by the following formula:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is The number of vCPU's remaining for a single Hypervisor server, vRAM The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
When determining that the sizes of all the hypervisors are the same or the differences are within the preset range, the computer program is executed by the processor and further executes:
vCPU based on the number of vCPUs left by Hypervisor server after virtual machine creation The remainder is * And creating a virtual machineResidual vRAM capacity vRAM of rear Hypervisor server The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
Wherein the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the pre-established minimum virtual machine specification, but the residual quantity of the memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
Wherein, the Weight factor Weight2 is used for reducing resource fragments generated by the following cases:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
The invention is described below in connection with scene embodiments.
In the related art, the following kinds of resource fragments exist on the Hypervisor server:
resource fragment type one: the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the minimum virtual machine specification, but the residual quantity of the memory is sufficient;
resource fragment category two: the memory is completely allocated or the residual quantity is lower than the capacity required by the minimum virtual machine specification, but the residual quantity of the CPU core is sufficient;
resource fragment category three: the CPU core and the memory residual amount are lower, the creation of the virtual machine meeting the smaller specification but not meeting the larger specification is realized, but the virtual machine with the smaller specification is already created;
these resource fragments will result in wasted server resources, affecting procurement costs and energy conservation and emission reduction.
Thus, the present embodiment optimizes resource fragmentation by introducing two eigenvalues and improving the weight algorithm.
Here, the two feature values introduced are:
average vCPU number required for virtual machine(s) in NFV scenario: vCPU avg
Average amount of memory required for virtual machines in NFV scenarios: vRAM (volatile memory) avg
The weight algorithm based on the two improved eigenvalues is as follows:
total Weight Total (S) =Weight 1 *Weight 2 *…*Weight N The method comprises the steps of carrying out a first treatment on the surface of the Here, there may be a plurality of Weight factors, only Weight is given here 1 And Weight 2 Two examples:
Weight 1 for the above-mentioned resource fragment types one and two,
P=(vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg );
Wherein vCPU Leave a total of vRAM is the sum of the number of vCPUs (physical cores or hyper-threads of physical cores) remaining for all Hypervisor servers in the resource pool Leave a total of The sum of the vRAM capacity remaining for all Hypervisor servers in the resource pool. When P>1, the residual CPU resources in the resource pool are sufficient, and memory fragments should be reduced as much as possible; when P<1, the remaining memory resources of the Hypervisor server are sufficient, and CPU fragmentation should be reduced as much as possible.
Q=((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein vCPU The remainder is The number of vcpus (physical cores or hyper-threads of physical cores) remaining for Hypervisor servers, vRAM The remainder is vRAM capacity, vCPU, remaining for Hypervisor server vm The number of vcpus needed for the virtual machine, vRAM vm Memory capacity required for the virtual machine. When Q is>1, if a virtual machine is created on the Hypervisor server, then after the virtual machine creation is complete, the Hypervisor server's "vCPU" is used to create a virtual machine The remainder is /vRAM The remainder is "ratio exceeds" vCPU avg /vRAM avg ", is easy to cause fragmentation of CPU resources, and is suitable for P>1. When Q is<1, if a virtual machine is created on the Hypervisor server, then after the virtual machine creation is complete, the Hypervisor server's "vCPU" is used to create a virtual machine The remainder is /vRAM The remainder is "ratio is lower than" vCPU avg /vRAM avg ", is easy to cause fragmentation of memory resources, is suitable for P<1.
According to the above description, when P>When 1, the weight of the server with large Q is high, and when P<When 1, the weight of the server with small Q is high. Then Weight 1 The following formula can be used for calculation:
Weight 1 =P^Q=((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is –vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg )。
Here, weight 2 =1/(m×n+1), mainly for resource fragment class three
When a plurality of Hypervisor servers exist, the Hypervisor servers can execute the processing according to the Weight 1 The Weight values calculated by the algorithm are equal or similar (different weights can be set according to actual practice) 1 The range of differences between) should be as good as possible to use up the resources on one Hypervisor server. Considering that the possibility of using up the resources on one Hypervisor server in real situation is small, the residual resources on the Hypervisor server after the virtual machine is created should be guaranteed to be as close to the characteristic value as possible, so as to improve the probability of using up the resources on the Hypervisor server after the virtual machine is created next time.
Wherein m= (((vCPU) The remainder is *-vCPU vm )/vCPU avg –1)*((vRAM The remainder is *-vRAM vm )/vRAM avg –1))^2;
Here, the value of M is respectively corresponding to vCPU after the virtual machine is created The remainder is * And vRAM after the virtual machine is created The remainder is * In a parabolic relationship, the closer the remaining CPU resources and the remaining memory resources on the Hypervisor server are to the eigenvalue, the closer M is to 0 after the virtual machine is created.
N=(((vCPU The remainder is /vCPU vm )-1)*((vRAM The remainder is /vRAM vm )-1))^2;
The value of N is relative to the current vCPU respectively The remainder is And current vRAM The remainder is In a parabolic relationship, the closer the remaining CPU and memory resources on the Hypervisor server are to the CPU and memory resources required by the virtual machine, the closer N is to 0 and the closer the resources on the Hypervisor server are to the exact exhaustion.
When the weights of the Hypervisor servers are exactly equal, one Hypervisor server is randomly selected to create a virtual machine.
The embodiment of the invention introduces the characteristic value of the network element in the NFV scene in the weight algorithm, and at least comprises the following steps: the method comprises the steps of adjusting weight algorithm according to the number of average virtual processors vCPU and the number of average memories required by a plurality of pre-created virtual machines, and incorporating characteristic values into a formula, so that it is determined on which Hypervisor server a batch of virtual machines required by the VNF are created one by one, resource fragments (hyper threads and memories of CPU physical cores or physical cores which cannot be used by the virtual machines any more) of a server resource pool can be ensured to be minimum as much as possible, purchase cost is reduced as a whole, and energy conservation and emission reduction effects are achieved. In addition, the embodiment of the invention can adjust the creation position of the virtual machine at any time according to the service condition in the actual deployment scheme and the dynamic state of the resource use, and optimize the fragments of the resource pool.
In addition, in the implementation of proposal, the virtual machine does not need to be migrated, and the continuity of running service is maintained, so that the operations of online of new service, capacity expansion of the existing service and the like do not impact the existing production.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention.

Claims (9)

1. A virtual machine scheduling method, the method comprising:
determining relevant characteristic values in a Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
determining which Hypervisor server each virtual machine should be created on based on the related characteristic value and combining with a weight algorithm one by one, wherein the Hypervisor server is the Hypervisor server with the highest total weight;
wherein said determining on which Hypervisor server each of said virtual machines should be created comprises:
determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining the total weight of the corresponding Hypervisor server based on each weight factor of each Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
2. The method of claim 1, wherein the determining on which Hypervisor server each of the virtual machines should be created is expressed by the following formula:
Weight total (S) =Weight 1 *Weight 2 *…*Weight N
Wherein the Weight is Total (S) The total weight of the Hypervisor server; the Weight is 1 、Weight 2 、…Weight N The N is a positive integer and is determined by the relevant characteristic value and relevant parameters of the Hypervisor server; different weight factors correspond to different kinds of resource fragments of the Hypervisor server.
3. The method of claim 2, wherein the determining on which Hypervisor server each of the virtual machines should be created is expressed by the following formula:
Weight 1 =((vCPU leave a total of /vCPU avg )/(vRAM Leave a total of /vRAM avg ))^((vCPU The remainder is
vCPU vm )/vCPU avg )/((vRAM The remainder is –vRAM vm )/vRAM avg );
Wherein the vCPU Leave a total of The sum of the number of vCPUs remaining for all Hypervisor servers in the resource pool; the vRAM Leave a total of The sum of the remaining vRAM capacity of all Hypervisor servers in the resource pool; the vCPU avg For the average vCPU number; the vRAM avg The average memory quantity is; vCPU The remainder is The number of vCPU's remaining for a single Hypervisor server, vRAM The remainder is vRAM capacity, vCPU, remaining for a single Hypervisor server vm The number of vcpus needed for a single virtual machine, vRAM vm Memory capacity required for the virtual machine.
4. The method of claim 3, wherein when it is determined that the sizes of all the hypervisors are the same or the differences are within a predetermined range, the method further comprises:
vCPU based on the number of vCPUs left by Hypervisor server after virtual machine creation The remainder is * And the vRAM capacity vRAM of the Hypervisor server remaining after the virtual machine is created The remainder is * And the vRAM avg 、vCPU avg 、vRAM The remainder is 、vCPU The remainder is 、vCPU vm And vRAM vm Co-determining the Weight factor Weight 2
5. The method of claim 2, wherein the Weight factor Weight 1 For reducing resource fragmentation resulting from one or both of the following:
the CPU cores are completely allocated or the residual quantity is lower than the quantity required by the pre-established minimum virtual machine specification, but the residual quantity of the memory is sufficient;
the CPU memory has been fully allocated or has a remaining amount lower than the capacity required by the pre-created minimum virtual machine specification, but the CPU core remaining amount is sufficient.
6. The method of claim 2, wherein the Weight factor Weight2 is used to reduce resource fragmentation generated by:
the CPU core and the memory surplus are low, the creation of the virtual machine which meets the preset small specification but does not meet the preset large specification is achieved, but the virtual machine with the preset small specification is already created.
7. A virtual machine scheduling apparatus, the apparatus comprising:
the determining module is used for determining relevant characteristic values in the Network Function Virtualization (NFV) scene; the relevant characteristic value at least comprises: the number of virtual processors vCPUs and the number of memory required for the virtual machines are pre-created;
the processing module is used for determining which Hypervisor server each virtual machine is to be built on based on the related characteristic values and combining a weight algorithm one by one, wherein the Hypervisor server is the Hypervisor server with the highest total weight;
the processing module is specifically configured to: determining each weight factor of each Hypervisor server respectively; different weight factors correspond to different kinds of resource fragments of the Hypervisor server;
determining the total weight of the corresponding Hypervisor server based on each weight factor of each Hypervisor server;
and determining the Hypervisor server with the highest total weight as the Hypervisor server for creating the virtual machine.
8. A virtual machine scheduling apparatus, the apparatus comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any of claims 1-6 when the computer program is run.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1-6.
CN201910000542.1A 2019-01-02 2019-01-02 Virtual machine scheduling method and device and computer readable storage medium Active CN111400020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910000542.1A CN111400020B (en) 2019-01-02 2019-01-02 Virtual machine scheduling method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910000542.1A CN111400020B (en) 2019-01-02 2019-01-02 Virtual machine scheduling method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111400020A CN111400020A (en) 2020-07-10
CN111400020B true CN111400020B (en) 2023-05-09

Family

ID=71431976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910000542.1A Active CN111400020B (en) 2019-01-02 2019-01-02 Virtual machine scheduling method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111400020B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294552A (en) * 2012-02-22 2013-09-11 鸿富锦精密工业(深圳)有限公司 Method for increasing configuration quantity of virtual machines of server
JP2017215884A (en) * 2016-06-02 2017-12-07 日本電信電話株式会社 Virtual machine arrangement device and resource management method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10387204B2 (en) * 2017-05-12 2019-08-20 International Business Machines Corporation Resource pooling in a virtualized cloud container environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294552A (en) * 2012-02-22 2013-09-11 鸿富锦精密工业(深圳)有限公司 Method for increasing configuration quantity of virtual machines of server
JP2017215884A (en) * 2016-06-02 2017-12-07 日本電信電話株式会社 Virtual machine arrangement device and resource management method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
经济日报数据中心X86服务器虚拟化综述;焦繁等;《中国报业》(第14期);全文 *

Also Published As

Publication number Publication date
CN111400020A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
WO2015154686A1 (en) Scheduling method and apparatus for distributed computing system
KR101741381B1 (en) Maintenance-cost-aware billing for cloud services
WO2011110026A1 (en) Method and apparatus for realizing load balance of resources in data center
CN110990154B (en) Big data application optimization method, device and storage medium
CN104572251B (en) Virtual machine deployment method and device
WO2015032201A1 (en) Virtual machine placing method and device
Chowdhury et al. Study and performance analysis of various VM placement strategies
CN104461739B (en) A kind of virtual machine batch dispositions method based on cloudsim platforms
Jersak et al. Performance-aware server consolidation with adjustable interference levels
WO2018036104A1 (en) Virtual machine deployment method, system and physical server
TW201324357A (en) Green energy management of virtual machine cluster
US20200137581A1 (en) Resource utilization of heterogeneous compute units in electronic design automation
US9898061B2 (en) Resource capacity management in a cluster of host computers using power management analysis
CN111666158A (en) Kubernetes-based container scheduling method and device, storage medium and electronic equipment
CN107203394B (en) High-safety docker container batch deployment method and device
WO2020108536A1 (en) Virtual network resource allocation method and system and electronic device
Kumar et al. Application of Min-min and Max-min algorithm for task scheduling in cloud environment under time shared and space shared vm models
CN106919450B (en) Resource adjusting method and device
CN115269118A (en) Scheduling method, device and equipment of virtual machine
CN111400020B (en) Virtual machine scheduling method and device and computer readable storage medium
Zhuang et al. Impact of instance seeking strategies on resource allocation in cloud data centers
US11256540B2 (en) Server-to-container migration
Goutam et al. The performance evaluation of proactive fault tolerant scheme over cloud using CloudSim simulator
CN110704175B (en) Container deployment method and device
JP6168799B2 (en) Virtual computer system

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