CN109960565B - Cloud platform, and virtual machine scheduling method and device based on cloud platform - Google Patents

Cloud platform, and virtual machine scheduling method and device based on cloud platform Download PDF

Info

Publication number
CN109960565B
CN109960565B CN201711417505.8A CN201711417505A CN109960565B CN 109960565 B CN109960565 B CN 109960565B CN 201711417505 A CN201711417505 A CN 201711417505A CN 109960565 B CN109960565 B CN 109960565B
Authority
CN
China
Prior art keywords
virtual machine
host
node
host node
scheduled
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
CN201711417505.8A
Other languages
Chinese (zh)
Other versions
CN109960565A (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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN201711417505.8A priority Critical patent/CN109960565B/en
Publication of CN109960565A publication Critical patent/CN109960565A/en
Application granted granted Critical
Publication of CN109960565B publication Critical patent/CN109960565B/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/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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • 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/45583Memory management, e.g. access or allocation

Landscapes

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

Abstract

The embodiment of the invention provides a cloud platform, and a virtual machine scheduling method and device based on the cloud platform, and belongs to the technical field of internet. The virtual machine scheduling method based on the cloud platform comprises the following steps: step 1, determining that host machine nodes need to be distributed to a virtual machine to be scheduled; step 2, obtaining the average CPU utilization rate and the average memory utilization rate of a plurality of host nodes of the cloud platform in the latest preset time period; step 3, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period; and 4, distributing the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled.

Description

Cloud platform, and virtual machine scheduling method and device based on cloud platform
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a cloud platform, and a virtual machine scheduling method and device based on the cloud platform.
Background
OpenStack is an open source project aiming at providing software support services for the construction and management of public clouds and private clouds. Its community has over 150 enterprises and 1000 developers, and these organizations and individuals all use OpenStack as a common front-end program for laaS. OpenStack has strong flexibility and gradually becomes a standard service for rapidly building a cloud platform.
The first task of the OpenStack project is to simplify the cloud deployment process, centrally manage system resources and provide good expandability for the system resources. OpenStack virtualizes a data center, provides an abstract corresponding relation between an application program and hardware by using a management program, and abstracts hardware resources into a computing, storage and network resource pool, so as to correspondingly provide a flexible allocation strategy for resource allocation or request according to requirements. After the OpenStack completes virtualization of the data center, the openStack provides a layer for managing the cloud, and is responsible for deploying various applications and files on the cloud, meanwhile, also provides retrieval of the applications and the files, and creates and allocates virtual machines.
At present, Openstack has a plurality of versions, functions are more and more perfect along with the release of a new version, and the stability of a system is greatly improved. Openstack is a huge system, and consists of many components, such as a computing component (nova), a network component (neutron), a storage component (swift), and an authentication component (keystone).
Wherein Nova is a computing organization controller in the OpenStack cloud. All activities that support the lifecycle of instances (instances) in the OpenStack cloud are handled by Nova. This makes Nova a platform responsible for managing computing resources, networks, authentication, and needed scalability. Nova functions include instance lifecycle management, computing resource management, network and authorization management, asynchronous continuous communication, and the like. To support these functions, Nova itself contains numerous components, including: API Server (nova-API), message queue (rabbitmq Server), computing workstation (nova-computer), network controller (nova-network), volume management (nova-volume) and scheduler (nova-scheduler).
The scheduler is responsible for delivering the nova-API call to the target. The scheduler operates in a daemon process named 'nova-schedule' and selects an operation server from the available resource pool appropriately according to a scheduling algorithm. There are many factors that can affect the scheduling result, such as load, memory, the distance of child nodes, CPU architecture, etc. Currently, the nova scheduler uses several basic scheduling algorithms:
1) randomization: the host randomly selects available nodes;
2) availability: similar to random, except that a randomly selected range is specified;
3) simplification: in this way, the host selects the least loaded one to run the instance. The load data may be obtained from elsewhere, such as a load balancing server.
In the cloud platform, the creation and starting of the virtual machine and the scheduling strategy play an important role in cloud computing, and the performance of the virtual machine and the high efficiency of system resource utilization are directly influenced by the quality of a scheduling algorithm. At present, the default scheduling algorithm of OpenStack is to obtain the remaining memory of a host, and the larger the remaining memory is, the easier a virtual machine is scheduled to the host, but this method has a great defect, and if a virtual machine consuming a large amount of CPU resources is run on the host, but the remaining memory is great, the virtual machine is scheduled to the host and cannot run well, because the CPU resources are occupied by other virtual machines, the performance of the new virtual machine is seriously affected. Therefore, how to optimize the scheduling algorithm and improve the performance of the cloud platform is an important technical problem to be solved at present.
Disclosure of Invention
In view of this, one of the technical problems solved by the embodiments of the present invention is to provide a cloud platform-based virtual machine scheduling scheme, so as to overcome the defect that the performance of a new virtual machine is affected due to improper scheduling in the prior art, thereby resulting in lower performance of a cloud platform, and achieve the effects of optimizing a scheduling algorithm and improving the performance of the cloud platform.
The embodiment of the invention provides a virtual machine scheduling method based on a cloud platform, which comprises the following steps: step 1, determining that host machine nodes need to be distributed to a virtual machine to be scheduled; step 2, obtaining the average CPU utilization rate and the average memory utilization rate of a plurality of host nodes of the cloud platform in the latest preset time period; step 3, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period; and 4, distributing the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled.
Optionally, in an embodiment of the present invention, for each host node, the weight value W of the current available resource metric of the host node is obtained as followsi:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
Wherein, WiIs 1, CiThe average CPU utilization rate, M, of the host node in the latest first preset time periodiThe average memory usage rate of the host node in the last first preset time period is 10, a and b are rational numbers larger than 0, and the sum of a and b is 1nAnd n is an integer greater than or equal to 0.
Alternatively, in one embodiment of the present invention, when Ci<At 25%, a is 0.9 × 10n,b=0.1*10n(ii) a When the content is less than or equal to 25 percent, Ci<At 50%, a is 0.6 x 10n,b=0.4*10n(ii) a When the content is less than or equal to 50 percent, Ci<When 75%, a is 0.4 x 10n,b=0.6*10n(ii) a When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
Optionally, in a specific embodiment of the present invention, determining that a host node needs to be allocated to a virtual machine to be scheduled includes: receiving a scheduling instruction for applying for a new virtual machine sent by a client, and determining that host machine nodes need to be allocated to the new virtual machine; allocating the host node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled, wherein the allocation method comprises the following steps: and creating a new virtual machine for the client on the host node with the maximum weight value of the current available resource measurement.
Optionally, in a specific embodiment of the present invention, determining that a host node needs to be allocated to a virtual machine to be scheduled includes: monitoring that the load of a host node in the cloud platform exceeds a set threshold, and determining the virtual machine which consumes the most CPU and the most memory on the host node with the load exceeding the set threshold as the virtual machine to be scheduled; allocating the host node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled, wherein the allocation method comprises the following steps: and hot-migrating the virtual machine which consumes the most CPU and the most memory from the host machine node with the load exceeding a set threshold value to the host machine node with the maximum weight value of the current available resource measurement.
Optionally, in a specific embodiment of the present invention, after the host node with the largest weight value of the current available resource metric is assigned to the virtual machine to be scheduled, the method further includes: continuously monitoring host nodes with the loads exceeding a set threshold value, and judging whether the loads of the host nodes with the loads exceeding the set threshold value exceed the threshold value within a second preset time period; under the condition that the load of the host node with the load exceeding the set threshold value in a second preset time period is judged to exceed the threshold value, acquiring the virtual machine which consumes the CPU and the memory most at the current host node with the load exceeding the set threshold value, determining the virtual machine which consumes the CPU and the memory most as the virtual machine to be dispatched, and returning to the step 1; and under the condition that the load of the host machine node with the load exceeding the set threshold value in a second preset time period is judged not to exceed the threshold value, ending the process.
The embodiment of the present invention further provides a virtual machine scheduling apparatus based on a cloud platform, including: the determining module is used for determining whether host machine nodes need to be distributed for the virtual machine to be scheduled or not, and triggering the scheduling module if the host machine nodes need to be distributed for the virtual machine to be scheduled; the scheduling module is used for obtaining the average CPU utilization rate and the average memory utilization rate of a plurality of host machine nodes of the cloud platform in the latest preset time period, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period, and distributing the host machine node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled.
Optionally, in an embodiment of the present invention, for each host node, the scheduling module obtains a weight value W of a current available resource metric of the host node in the following manneri:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
Wherein, WiIs 1, CiIs the average CPU utilization rate, M, of the host node in the latest preset time periodiFor the average memory usage of the host node in the latest preset time period, a and b are rational numbers greater than 0, and the sum of a and b is 10 of 1nAnd n is an integer greater than or equal to 0.
Alternatively, in one embodiment of the present invention, when Ci<At 25%, a is 0.9 × 10n,b=0.1*10n(ii) a When the content is less than or equal to 25 percent, Ci<At 50%, a is 0.6 x 10n,b=0.4*10n(ii) a When the content is less than or equal to 50 percent, Ci<When 75%, a is 0.4 x 10n,b=0.6*10n(ii) a When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
Optionally, in a specific embodiment of the present invention, the determining module determines that a host node needs to be allocated to the virtual machine to be scheduled according to the following: receiving a scheduling instruction for applying for a new virtual machine sent by a client, and determining that host machine nodes need to be allocated to the new virtual machine; the scheduling module allocates the host node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled according to the following modes: and creating a new virtual machine for the client on the host node with the maximum weight value of the current available resource measurement.
Optionally, in a specific embodiment of the present invention, the determining module determines that a host node needs to be allocated to the virtual machine to be scheduled, under the following conditions: detecting that the load of a host node in the cloud platform exceeds a set threshold, and determining a virtual machine which consumes the most CPU and the most memory on the host node with the load exceeding the set threshold as a virtual machine to be scheduled; the scheduling module allocates the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled in the following mode: and hot-migrating the virtual machine which consumes the most CPU and the most memory from the host machine node with the load exceeding a set threshold value to the host machine node with the maximum weight value of the current available resource measurement.
Optionally, in a specific embodiment of the present invention, the determining module is further configured to, after the scheduling module allocates the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled, continue to monitor the host node whose load exceeds the set threshold, and determine whether the load of the host node whose load exceeds the set threshold exceeds the threshold in a second preset time period; under the condition that the load of the host machine node with the load exceeding the set threshold value in a second preset time period is judged to exceed the threshold value, the virtual machine which consumes the CPU and the memory most at present on the host machine node with the load exceeding the set threshold value is determined as the virtual machine to be scheduled, and the scheduling module is triggered.
The embodiment of the invention also provides a cloud platform which comprises the device.
According to the technical scheme, the available resource measurement model of the host node is constructed by combining the average memory utilization rate and the average CPU utilization rate of the host node, and the virtual machine scheduling in the cloud platform is executed based on the model.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
Fig. 1 is a flowchart of a virtual machine scheduling method based on a cloud platform according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for deploying a newly applied virtual machine to a suitable host node according to a second embodiment of the present invention;
fig. 3 is a flowchart of a method for starting a load balancing live migration mechanism when a load of a host in the OpenStack cloud platform is too high according to the second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a virtual machine scheduling apparatus based on a cloud platform according to a third embodiment of the present invention.
Detailed Description
Of course, it is not necessary for any particular embodiment of the invention to achieve all of the above advantages at the same time.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
The embodiment of the invention provides a virtual machine scheduling method based on a cloud platform.
Fig. 1 is a flowchart of a virtual machine scheduling method based on a cloud platform according to an embodiment of the present invention, and as shown in fig. 1, the method mainly includes the following steps S102 to S108.
And step S102, determining that host machine nodes need to be distributed for the virtual machine to be scheduled.
In a specific application, the cloud platform may determine that a host node needs to be allocated to a new virtual machine when receiving a new virtual machine application sent by a user at a client.
Or, in order to balance the load of the host nodes in the cloud platform, the cloud platform may also monitor the load of all the host nodes in the cloud platform, and when it is monitored that the load of a certain host node is too large, that is, the load of a certain host node exceeds a threshold of the device, in order to avoid reduction of user experience due to the too large load of the host node, in an optional implementation manner of the embodiment of the present invention, it may be considered that a certain virtual machine on the host node is hot-migrated to another host node, that is, a certain virtual machine on the host node is used as a virtual machine to be scheduled. Optionally, in order to reduce the load of the overloaded host node as much as possible, the virtual machine currently consuming the most CPU and the most memory on the overloaded host node may be migrated hot, that is, the virtual machine currently consuming the most CPU and the most memory on the overloaded host node is taken as the virtual machine to be scheduled.
Step S104, obtaining the average CPU utilization rate and the average memory utilization rate of a plurality of host nodes of the cloud platform in the latest first preset time period.
In specific application, the average CPU utilization and the average memory utilization of each host node on the cloud platform in the latest first preset time period are recorded in the cloud platform, so that the average CPU utilization and the average memory utilization of a plurality of host nodes of the cloud platform in the latest first preset time period can be obtained.
In a specific implementation process, if a new virtual machine application sent by the client is received, in step S104, an average CPU utilization and an average memory utilization of all host nodes in the cloud platform in a latest first preset time period may be obtained, that is, in this case, the new virtual machine may be allocated to any host node in the cloud platform.
If it is monitored that the load of one host node is too large, step S104 may only obtain the average CPU utilization and the average memory utilization of other host nodes in the cloud platform except for the host node with the too large load in the latest first preset time period, that is, in this case, the virtual machine to be scheduled (i.e., the virtual machine to be migrated in the hot state) may be allocated to other host nodes in the cloud platform except for the host node with the too large load.
In the OpenStack cloud platform, an average CPU utilization rate and an average memory utilization rate of each host node in a latest first preset time period are recorded in a monitoring module.
In a specific application, the duration of the first preset time period may be set according to the specific application, for example, 1 hour, and of course, may also be set to other values, and the specific embodiment of the present invention is not particularly limited.
Step S106, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period.
In the embodiment of the invention, the available resources of the host nodes are used according to the average CPU utilization rate and the average memory utilization rate of each host node in the latest first preset time periodThe measurement model calculates the weight value W of the current available resource measurement of each host machine nodei
In an optional implementation of the embodiment of the present invention, for each host node, the weight value W of the current available resource metric of the host node may be calculated as followsi:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
Wherein, WiIs 1, CiThe average CPU utilization rate, M, of the host node in the latest first preset time periodiFor the average memory usage of the host node in the latest preset time period, a and b are rational numbers greater than 0, and the sum of a and b is 10 of 1nAnd n is an integer greater than or equal to 0. That is, in this alternative embodiment, according to the weight value of the available resource metric of the host node obtained by the last calculation, the average CPU utilization C of the host node in the latest preset time periodiAnd the average memory utilization rate M of the host node in the latest preset time periodiTo calculate a weight value for the current available resource metric for the host node.
In the above optional embodiment, the weight value W according to the available resource metric at the last first preset timeiAnd the average CPU utilization rate C of the host node in the latest first preset time periodiAnd the average memory utilization rate M of the host node in the latest preset time periodiCalculating the weight value W of the current available resource measurement of the host nodei
In the above optional implementation, the values of a and b may be determined according to a specific situation of a cloud platform in practical application, for example, in an optional implementation of the embodiment of the present invention, the values of a and b may be determined in the following manner:
when C is presenti<At 25%, a is 0.9 × 10n,b=0.1*10n
When the content is less than or equal to 25 percent, Ci<At 50%, a is 0.6 x 10n,b=0.4*10n
When the content is less than or equal to 50 percent, Ci<When 75%, a is 0.4 x 10n,b=0.6*10n
When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
And step S108, distributing the host machine node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled.
In a specific application, if a new virtual machine is applied from a client, in step S108, a new virtual machine is created for the client on the host node with the largest weight value of the current available resource metric. If the load of one host node is monitored to be excessive, in step S108, the virtual machine consuming the most CPU and the most memory is hot-migrated from the host node whose load exceeds the set threshold to the host node whose weight of the current available resource metric is the largest.
In an optional implementation of the embodiment of the present invention, if it is detected that a load of one of the host nodes is too large, after step S108, the method may further include: continuously monitoring host nodes with the loads exceeding a set threshold value, and judging whether the loads of the host nodes with the loads exceeding the set threshold value exceed the threshold value within a second preset time period (for example, 5 minutes); under the condition that the load of the host node with the load exceeding the set threshold value exceeds the threshold value within a second preset time period, acquiring the virtual machine with the maximum CPU and memory consumption on the host node with the load exceeding the set threshold value, determining the virtual machine with the maximum CPU and memory consumption as the virtual machine to be dispatched, and returning to the step S102, namely continuously carrying out hot migration on the virtual machine with the maximum CPU and memory consumption on the host node with the load exceeding the set threshold value to other host nodes; and under the condition that the load of the host machine node with the load exceeding the set threshold value in a second preset time period is judged not to exceed the threshold value, ending the process.
The creation and starting scheduling strategies of the virtual machine play a very important role in cloud computing, and the performance of the virtual machine and the high efficiency of system resource utilization are directly influenced by the quality of a scheduling algorithm. In the prior art, the OpenStack scheduling algorithm only calculates according to the size of the remaining memory of the host, and cannot reasonably schedule according to the consumption condition of system resources. Therefore, in the cloud platform-based virtual machine scheduling method provided in the embodiment of the present invention, the available resource measurement model of the host node is constructed by combining the average memory usage rate and the average CPU usage rate of the host node, and virtual machine scheduling in the cloud platform is performed based on the model.
Example two
In this embodiment, an Openstack cloud platform is taken as an example to describe the virtual machine scheduling method based on the cloud platform provided by the embodiment of the present invention.
In the embodiment of the invention, the available resource measurement model of the host node needs to count the CPU utilization rate of each host, increase the average idle rate of the CPU in a period of time in calculating the weight ratio of the hosts, and achieve the effect of evenly distributing CPU resources and memory resources. The CPU utilization and the memory utilization of each host node are recorded in the monitoring module of the Openstack cloud platform, so that in this embodiment, the average CPU utilization and the average memory utilization of each node in the last hour can be obtained, and C is usediAnd MiTo represent the CPU usage and memory usage, W, of one of the host nodes i in the last houriWeight value, W, as a measure of available resources for the host nodeiValue of according to CiAnd MiTo calculate, WiIs set to 1, the scheduler selects the host in the time of need to select WiThe values of (a) are calculated as follows:
1) when C is presentiWhen less than 25%, WiFormula of calculation is as followsShown in formula 1.
Wi=Wi*((1-Ci)*100*0.9+(1-Mi)*100*0.1) (1)
2) When C is presentiWhen not less than 25% and not more than 50%, WiThe calculation formula is shown in formula 2.
Wi=Wi*((1-Ci)*100*0.6+(1-Mi)*100*0.4) (2)
3) When C is presentiWhen not less than 50% and not more than 75%, WiThe calculation formula is shown in formula 3.
Wi=Wi *((1-Ci)*100*0.4+(1-Mi)*100*0.6) (3)
4) When C is presenti75% or more, WiThe calculation formula is shown in formula 4.
Wi=Wi*((1-Ci)*100*0.1+(1-Mi)*100*0.9) (4)
WiThe larger the value of (b), the more resources are left representing the host, the more suitable it is for the host to be a new virtual machine, or for virtual machines on other nodes to be migrated to the node.
In a specific application, the above calculation WiThe algorithm of (1) is only a preferred algorithm, but not the only one, and in practical application, the algorithm can also be directly based on CiAnd MiCalculated without combining W obtained from the last calculationiOr may be calculated in combination with other parameters, such as bandwidth, etc., and the specific embodiment of the present invention is not limited thereto.
The virtual machine scheduling method provided in this embodiment is described below by taking two scenarios, namely, deploying a newly applied virtual machine to a suitable host node and scheduling a migration virtual machine when the Openstack cloud platform balances host resources.
Fig. 2 is a flowchart of a method for deploying a newly applied virtual machine to a suitable host node, and as shown in fig. 2, in this embodiment, deploying a newly applied virtual machine to a suitable host node may mainly include the following steps:
step S201, a user applies for a new virtual machine on an Openstack cloud platform; in specific application, a user can apply for a new virtual machine from an Openstack cloud platform through an Openstack cloud platform client.
Step S202, a scheduling module of the Openstack cloud platform obtains the average CPU utilization rate and the average memory utilization rate of each host node in the last hour from a monitoring module of the Openstack cloud platform.
Step S203, a scheduling module of the Openstack cloud platform calculates a weight value W of each host node by using a host available resource measurement modeli
Step S204, the scheduling module of the Openstack cloud platform selects WiAnd generating a new virtual machine on the host machine node with the maximum value.
In the above process, the measurement model of the available resources of the host is applied to the process of applying for the virtual machine by the OpenStack cloud platform, and the cloud platform can carry out more reasonable scheduling on the resources and more reasonable distribution on the resources of the whole cloud platform when the cloud platform is scheduled to apply for the virtual machine through the model.
Fig. 3 is a flowchart of a method for starting a load balancing live migration mechanism when a host in an OpenStack cloud platform is overloaded, as shown in fig. 3, in this embodiment, the starting of the load balancing live migration mechanism when a host in the OpenStack cloud platform is overloaded mainly includes the following steps:
in step S301, the monitoring module of the OpenStack cloud platform monitors that a load of a host node a is too high, that is, monitors that the load of the host node a exceeds a preset threshold.
Step S302, the OpenStack cloud platform starts virtual machine live migration, and migrates the virtual machine from the host to other hosts with lower load.
Step S303, the monitoring module of the OpenStack cloud platform finds the virtual machine M that consumes the most CPU and memory on the host node a.
Step S304, a scheduling module of the OpenStack cloud platform calculates a deported host node A by using a measurement model of available resources of a hostWeight value W of each other host nodei
Step S305, selecting W by a scheduling module of the OpenStack cloud platformiThe host node B with the largest value.
Step S306, the OpenStack cloud platform performs live migration of the virtual machine M that consumes the most resources on the original host node a to the host node B.
Step S307, the monitoring module continues to monitor the host A, judges whether the load of the host node A exceeds the threshold value within 5 minutes, if so, returns to the step S303 to continue to migrate other virtual machines, otherwise, stops the thermal migration.
In the above process, the measurement model of the available resources of the host is applied to the load balancing mechanism of the OpenStack cloud platform, and the cloud platform can migrate the virtual machine with higher resource consumption to a proper host node through the measurement model, so that the resource consumption of each host node is more balanced, and the reliability of the cluster and the high efficiency of resource utilization are effectively improved.
In the virtual machine scheduling method provided by the embodiment of the invention, a measurement model of available resources of a host machine is firstly constructed, the model is different from an original evaluation algorithm of an OpenStack cloud platform, the average CPU utilization rate and the average memory utilization rate of the host machine node for nearly one hour are introduced as basic parameters, and different formulas are used for calculating the weight value of the available resources according to the CPU utilization rate in different threshold value ranges, so that the measurement model capable of reasonably evaluating the available resources of the host machine is obtained.
EXAMPLE III
The embodiment of the invention provides a virtual machine scheduling device based on a cloud platform, which can be used for implementing the virtual machine scheduling method based on the cloud platform in the first embodiment and the second embodiment.
Fig. 4 is a schematic structural diagram of virtual machine scheduling based on a cloud platform provided in this embodiment, and as shown in fig. 4, the apparatus mainly includes: a determination module 400 and a scheduling module 402. The following mainly describes functions of each module of the virtual machine scheduling apparatus based on the cloud platform provided in this embodiment, and reference may be made to the corresponding descriptions in the first and second embodiments for other matters.
In this embodiment, the determining module 400 is configured to, when determining whether a host node needs to be allocated to a virtual machine to be scheduled, trigger the scheduling module 402 if the determination is yes; the scheduling module 402 is configured to obtain an average CPU usage rate and an average memory usage rate of a plurality of host nodes of the cloud platform in a latest preset time period, count a weight value of a current available resource metric of each host node according to at least the average CPU usage rate and the average memory usage rate of each host node in a latest first preset time period, and allocate the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled.
In an optional implementation manner of the embodiment of the present invention, for each host node, the scheduling module 402 obtains a weight value W of a current available resource metric of the host node in the following manneri:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
Wherein, WiIs 1, CiIs the average CPU utilization rate, M, of the host node in the latest preset time periodiFor the average memory usage of the host node in the latest preset time period, a and b are rational numbers greater than 0, and the sum of a and b is 10 of 1nAnd n is an integer greater than or equal to 0. That is, in this alternative embodiment, according to the weight value of the available resource metric of the host node obtained by the last calculation, the average CPU utilization C of the host node in the latest preset time periodiAnd the average memory utilization rate M of the host node in the latest preset time periodiTo calculate a weight value for the current available resource metric for the host node.
In the above-described alternative embodiment, further,
when C is presenti<At 25%, a is 0.9 × 10n,b=0.1*10n
When the content is less than or equal to 25 percent, Ci<At 50%, a is 0.6 x 10n,b=0.4*10n
When the content is less than or equal to 50 percent, Ci<When 75%, a is 0.4 x 10n,b=0.6*10n
When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
In an optional implementation of the embodiment of the present invention, the determining module 400 determines that a host node needs to be allocated to the virtual machine to be scheduled according to the following: receiving a scheduling instruction for applying for a new virtual machine sent by a client, and determining that host machine nodes need to be allocated to the new virtual machine; the scheduling module 402 allocates the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled according to the following manner: and creating a new virtual machine for the client on the host node with the maximum weight value of the current available resource measurement.
In an optional implementation of the embodiment of the present invention, the determining module 400 determines that a host node needs to be allocated to the virtual machine to be scheduled, if: detecting that the load of a host node in the cloud platform exceeds a set threshold, and determining a virtual machine which consumes the most CPU and the most memory on the host node with the load exceeding the set threshold as a virtual machine to be scheduled; the scheduling module 402 allocates the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled by the following method: and hot-migrating the virtual machine which consumes the most CPU and the most memory from the host machine node with the load exceeding a set threshold value to the host machine node with the maximum weight value of the current available resource measurement.
In the above optional embodiment, the determining module 400 is further configured to, after the scheduling module 402 allocates the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled, continue to monitor the host node whose load exceeds the set threshold, and determine whether the load of the host node whose load exceeds the set threshold exceeds the threshold in a second preset time period; under the condition that the load of the host node with the load exceeding the set threshold value in a second preset time period is judged to exceed the threshold value, the virtual machine with the load exceeding the set threshold value and consuming the most CPU and the most memory at the host node is determined to be the virtual machine to be scheduled, and the scheduling module 402 is triggered.
According to the virtual machine scheduling device based on the cloud platform, the available resource measurement model of the host node is constructed by combining the average memory utilization rate and the average CPU utilization rate of the host node, and the virtual machine scheduling in the cloud platform is executed based on the model.
Example four
In this embodiment, the determining module 400 in the virtual machine scheduling apparatus based on the cloud platform may include a monitoring module in the cloud platform, and specific functions may refer to the description of the virtual machine scheduling apparatus based on the cloud platform, which is not described herein again.
By adopting the cloud platform of the embodiment, the available resource measurement model of the host node is constructed by combining the average memory utilization rate and the average CPU utilization rate of the host node, and the virtual machine scheduling in the cloud platform is executed based on the model.

Claims (11)

1. A virtual machine scheduling method based on a cloud platform is characterized by comprising the following steps:
step 1, determining that host machine nodes need to be distributed to a virtual machine to be scheduled;
step 2, obtaining the average CPU utilization rate and the average memory utilization rate of a plurality of host nodes of the cloud platform in the latest preset time period;
step 3, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period;
for each host node, acquiring the weight value of the current available resource measurement of the host node in the following manner iW:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
Wherein, WiIs 1, CiThe average CPU utilization rate, M, of the host node in the latest first preset time periodiThe average memory usage rate of the host node in the last first preset time period is 10, a and b are rational numbers larger than 0, and the sum of a and b is 1nMultiple, n is an integer greater than or equal to 0;
and 4, distributing the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled.
2. The method of claim 1,
when C is presentiIf < 25%, a is 0.9 x 10n,b=0.1*10n
When the content is less than or equal to 25 percent, CiIf < 50%, a is 0.6 x 10n,b=0.4*10n
When the content is less than or equal to 50 percent, CiIf < 75%, a is 0.4 x 10n,b=0.6*10n
When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
3. The method according to any one of claims 1 to 2,
determining that a host node needs to be allocated to a virtual machine to be scheduled, including: receiving a scheduling instruction for applying for a new virtual machine sent by a client, and determining that host machine nodes need to be allocated to the new virtual machine;
allocating the host node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled, wherein the allocation method comprises the following steps: and creating a new virtual machine for the client on the host node with the maximum weight value of the current available resource measurement.
4. The method according to any one of claims 1 to 2,
determining that a host node needs to be allocated to a virtual machine to be scheduled, including: monitoring that the load of a host node in the cloud platform exceeds a set threshold, and determining the virtual machine which consumes the most CPU and the most memory on the host node with the load exceeding the set threshold as the virtual machine to be scheduled;
allocating the host node with the largest weight value of the current available resource measurement to the virtual machine to be scheduled, wherein the allocation method comprises the following steps: and hot-migrating the virtual machine which consumes the most CPU and the most memory from the host machine node with the load exceeding a set threshold value to the host machine node with the maximum weight value of the current available resource measurement.
5. The method according to claim 4, wherein after assigning the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled, the method further comprises:
continuously monitoring host nodes with the loads exceeding a set threshold value, and judging whether the loads of the host nodes with the loads exceeding the set threshold value exceed the threshold value within a second preset time period;
under the condition that the load of the host node with the load exceeding the set threshold value in a second preset time period is judged to exceed the threshold value, acquiring the virtual machine which consumes the CPU and the memory most at the current host node with the load exceeding the set threshold value, determining the virtual machine which consumes the CPU and the memory most as the virtual machine to be dispatched, and returning to the step 1;
and under the condition that the load of the host machine node with the load exceeding the set threshold value in a second preset time period is judged not to exceed the threshold value, ending the process.
6. The utility model provides a virtual machine scheduling device based on cloud platform which characterized in that includes:
the determining module is used for determining whether host machine nodes need to be distributed for the virtual machine to be scheduled or not, and triggering the scheduling module if the host machine nodes need to be distributed for the virtual machine to be scheduled;
the scheduling module is used for acquiring the average CPU utilization rate and the average memory utilization rate of a plurality of host machine nodes of the cloud platform in the latest preset time period, counting the weight value of the current available resource measurement of each host machine node at least according to the average CPU utilization rate and the average memory utilization rate of each host machine node in the latest first preset time period, and distributing the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled;
for each host node, the scheduling module obtains the weight of the current available resource measurement of the host node according to the following mode iWeight value W:
Wi=Wi*(1-Ci)*a+(1-Mi)*b
wherein, WiIs 1, CiIs the average CPU utilization rate, M, of the host node in the latest preset time periodiFor the average memory usage of the host node in the latest preset time period, a and b are rational numbers greater than 0, and the sum of a and b is 10 of 1nAnd n is an integer greater than or equal to 0.
7. The apparatus of claim 6,
when C is presentiIf < 25%, a is 0.9 x 10n,b=0.1*10n
When the content is less than or equal to 25 percent, CiIf < 50%, a is 0.6 x 10n,b=0.4*10n
When the content is less than or equal to 50 percent, CiIf < 75%, a is 0.4 x 10n,b=0.6*10n
When C is presentiWhen the content is more than or equal to 75 percent, a is 0.1 x 10n,b=0.9*10n
8. The apparatus according to any one of claims 6 to 7,
the determining module determines that host machine nodes are required to be allocated to the virtual machine to be scheduled according to the following steps: receiving a scheduling instruction for applying for a new virtual machine sent by a client, and determining that host machine nodes need to be allocated to the new virtual machine;
the scheduling module allocates the host node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled according to the following modes: and creating a new virtual machine for the client on the host node with the maximum weight value of the current available resource measurement.
9. The apparatus according to any one of claims 6 to 7,
the determining module determines that a host node needs to be allocated to the virtual machine to be scheduled under the following conditions: detecting that the load of a host node in the cloud platform exceeds a set threshold, and determining a virtual machine which consumes the most CPU and the most memory on the host node with the load exceeding the set threshold as a virtual machine to be scheduled;
the scheduling module allocates the host machine node with the maximum weight value of the current available resource measurement to the virtual machine to be scheduled in the following mode: and hot-migrating the virtual machine which consumes the most CPU and the most memory from the host machine node with the load exceeding a set threshold value to the host machine node with the maximum weight value of the current available resource measurement.
10. The apparatus according to claim 9, wherein the determining module is further configured to continue to monitor the host node whose load exceeds a set threshold after the scheduling module assigns the host node with the largest weight value of the current available resource metric to the virtual machine to be scheduled, and determine whether the load of the host node whose load exceeds the set threshold exceeds the threshold in a second preset time period; under the condition that the load of the host machine node with the load exceeding the set threshold value in a second preset time period is judged to exceed the threshold value, the virtual machine which consumes the CPU and the memory most at present on the host machine node with the load exceeding the set threshold value is determined as the virtual machine to be scheduled, and the scheduling module is triggered.
11. A cloud platform comprising the apparatus of any one of claims 6 to 10.
CN201711417505.8A 2017-12-25 2017-12-25 Cloud platform, and virtual machine scheduling method and device based on cloud platform Active CN109960565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711417505.8A CN109960565B (en) 2017-12-25 2017-12-25 Cloud platform, and virtual machine scheduling method and device based on cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711417505.8A CN109960565B (en) 2017-12-25 2017-12-25 Cloud platform, and virtual machine scheduling method and device based on cloud platform

Publications (2)

Publication Number Publication Date
CN109960565A CN109960565A (en) 2019-07-02
CN109960565B true CN109960565B (en) 2021-06-04

Family

ID=67020581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711417505.8A Active CN109960565B (en) 2017-12-25 2017-12-25 Cloud platform, and virtual machine scheduling method and device based on cloud platform

Country Status (1)

Country Link
CN (1) CN109960565B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432012A (en) * 2020-03-30 2020-07-17 浙江每日互动网络科技股份有限公司 Asynchronous communication method, device, system, terminal and computer readable storage medium
CN111767150A (en) * 2020-07-02 2020-10-13 中国铁建重工集团股份有限公司 Dynamic adjustment method for vGPU resources

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577727A (en) * 2014-10-16 2016-05-11 南京瀚和软件技术有限公司 Cloud-computing virtual machine management platform system
CN106020936A (en) * 2016-06-07 2016-10-12 深圳证券通信有限公司 Virtual machine dispatching method and device for financial cloud platform on basis of operating loads
CN106506701A (en) * 2016-12-28 2017-03-15 北京奇艺世纪科技有限公司 A kind of server load balancing method and load equalizer
CN106528270A (en) * 2016-11-16 2017-03-22 航天信息股份有限公司 Automatic migration method and system of virtual machine based on OpenStack cloud platform
CN106970831A (en) * 2017-05-15 2017-07-21 金航数码科技有限责任公司 The resources of virtual machine dynamic scheduling system and method for a kind of facing cloud platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5624084B2 (en) * 2012-06-04 2014-11-12 株式会社日立製作所 Computer, virtualization mechanism, and scheduling method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577727A (en) * 2014-10-16 2016-05-11 南京瀚和软件技术有限公司 Cloud-computing virtual machine management platform system
CN106020936A (en) * 2016-06-07 2016-10-12 深圳证券通信有限公司 Virtual machine dispatching method and device for financial cloud platform on basis of operating loads
CN106528270A (en) * 2016-11-16 2017-03-22 航天信息股份有限公司 Automatic migration method and system of virtual machine based on OpenStack cloud platform
CN106506701A (en) * 2016-12-28 2017-03-15 北京奇艺世纪科技有限公司 A kind of server load balancing method and load equalizer
CN106970831A (en) * 2017-05-15 2017-07-21 金航数码科技有限责任公司 The resources of virtual machine dynamic scheduling system and method for a kind of facing cloud platform

Also Published As

Publication number Publication date
CN109960565A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
Amini et al. A Dynamic SLA Aware Heuristic Solution For IaaS Cloud Placement Problem Without Migration
Pietri et al. Mapping virtual machines onto physical machines in cloud computing: A survey
Wood et al. Sandpiper: Black-box and gray-box resource management for virtual machines
Amini et al. A dynamic SLA aware solution for IaaS cloud placement problem using simulated annealing
Aslam et al. Load balancing algorithms in cloud computing: A survey of modern techniques
Fu et al. Virtual machine selection and placement for dynamic consolidation in Cloud computing environment
Frincu et al. Multi-objective meta-heuristics for scheduling applications with high availability requirements and cost constraints in multi-cloud environments
Liu et al. Enhancing energy-efficient and QoS dynamic virtual machine consolidation method in cloud environment
Bhatia et al. Htv dynamic load balancing algorithm for virtual machine instances in cloud
JP6881575B2 (en) Resource allocation systems, management equipment, methods and programs
US7467291B1 (en) System and method for calibrating headroom margin
US20160156567A1 (en) Allocation method of a computer resource and computer system
WO2016176060A1 (en) Balancing resources in distributed computing environments
KR101941282B1 (en) Method of allocating a virtual machine for virtual desktop service
KR20120063499A (en) Dynamic load balancing and scaling of allocated cloud resources in an enterprise network
JP2013171582A (en) Method for increasing number of configuration of virtual machine for server
Mosa et al. Virtual machine consolidation for cloud data centers using parameter-based adaptive allocation
Kaur et al. Efficient and enhanced load balancing algorithms in cloud computing
WO2013082742A1 (en) Resource scheduling method, device and system
CN103488538B (en) Application extension device and application extension method in cloud computing system
Tighe et al. Topology and application aware dynamic vm management in the cloud
Yang et al. Heuristic scheduling algorithms for allocation of virtualized network and computing resources
CN109960565B (en) Cloud platform, and virtual machine scheduling method and device based on cloud platform
Hanafy et al. A new infrastructure elasticity control algorithm for containerized cloud
Shalu et al. Artificial neural network-based virtual machine allocation in cloud computing

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