CN110471769B - Resource management method and device for virtual machine - Google Patents

Resource management method and device for virtual machine Download PDF

Info

Publication number
CN110471769B
CN110471769B CN201910748477.0A CN201910748477A CN110471769B CN 110471769 B CN110471769 B CN 110471769B CN 201910748477 A CN201910748477 A CN 201910748477A CN 110471769 B CN110471769 B CN 110471769B
Authority
CN
China
Prior art keywords
virtual machine
state
information
judgment
processing
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
CN201910748477.0A
Other languages
Chinese (zh)
Other versions
CN110471769A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910748477.0A priority Critical patent/CN110471769B/en
Publication of CN110471769A publication Critical patent/CN110471769A/en
Application granted granted Critical
Publication of CN110471769B publication Critical patent/CN110471769B/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/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

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 invention provides a resource management method and a device of a virtual machine, wherein the method comprises the following steps: acquiring basic information of each virtual machine periodically; obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset; obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset; and performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine. The device is used for executing the method. The resource management method and the device for the virtual machine improve the resource allocation efficiency of the virtual machine.

Description

Resource management method and device for virtual machine
Technical Field
The invention relates to the technical field of computers, in particular to a resource management method and device of a virtual machine.
Background
With the advent of the internet era, the load capacity of virtual machines on a virtualization platform has increased greatly compared to the past, and the management pressure of the virtualization platform has also increased day by day.
In the prior art, monitoring and early warning of a virtual machine can be realized through a centralized management monitoring product, namely, vrolize Operations Manager (vROps), of a virtualization platform of VMware, so that operation and maintenance personnel can find and solve potential risk problems in advance, for example: the intelligent virtual machine early warning system can give an early warning to busy virtual machines, remind operation and maintenance personnel of expanding the capacity of resources, give an alarm to idle virtual machines, remind the operation and maintenance personnel of recycling the resources, and is very necessary and practical. However, in the actual use process, it is found that there are many problems, which results in the failure to effectively achieve the purpose of managing virtualized resources, such as: the alarm information is too much and cannot be processed automatically, the false alarm rate of the idle virtual machine is too high and cannot be recovered after being recovered, and the like. The reason for the above problems is that the centralized management monitoring product in the prior art is evaluated only by using performance data as an index, the evaluation method is single, a large amount of alarm information is generated and is processed by operation and maintenance personnel, and the processing efficiency is low.
Therefore, how to provide a resource management method for a virtual machine, which can effectively and dynamically manage the resources of the virtual machine, and improve the resource allocation efficiency of the virtual machine becomes an important issue to be solved in the field.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for resource management of a virtual machine.
In one aspect, the present invention provides a method for resource management of a virtual machine, including:
acquiring basic information of each virtual machine periodically;
obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset;
obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset;
and performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
In another aspect, the present invention provides a resource management apparatus for a virtual machine, including:
the information acquisition unit is used for periodically acquiring the basic information of each virtual machine;
a first state obtaining unit, configured to obtain a first state of each virtual machine according to basic information of each virtual machine and a first determination rule; wherein the first judgment rule is preset;
a second state obtaining unit, configured to obtain a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset;
and the allocation processing unit is used for performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
In another aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for resource management of a virtual machine according to any one of the above embodiments.
In yet another aspect, the present invention 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 resource management method of a virtual machine according to any one of the above embodiments.
The method and the device for managing the resources of the virtual machines, provided by the embodiments of the present invention, can periodically obtain the basic information of each virtual machine, then obtain the first state of each virtual machine according to the basic information and the first determination rule of each virtual machine, then obtain the second state of each virtual machine according to the second state determination information and the second determination rule of each virtual machine, and then perform resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine, so that the resources of each virtual machine can be automatically managed, and the resource allocation efficiency of the virtual machines is improved.
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 of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a flowchart illustrating a resource management method for a virtual machine according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a resource management method for a virtual machine according to another embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a resource management apparatus of a virtual machine according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a resource management apparatus of a virtual machine according to another embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a resource management apparatus of a virtual machine according to still another embodiment of the present invention.
Fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a schematic flowchart of a resource management method for a virtual machine according to an embodiment of the present invention, and as shown in fig. 1, the resource management method for a virtual machine according to the embodiment of the present invention includes:
s101, periodically acquiring basic information of each virtual machine;
specifically, the server may periodically obtain basic information of each virtual machine, where the basic information includes, but is not limited to, a power state of the virtual machine, an IP address number, a CPU number, a Load Average of the CPU (Load Average), a free swap space of the memory (swapfee), an available memory (MemAvailable), an available space of the file system (Avail), and a free percentage of the file system (% util). The period is set according to actual needs, for example, the period is acquired every 5 seconds, and the embodiment of the present invention is not limited. The execution subject of the resource management method of the virtual machine provided by the embodiment of the invention includes but is not limited to a server.
For example, the server may periodically obtain basic information of each virtual machine through a VMware or openstack api interface.
S102, obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first state judgment rule; wherein the first state judgment rule is preset;
specifically, after obtaining the basic information of each virtual machine, the server may obtain the first state of each virtual machine according to the basic information of each virtual machine and the first state judgment rule. Wherein the first state comprises busy, normal or idle. The first state judgment rule is preset and is set according to an actual experience piece, and the embodiment of the invention is not limited.
For example, the basic information of the virtual machine includes the number of CPUs, the average load of the CPUs, the free swap space of the memory, the available memory, the total memory, the available space of the file system, and the free percentage of the file system. Accordingly, the first state judgment rule includes: a first state judgment condition a, a first state judgment condition B, a first state judgment condition C, a first state judgment condition D, a first state judgment condition E, a first state judgment condition F, and a first state judgment condition G. Wherein the first state judgment condition a is: in one period, the time that the average load of the CPUs of the virtual machines is greater than the number of the CPUs of the virtual machines is greater than 20% of the total time of a single period; the first state judgment condition B is: the growth rate of the average value of the free exchange space of the memory of the virtual machine in one period relative to the average value of the free exchange space of the memory of the virtual machine in the last period is more than 10 percent; the first state judgment condition C is: the average value of the available space of the file system of the virtual machine in one period is less than 5 percent; the first state judgment condition D is: in one cycle, the time for the idle percentage of the file system of the virtual machine to reach 100% is greater than 80% of the total time of a single cycle; the first state judgment condition E is: the time that the average load of the CPUs of the virtual machine is more than half of the number of the CPUs of the virtual machine in one period is more than 50% of the total time of a single period; the first state judgment condition F is: in one cycle, the average value of the available memory of the virtual machine is less than 50% of the total memory of the virtual machine; the first state judgment condition G is: the average of the free percentage of the file system of the virtual machine is greater than 30% during a cycle. Wherein, the single period is set according to actual needs, for example, 7 days, and the embodiment of the present invention is not limited.
The server can obtain the average load and the number of the CPUs of the virtual machine every 5 seconds in a single period, then the time a when the average load of the CPUs of the virtual machine in the single period is larger than the number of the CPUs of the virtual machine is obtained through statistics, if the time a is larger than 20% of the total time of the single period, the virtual machine meets a first state judgment condition A, and if not, the virtual machine does not meet the first state judgment condition A.
The server may obtain an idle exchange space of the memory of the virtual machine every 5 seconds in a single period, then calculate an average value of the idle exchange spaces of the memory of the virtual machine in the single period according to the idle exchange space of the memory of the virtual machine every 5 seconds in the single period, and then calculate an increase rate B of the average value of the idle exchange spaces of the memory of the virtual machine in the single period relative to the average value of the idle exchange spaces of the memory of the virtual machine in the previous period, where if the increase rate B is greater than 10%, the virtual machine satisfies a first state judgment condition B, and otherwise, the virtual machine does not satisfy the first state judgment condition B.
The server can obtain the available space of the file system of the virtual machine every 5 seconds in a single period, then calculate and obtain the average value C of the available space of the file system of the memory of the virtual machine in the single period according to the available space of the file system of the virtual machine every 5 seconds in the single period, if the average value C is less than 5%, the virtual machine meets a first state judgment condition C, otherwise, the virtual machine does not meet the first state judgment condition C.
The server can obtain the idle percentage of the file system of the virtual machine every 5 seconds in a single period, then the time D when the idle percentage of the file system of the virtual machine reaches 100% in the single period is obtained through statistics, if the time D is larger than 80% of the total time of the single period, the virtual machine meets a first state judgment condition D, and if not, the virtual machine does not meet the first state judgment condition D.
The server can obtain the average load of the CPUs of the virtual machines and half of the number of the CPUs in each 5 seconds in a single period, then, the time E when the average load of the CPUs of the virtual machines in the single period is larger than half of the number of the CPUs of the virtual machines is obtained through statistics, if the time E is larger than 50% of the total time of the single period, the virtual machines meet a first state judgment condition E, and if not, the virtual machines do not meet the first state judgment condition E.
The server can obtain the available memory and the total memory of the virtual machine every 5 seconds in a single period, then the average value F of the available memory of the virtual machine in the single period is obtained through calculation according to the available memory of the virtual machine every 5 seconds in the single period, if the average value F is smaller than 50% of the total memory of the virtual machine, the virtual machine meets a first state judgment condition F, and if not, the virtual machine does not meet the first state judgment condition F.
The server can obtain the idle percentage of the file system of the virtual machine every 5 seconds in a single period, then calculate and obtain the average value G of the idle percentage of the file system of the virtual machine in the single period according to the idle percentage of the file system of the virtual machine every 5 seconds in the single period, if the average value G is more than 30%, the virtual machine meets a first state judgment condition G, otherwise, the virtual machine does not meet the first state judgment condition G.
If the virtual machine meets a first state judgment condition A, a first state judgment condition B, a first state judgment condition C or a first state judgment condition D, the first state of the virtual machine is busy; if the virtual machine meets a first state judgment condition E, a first state judgment condition F or a first state judgment condition G, the first state of the virtual machine is normal; and if the virtual machine does not meet the first state judgment condition A, the first state judgment condition B, the first state judgment condition C, the first state judgment condition D, the first state judgment condition E, the first state judgment condition F and the first state judgment condition G, the first state of the virtual machine is idle.
S103, obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset;
specifically, the server may obtain second state judgment information of each virtual machine, and then obtain the second state of each virtual machine according to the second state judgment information and the second state judgment rule. The second state judgment information may include at least one type of information among the first type of judgment information of the virtual machine, the second type of judgment information of the virtual machine, and the third type of judgment information of the virtual machine, where each type of judgment information is set according to actual experience, and the embodiment of the present invention is not limited. The second state may include both active and inactive states. The second state judgment rule is preset and is set according to actual experience, and the embodiment of the present invention is not limited. The specific process for obtaining the second state of each virtual machine is described below, and is not described herein again.
And S104, performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
Specifically, after obtaining the first state and the second state of each virtual machine, the server may perform resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine, where the resource allocation processing may include resource allocation up processing, resource allocation down processing, and resource recovery processing on the virtual machine.
For example, when the first state of the virtual machine is idle and the second state is active, the resource reallocation process may be performed on the virtual machine. When the first state of the virtual machine is idle and the second state of the virtual machine is not in use, resource recovery processing can be performed on the virtual machine.
According to the resource management method for the virtual machines provided by the embodiment of the invention, the basic information of each virtual machine is regularly acquired, the first state of each virtual machine is acquired according to the basic information and the first judgment rule of each virtual machine, the second state of each virtual machine is acquired according to the second state judgment information and the second judgment rule of each virtual machine, and then the resource allocation processing is performed on each virtual machine according to the first state and the second state of each virtual machine, so that the resource of each virtual machine can be automatically managed, and the resource allocation efficiency of the virtual machines is improved. In addition, different states of the virtual machine are obtained by using the basic information and the second state judgment information of the virtual machine, and the resources of the virtual machine are allocated based on the information of different dimensions of the virtual machine, so that the resource allocation accuracy of the virtual machine is improved.
On the basis of the foregoing embodiments, further, the second state judgment information includes at least one type of information among first type judgment information, second type judgment information, and third type judgment information of the virtual machine; correspondingly, the obtaining the second state of each virtual machine according to the second state judgment information and the second judgment rule of each virtual machine includes:
and acquiring a second state of the virtual machine according to at least one type of information of the first type judgment information, the second type judgment information and the third type judgment information of the virtual machine and a corresponding second state judgment rule.
Specifically, the second state judgment information may include at least one of the first type judgment information of the virtual machine, the second type judgment information of the virtual machine, and the third type judgment information of the virtual machine. The first type of judgment information of the virtual machine may include parameter information such as a user usage rate of the virtual machine, an available memory, a number/second of IO reads of a file system, a number/second of IO writes of the file system, a number/s of MB reads of the file system, and a number/s of MB writes of the file system. The second type of judgment information of the virtual machine may include operating system login information, a user operation log, a system log, and an application log of the virtual machine. The third type judgment information of the virtual machine may include application version installation information of the virtual machine, that is, an application version of each application installed on the virtual machine. Wherein, each type of judgment information is set according to actual experience, and the embodiment of the invention is not limited. After the server obtains at least one type of information of the first type of judgment information of the virtual machine, the second type of judgment information of the virtual machine and the third type of judgment information of the virtual machine, the server obtains the second state of each virtual machine according to the at least one type of information and the corresponding second state judgment rule.
For example, the server may obtain the first type of determination information as the second state determination information, where the first type of determination information of the virtual machine includes a user usage rate of the virtual machine, an available memory, a number of IO reads/sec of a file system, a number of IO writes/sec of the file system, a number of MB reads/s of the file system, and a number of MB writes/s of the file system. The first type of judgment information may be acquired periodically, for example, every 5 seconds. The second state judgment rule corresponding to the first type judgment information is as follows: in one period, the user utilization rate of the virtual machine, the available memory, the read IO times/second of the file system, the write IO times/second of the file system, the read MB/s of the file system or the write MB/s of the file system have obvious fluctuation. The existence of the significant fluctuation is set according to practical experience, and the embodiment of the invention is not limited. The significant fluctuation may mean that the number of times that one parameter information included in the first type of judgment information exceeds the corresponding fluctuation range in a single period is greater than m, where m is set according to practical experience, for example, 20% of the total collection number in the single period. The fluctuation range is preset and is set according to practical experience, and the embodiment of the invention is not limited.
For the user usage rate of the virtual machine, the server may statistically obtain a total number of acquisition times N in a single period, and if the single period is 7 days and the user usage rate of the virtual machine is acquired every 5 seconds, the total number of acquisition times N for acquiring the user usage rate of the virtual machine in 7 days is 120960 times. And comparing the user utilization rate of the virtual machine acquired each time with the corresponding fluctuation range, wherein if the user utilization rates of N virtual machines in the user utilization rates of the virtual machines acquired N times exceed the corresponding fluctuation range and N is greater than m, the second state of the virtual machine is in use. The fluctuation range of the user utilization rate of the virtual machine can be determined according to an average value p of the user utilization rate of the virtual machine in a single period, the average value of the user utilization rate of the virtual machine in the single period is calculated, namely the user utilization rates of the N virtual machines are averaged, p (1+ 10%) can be used as an upper limit value when the user utilization rate of the virtual machine exceeds the corresponding fluctuation range, and p (1-10%) can be used as a lower limit value when the user utilization rate of the virtual machine exceeds the corresponding fluctuation range.
For the available memory of the virtual machine, the number of IO reads/second of the file system, the number of IO writes/second of the file system, the number of MB/s reads of the file system, or the MB/s writes of the file system, the specific process for determining the second state of the virtual machine is similar to the determination process for determining the second state of the virtual machine according to the user utilization rate of the virtual machine, and details are not repeated here.
If any parameter information in the first type judgment information of the virtual machine meets the corresponding second state judgment rule, the second state of the virtual machine is in use; and if all the parameter information in the first type judgment information of the virtual machine does not meet the corresponding second state judgment rule, the second state of the virtual machine is not used.
The server may obtain the second type determination information as the second state determination information, where the second type determination information of the virtual machine includes at least one of operating system login information, a user operation log, a system log, and an application log of the virtual machine. The second state judgment rule corresponding to the second type judgment information may include at least one judgment condition of judgment condition 1, judgment condition 2, judgment condition 3, and judgment condition 4. The judgment condition 1 includes: in a single cycle, there is login information in the operating system login information of the virtual machine. Wherein the login information can be output by using last command. The judgment condition 2 includes: in a single period, the new execution command exists in the bash _ history file of the user operation log of the virtual machine. The judgment condition 3 includes: in a single period, the messages file of the system log of the virtual machine has log of login or transmission information of ftp, ssh and sftp. The judgment condition 4 includes: log files of application logs of the virtual machines have application login information in a single period.
In a single period, if login information exists in the operating system login information of the virtual machine, and the operating system login information of the virtual machine meets a judgment condition 1, the virtual machine meets a second state judgment rule corresponding to the second type of judgment information, and the second state of the virtual machine is in use; in a single period, if a newly added execution command exists in a bash _ history file of a user operation log of the virtual machine, and the user operation log of the virtual machine meets a judgment condition 2, the virtual machine meets a second state judgment rule corresponding to the second type of judgment information, and the second state of the virtual machine is in use; in a single period, if a message file of a system log of a virtual machine has an ftp, ssh, sftp log, and the system log of the virtual machine satisfies a judgment condition 3, the virtual machine satisfies a second state judgment rule corresponding to the second type of judgment information, and the second state of the virtual machine is in use; in a single period, if application login information exists in a systemeout log file of an application log of a virtual machine, and the application log of the virtual machine meets a judgment condition 4, the virtual machine meets a second state judgment rule corresponding to the second type of judgment information, and the second state of the virtual machine is in use. That is, any information in the second type judgment information of the virtual machine satisfies any judgment condition in the second state judgment rule corresponding to the second type judgment information, the virtual machine satisfies the second state judgment rule corresponding to the second type judgment information, and the second state of the virtual machine is in use. Otherwise, the state of the virtual machine is not used.
The server may obtain the third type determination information as the second state determination information, where the third type determination information of the virtual machine includes application version installation information of the virtual machine, and the application version installation information may include version installation information of one application or version installation information of multiple applications. The second state judgment rule corresponding to the third type judgment information may include: in one period, the version installation information of any application of the virtual machine comprises that the application version is not lower than the corresponding preset application version. Comparing the application version of each application of the virtual machine with the corresponding preset application version, and if the application versions of all the applications are not lower than the corresponding preset application versions, the virtual machine satisfies a second state judgment rule corresponding to the third type judgment information, and the second state of the virtual machine is in use. And if the application version of one application is lower than the corresponding application version in the virtual machine, the virtual machine does not meet a second state judgment rule corresponding to the third type judgment information, and the second state of the virtual machine is not used.
The server may obtain the first type judgment information and the second type judgment information as the second state judgment information, and the second state judgment rule corresponding to the first type judgment information and the second type judgment information includes a second state judgment rule corresponding to the first type judgment information and a second state judgment rule corresponding to the second type judgment information. If the virtual machine meets a second state judgment rule corresponding to the first type judgment information or the virtual machine meets a second state judgment rule corresponding to the second type judgment information, the second state of the virtual machine is in use; and if the virtual machine does not meet the second state judgment rule corresponding to the first type judgment information and the virtual machine does not meet the second state judgment rule corresponding to the second type judgment information, the second state of the virtual machine is not used.
The server may obtain the second type judgment information and the third type judgment information as the second state judgment information, and the second state judgment rule corresponding to the second type judgment information and the third type judgment information includes a second state judgment rule corresponding to the second type judgment information and a second state judgment rule corresponding to the third type judgment information. If the virtual machine meets a second state judgment rule corresponding to the second type judgment information or the virtual machine meets a second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is in use; and if the virtual machine does not meet the second state judgment rule corresponding to the second type judgment information and the virtual machine does not meet the second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is not used.
The server may obtain the first type judgment information and the third type judgment information as the second state judgment information, and the second state judgment rule corresponding to the first type judgment information and the third type judgment information includes a second state judgment rule corresponding to the first type judgment information and a second state judgment rule corresponding to the third type judgment information. If the virtual machine meets a second state judgment rule corresponding to the first type judgment information or the virtual machine meets a second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is in use; and if the virtual machine does not meet the second state judgment rule corresponding to the first type judgment information and the virtual machine does not meet the second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is not used.
The server may obtain the first type judgment information, the second type judgment information, and the third type judgment information as the second state judgment information, and the second state judgment rule corresponding to the first type judgment information, the second type judgment information, and the third type judgment information includes a second state judgment rule corresponding to the first type judgment information, a second state judgment rule corresponding to the second type judgment information, and a second state judgment rule corresponding to the third type judgment information. If the virtual machine meets a second state judgment rule corresponding to the first type judgment information, the virtual machine meets the second state judgment rule corresponding to the second type judgment information or the virtual machine meets the second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is in use; and if the virtual machine does not meet the second state judgment rule corresponding to the first type judgment information, the virtual machine does not meet the second state judgment rule corresponding to the second type judgment information, and the virtual machine does not meet the second state judgment rule corresponding to the third type judgment information, the second state of the virtual machine is not used.
On the basis of the foregoing embodiments, further, the performing, according to the first state and the second state of each virtual machine, resource allocation processing on each virtual machine includes:
and if the first state of the virtual machine is idle and the second state of the virtual machine is in use, performing resource allocation reduction processing on the virtual machine.
Specifically, after determining that the first state of the virtual machine is idle and the second state is in use, the server may perform resource reallocation processing on the virtual machine, that is, reduce resources of the virtual machine, which indicates that the use frequency of the virtual machine is low. It can be understood that, before the resource upgrade processing is performed on the virtual machine, the resource downgrade processing confirmation information may be sent to the user of the virtual machine, and after the user agrees to perform the resource downgoing processing on the virtual machine, the user may also select the time for performing the resource downgoing processing; after the resource allocation reduction processing is carried out on the virtual machine, the result of the resource allocation reduction processing can be sent to a user of the virtual machine, so that the user can know the resource allocation change condition of the virtual machine in time.
For example, the resource allocation reduction process may be preset as follows: one CPU and two standard memories are reduced. And when the first state of the virtual machine is idle and the second state of the virtual machine is in use, reducing one CPU and two standard memories of the virtual machine. The standard memory is set according to actual needs, and the embodiment of the invention is not limited.
On the basis of the foregoing embodiments, further, the performing, according to the first state and the second state of each virtual machine, resource allocation processing on each virtual machine includes:
and if the first state of the virtual machine is idle and the second state of the virtual machine is not in use, performing application closing processing on the virtual machine, and performing resource recycling processing on the virtual machine after the first state of the virtual machine is idle and the second state of the virtual machine is not in use is judged and obtained next time.
Specifically, after determining that the first state of the virtual machine is idle and the second state is not in use, the server performs application shutdown processing on the virtual machine, that is, shuts down all applications on the virtual machine. The server periodically manages the resources of the virtual machine, the server also obtains a first state and a second state of the virtual machine in the next period, and if the first state of the virtual machine is idle and the second state of the virtual machine is not used, the server performs resource recycling processing on the virtual machine, namely deletes the virtual machine. When the resource recovery processing is performed on the virtual machine, the virtual machine may wait for a period of time, for example, wait for 30 days, so as to avoid that the virtual machine is deleted by mistake due to misjudgment of the server and cannot be recovered.
On the basis of the foregoing embodiments, further, the method for resource management of a virtual machine according to an embodiment of the present invention further includes:
and if the first state of the virtual machine is judged to be busy, performing resource allocation increasing processing on the virtual machine.
Specifically, after judging that the first state of the virtual machine is busy, the server performs resource allocation increasing processing on the virtual machine, that is, increases resources of the virtual machine. The first state of the virtual machine is busy, which indicates that the resources of the virtual machine are in shortage, and more resources need to be allocated to the virtual machine to improve the operating efficiency of the virtual machine. Before resource upgrading and allocating processing is carried out on the virtual machine, resource upgrading and allocating processing confirmation information can be sent to a user of the virtual machine, after the user agrees, the virtual machine is subjected to resource upgrading and allocating processing, and the user can select the time for carrying out the resource upgrading and allocating processing; after the resource upgrading and allocating processing is carried out on the virtual machine, the result of the resource upgrading and allocating processing can be sent to a user of the virtual machine, so that the user can know the resource allocation change condition of the virtual machine in time. It can be understood that, if the first state of the virtual machine is normal, it indicates that the current resources of the virtual machine can meet the operation requirement of the virtual machine, and the resource allocation processing is not required to be performed on the virtual machine.
For example, the resource upgrade process may be preset as follows: one CPU and two standard memories are added. And when the first state of the virtual machine is busy, adding a CPU and two standard memories for the virtual machine. The standard memory is set according to actual needs, and the embodiment of the invention is not limited.
Fig. 2 is a schematic flowchart of a resource management method of a virtual machine according to another embodiment of the present invention, and as shown in fig. 2, on the basis of the foregoing embodiments, further, the resource management method of a virtual machine according to the embodiment of the present invention further includes:
s201, obtaining the shutdown days of each virtual machine according to the power state of each virtual machine within the preset days; wherein the basic information of each virtual machine comprises a power state;
specifically, the server may obtain a power state of each virtual machine within a preset number of days, determine whether the virtual machine is in a shutdown state or a startup state each day according to the power state of each virtual machine within the preset number of days, and if the power state obtained by the virtual machine each time within one day is power off, the virtual machine is in the shutdown state, otherwise, the virtual machine is in the startup state. The server can count the number of days that the virtual machines are in the shutdown state in the preset number of days, and obtain the number of shutdown days of each virtual machine. Wherein the basic information of each of the virtual machines includes a power state. The preset days are set according to actual needs, and the embodiment of the invention is not limited.
For example, the preset number of days is 15 days, the server may count the power state of the virtual machine in each day in 15 days, if the power state of the virtual machine obtained in each day is power off, the virtual machine is in a shutdown state, the server may count the number of days of the virtual machine in the shutdown state in 15 days, and if the number of days of the virtual machine is 9 days, the number of days of the virtual machine in the shutdown state is 9 days.
S202, if the number of days of shutdown of the virtual machine is judged to be larger than a preset value, performing resource recovery processing on the virtual machine.
Specifically, after obtaining the number of shutdown days of each virtual machine, the server compares the number of shutdown days of the virtual machine with a preset value, and if the number of shutdown days is greater than the preset value, the server performs resource recovery processing on the virtual machine. The virtual machine may be queried for an account before the resource recovery processing is performed on the virtual machine, and if the account has registration information of the virtual machine, resource recovery processing confirmation information may be sent to a user of the virtual machine, and the user may perform the resource recovery processing on the virtual machine after approval of the user or perform the resource recovery processing when the user does not respond within a set time. After the resource recovery processing is performed on the virtual machine, the result of the resource recovery processing is sent to the user of the virtual machine. If the virtual machine has no registration information on the standing book of the virtual machine, the resource recycling processing can be directly carried out. The preset value is set according to actual experience, and the embodiment of the invention is not limited. The registration information of the virtual machine includes, but is not limited to, communication information such as a user's mobile phone and a mailbox. The set time is, for example, 15 days, and is set according to practical experience, which is not limited in the embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a resource management apparatus of a virtual machine according to an embodiment of the present invention, and as shown in fig. 3, the resource management apparatus of a virtual machine according to the embodiment of the present invention includes an information obtaining unit 301, a first state obtaining unit 302, a second state obtaining unit 303, and a deployment processing unit 304, where:
the information acquisition unit 301 is configured to periodically acquire basic information of each virtual machine; the first state obtaining unit 302 is configured to obtain a first state of each virtual machine according to the basic information of each virtual machine and a first determination rule; wherein the first judgment rule is preset; the second state obtaining unit 303 is configured to obtain a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset; the allocation processing unit 304 is configured to perform resource allocation processing on each of the virtual machines according to the first state and the second state of each of the virtual machines.
Specifically, the information obtaining unit 301 may periodically obtain basic information of each virtual machine, where the basic information includes, but is not limited to, a power state of the virtual machine, the number of IP addresses, the number of CPUs, an average load of the CPUs, a free swap space of a memory, an available space of a file system, and a free percentage of the file system. The period is set according to actual needs, for example, the period is acquired every 5 seconds, and the embodiment of the present invention is not limited.
After obtaining the basic information of each of the virtual machines, the first state obtaining unit 302 may obtain the first state of each of the virtual machines according to the basic information of each of the virtual machines and the first state judgment rule. Wherein the first state comprises busy, normal or idle. The first state judgment rule is preset and is set according to an actual experience piece, and the embodiment of the invention is not limited.
The second state obtaining unit 303 may obtain second state judgment information of each of the virtual machines, and then obtain the second state of each of the virtual machines according to the second state judgment information and a second state judgment rule. The second state judgment information may include at least one type of information among the first type of judgment information of the virtual machine, the second type of judgment information of the virtual machine, and the third type of judgment information of the virtual machine, where each type of judgment information is set according to actual experience, and the embodiment of the present invention is not limited. The second state may include both active and inactive states. The second state judgment rule is preset and is set according to actual experience, and the embodiment of the present invention is not limited.
After obtaining the first state and the second state of each of the virtual machines, the allocating processing unit 304 may perform resource allocating processing on each of the virtual machines according to the first state and the second state of each of the virtual machines, where the resource allocating processing may include performing resource allocation increasing processing, resource allocation decreasing processing, and resource recycling processing on the virtual machines.
The resource management device for the virtual machines, provided by the embodiment of the present invention, periodically obtains the basic information of each virtual machine, then obtains the first state of each virtual machine according to the basic information and the first determination rule of each virtual machine, obtains the second state of each virtual machine according to the second state determination information and the second determination rule of each virtual machine, and then performs resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine, so that the resource of each virtual machine can be automatically managed, and the resource allocation efficiency of the virtual machines is improved. In addition, different states of the virtual machine are obtained by using the basic information and the second state judgment information of the virtual machine, and the resources of the virtual machine are allocated based on the information of different dimensions of the virtual machine, so that the resource allocation accuracy of the virtual machine is improved.
On the basis of the foregoing embodiments, further, the second state judgment information includes at least one type of information among first type judgment information, second type judgment information, and third type judgment information of the virtual machine; correspondingly, the second state obtaining unit 303 is specifically configured to:
and acquiring a second state of the virtual machine according to at least one type of information of the first type judgment information, the second type judgment information and the third type judgment information of the virtual machine and a corresponding second state judgment rule.
Specifically, the second state judgment information may include at least one of the first type judgment information of the virtual machine, the second type judgment information of the virtual machine, and the third type judgment information of the virtual machine. The first type of judgment information of the virtual machine may include parameter information such as a user usage rate of the virtual machine, an available memory, a number/second of IO reads of a file system, a number/second of IO writes of the file system, a number/s of MB reads of the file system, and a number/s of MB writes of the file system. The second type of judgment information of the virtual machine may include operating system login information, a user operation log, a system log, and an application log of the virtual machine. The third type judgment information of the virtual machine may include application version installation information of the virtual machine, that is, an application version of each application installed on the virtual machine. Wherein, each type of judgment information is set according to actual experience, and the embodiment of the invention is not limited. The second state obtaining unit 303 obtains at least one type of information among the first type of judgment information of the virtual machine, the second type of judgment information of the virtual machine, and the third type of judgment information of the virtual machine, and then obtains the second state of each virtual machine according to the at least one type of information and the corresponding second state judgment rule.
On the basis of the foregoing embodiments, further, the deployment processing unit 304 is specifically configured to:
and after judging and knowing that the first state of the virtual machine is idle and the second state is in use, performing resource allocation reduction processing on the virtual machine.
Specifically, after determining that the first state of the virtual machine is idle and the second state is in use, which indicates that the usage frequency of the virtual machine is low, the allocation processing unit 304 may perform resource allocation reduction processing on the virtual machine, that is, reduce the resources of the virtual machine. It can be understood that, before the resource upgrade processing is performed on the virtual machine, the resource downgrade processing confirmation information may be sent to the user of the virtual machine, and after the user agrees to perform the resource downgoing processing on the virtual machine, the user may also select the time for performing the resource downgoing processing; after the resource allocation reduction processing is carried out on the virtual machine, the result of the resource allocation reduction processing can be sent to a user of the virtual machine, so that the user can know the resource allocation change condition of the virtual machine in time.
On the basis of the foregoing embodiments, further, the deployment processing unit 304 is specifically configured to:
and after judging that the first state of the virtual machine is idle and the second state of the virtual machine is not in use, carrying out application closing processing on the virtual machine, and carrying out resource recycling processing on the virtual machine after judging that the first state of the virtual machine is idle and the second state of the virtual machine is not in use next time.
Specifically, after determining that the first state of the virtual machine is idle and the second state is not in use, the deployment processing unit 304 performs application shutdown processing on the virtual machine, that is, shuts down all applications on the virtual machine. The resource management of the virtual machine is periodic, the server also obtains the first state and the second state of the virtual machine in the next period, and if the allocation processing unit 304 determines that the first state of the virtual machine is idle and the second state is not in use, the resource recovery processing is performed on the virtual machine, that is, the virtual machine is deleted. When the resource recovery processing is performed on the virtual machine, the virtual machine may wait for a period of time, for example, wait for 30 days, so as to avoid that the virtual machine is deleted by mistake due to misjudgment and cannot be recovered.
Fig. 4 is a schematic structural diagram of a resource management apparatus of a virtual machine according to another embodiment of the present invention, and on the basis of the foregoing embodiments, the resource management apparatus of a virtual machine according to the embodiment of the present invention further includes:
the upgrade processing unit 305 is configured to perform resource upgrade processing on the virtual machine after determining that the first state of the virtual machine is busy.
Specifically, the upgrade processing unit 305 performs resource upgrade processing on the virtual machine, that is, increases the resources of the virtual machine, after determining that the first state of the virtual machine is busy. The first state of the virtual machine is busy, which indicates that the resources of the virtual machine are in shortage, and more resources need to be allocated to the virtual machine to improve the operating efficiency of the virtual machine. Before resource upgrading and allocating processing is carried out on the virtual machine, resource upgrading and allocating processing confirmation information can be sent to a user of the virtual machine, after the user agrees, the virtual machine is subjected to resource upgrading and allocating processing, and the user can select the time for carrying out the resource upgrading and allocating processing; after the resource upgrading and allocating processing is carried out on the virtual machine, the result of the resource upgrading and allocating processing can be sent to a user of the virtual machine, so that the user can know the resource allocation change condition of the virtual machine in time. It can be understood that, if the first state of the virtual machine is normal, it indicates that the current resources of the virtual machine can meet the operation requirement of the virtual machine, and the resource allocation processing is not required to be performed on the virtual machine.
Fig. 5 is a schematic structural diagram of a resource management apparatus of a virtual machine according to yet another embodiment of the present invention, and as shown in fig. 5, on the basis of the foregoing embodiments, further, the resource management apparatus of a virtual machine according to the embodiment of the present invention further includes a number-of-days obtaining unit 306 and a determining unit 307, where:
the number-of-days obtaining unit 306 is configured to obtain the number of shutdown days of each virtual machine according to the power state of each virtual machine within preset number of days; wherein the basic information of each virtual machine comprises a power state; the determining unit 307 is configured to perform resource recycling processing on the virtual machine after it is determined that the number of shutdown days of the virtual machine is greater than a preset number of days.
Specifically, the number-of-days obtaining unit 306 may obtain the power state of each virtual machine within preset number of days, and determine whether the virtual machine is in a shutdown state or in a startup state each day according to the power state of each virtual machine within preset number of days, where if the power state obtained by the virtual machine each time within one day is power off, the virtual machine is in the shutdown state, and otherwise, the virtual machine is in the startup state. The number of days obtaining unit 306 may count the number of days that the virtual machine is in the shutdown state in the preset number of days, and obtain the number of days of shutdown of each virtual machine. Wherein the basic information of each of the virtual machines includes a power state. The preset days are set according to actual needs, and the embodiment of the invention is not limited.
After obtaining the number of shutdown days of each virtual machine, the determining unit 307 compares the number of shutdown days of the virtual machine with a preset value, and if the number of shutdown days is greater than the preset value, the server performs resource recycling processing on the virtual machine. The virtual machine may be queried for an account before the resource recovery processing is performed on the virtual machine, and if the account has registration information of the virtual machine, resource recovery processing confirmation information may be sent to a user of the virtual machine, and the user may perform the resource recovery processing on the virtual machine after approval of the user or perform the resource recovery processing when the user does not respond within a set time. After the resource recovery processing is performed on the virtual machine, the result of the resource recovery processing is sent to the user of the virtual machine. If the virtual machine has no registration information on the standing book of the virtual machine, the resource recycling processing can be directly carried out. The preset value is set according to actual experience, and the embodiment of the invention is not limited. The registration information of the virtual machine includes, but is not limited to, communication information such as a user's mobile phone and a mailbox. The set time is, for example, 15 days, and is set according to practical experience, which is not limited in the embodiment of the present invention.
The embodiment of the server provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the embodiment are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device may include: a processor (processor)601, a communication Interface (Communications Interface)602, a memory (memory)603 and a communication bus 604, wherein the processor 601, the communication Interface 602 and the memory 603 complete communication with each other through the communication bus 604. The processor 601 may call logic instructions in the memory 603 to perform the following method: acquiring basic information of each virtual machine periodically; obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset; obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset; and performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
In addition, the logic instructions in the memory 603 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: acquiring basic information of each virtual machine periodically; obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset; obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset; and performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: acquiring basic information of each virtual machine periodically; obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset; obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset; and performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A resource management method of a virtual machine is characterized by comprising the following steps:
acquiring basic information of each virtual machine periodically;
obtaining a first state of each virtual machine according to the basic information of each virtual machine and a first judgment rule; wherein the first judgment rule is preset;
obtaining a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset;
according to the first state and the second state of each virtual machine, performing resource allocation processing on each virtual machine;
wherein the performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine includes: if the first state of the virtual machine is idle and the second state of the virtual machine is in use, performing resource allocation reduction processing on the virtual machine;
the second state judgment information comprises the user utilization rate of the virtual machine; correspondingly, the obtaining the second state of each virtual machine according to the second state judgment information and the second judgment rule of each virtual machine includes: if the judgment shows that the user utilization rates of the N virtual machines exceed the corresponding fluctuation range and N is larger than m in the user utilization rates of the virtual machines acquired for N times in a single period, the second state of the virtual machine is in use; n, N and m are positive integers, and N is less than or equal to N.
2. The method according to claim 1, wherein the second state judgment information further includes at least one of first type judgment information, second type judgment information, and third type judgment information of the virtual machine; correspondingly, the obtaining the second state of each virtual machine according to the second state judgment information and the second judgment rule of each virtual machine further includes:
and acquiring a second state of the virtual machine according to at least one type of information of the first type judgment information, the second type judgment information and the third type judgment information of the virtual machine and a corresponding second state judgment rule.
3. The method according to claim 1, wherein the performing resource allocation processing on each of the virtual machines according to the first state and the second state of each of the virtual machines comprises:
and if the first state of the virtual machine is idle and the second state of the virtual machine is not in use, performing application closing processing on the virtual machine, and performing resource recycling processing on the virtual machine after the first state of the virtual machine is idle and the second state of the virtual machine is not in use is judged and obtained next time.
4. The method of claim 1, further comprising:
and if the first state of the virtual machine is judged to be busy, performing resource allocation increasing processing on the virtual machine.
5. The method of any of claims 1 to 4, further comprising:
obtaining the shutdown days of each virtual machine according to the power state of each virtual machine within preset days; wherein the basic information of each virtual machine comprises a power state;
and if judging that the number of days for shutting down the virtual machine is larger than the preset number of days, performing resource recovery processing on the virtual machine.
6. A resource management apparatus for a virtual machine, comprising:
the information acquisition unit is used for periodically acquiring the basic information of each virtual machine;
a first state obtaining unit, configured to obtain a first state of each virtual machine according to basic information of each virtual machine and a first determination rule; wherein the first judgment rule is preset;
a second state obtaining unit, configured to obtain a second state of each virtual machine according to second state judgment information and a second judgment rule of each virtual machine; wherein the second judgment rule is preset;
the allocation processing unit is used for performing resource allocation processing on each virtual machine according to the first state and the second state of each virtual machine;
wherein the allocation processing unit is specifically configured to: after judging that the first state of the virtual machine is idle and the second state of the virtual machine is in use, performing resource allocation reduction processing on the virtual machine;
the second state judgment information comprises the user utilization rate of the virtual machine; correspondingly, the second state obtaining unit is specifically configured to: if the judgment shows that the user utilization rates of the N virtual machines exceed the corresponding fluctuation range and N is larger than m in the user utilization rates of the virtual machines acquired for N times in a single period, the second state of the virtual machine is in use; n, N and m are positive integers, and N is less than or equal to N.
7. The apparatus according to claim 6, wherein the second state judgment information further includes at least one of first type judgment information, second type judgment information, and third type judgment information of the virtual machine; correspondingly, the second state obtaining unit is specifically configured to:
and acquiring a second state of the virtual machine according to at least one type of information of the first type judgment information, the second type judgment information and the third type judgment information of the virtual machine and a corresponding second state judgment rule.
8. The apparatus of claim 6, wherein the deployment processing unit is specifically configured to:
and after judging that the first state of the virtual machine is idle and the second state of the virtual machine is not in use, carrying out application closing processing on the virtual machine, and carrying out resource recycling processing on the virtual machine after judging that the first state of the virtual machine is idle and the second state of the virtual machine is not in use next time.
9. The apparatus of claim 6, further comprising:
and the resource upgrading and allocating processing unit is used for carrying out resource upgrading and allocating processing on the virtual machine after judging that the first state of the virtual machine is busy.
10. The apparatus of any one of claims 6 to 9, further comprising:
the number-of-days obtaining unit is used for obtaining the number of shutdown days of each virtual machine according to the power state of each virtual machine in preset number of days; wherein the basic information of each virtual machine comprises a power state;
and the judging unit is used for performing resource recovery processing on the virtual machine after judging that the shutdown days of the virtual machine are more than the preset days.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 5 are implemented when the computer program is executed by the processor.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN201910748477.0A 2019-08-14 2019-08-14 Resource management method and device for virtual machine Active CN110471769B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910748477.0A CN110471769B (en) 2019-08-14 2019-08-14 Resource management method and device for virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910748477.0A CN110471769B (en) 2019-08-14 2019-08-14 Resource management method and device for virtual machine

Publications (2)

Publication Number Publication Date
CN110471769A CN110471769A (en) 2019-11-19
CN110471769B true CN110471769B (en) 2022-03-29

Family

ID=68510745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910748477.0A Active CN110471769B (en) 2019-08-14 2019-08-14 Resource management method and device for virtual machine

Country Status (1)

Country Link
CN (1) CN110471769B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312136A (en) * 2020-02-27 2021-08-27 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for controlling a virtual machine
CN112395045B (en) * 2020-11-13 2024-07-09 深圳力维智联技术有限公司 Virtual machine recovery and resource adjustment method thereof
CN114816776B (en) * 2022-07-01 2022-09-23 锐盈云科技(天津)有限公司 Enterprise intelligent cloud asset management system

Citations (5)

* 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
CN104836819A (en) * 2014-02-10 2015-08-12 阿里巴巴集团控股有限公司 Dynamic load balancing method and system, and monitoring and dispatching device
CN108173683A (en) * 2017-12-25 2018-06-15 东软集团股份有限公司 Elasticity control method, device and the Cloud Server of cloud application
CN108563504A (en) * 2018-02-24 2018-09-21 国家计算机网络与信息安全管理中心 A kind of resource management-control method and device
CN109412841A (en) * 2018-09-30 2019-03-01 北京金山云网络技术有限公司 Method of adjustment, device and the cloud platform of resources of virtual machine

Patent Citations (5)

* 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
CN104836819A (en) * 2014-02-10 2015-08-12 阿里巴巴集团控股有限公司 Dynamic load balancing method and system, and monitoring and dispatching device
CN108173683A (en) * 2017-12-25 2018-06-15 东软集团股份有限公司 Elasticity control method, device and the Cloud Server of cloud application
CN108563504A (en) * 2018-02-24 2018-09-21 国家计算机网络与信息安全管理中心 A kind of resource management-control method and device
CN109412841A (en) * 2018-09-30 2019-03-01 北京金山云网络技术有限公司 Method of adjustment, device and the cloud platform of resources of virtual machine

Also Published As

Publication number Publication date
CN110471769A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN111796908B (en) System and method for automatic elastic expansion and contraction of resources and cloud platform
CN110471769B (en) Resource management method and device for virtual machine
CN111078363B (en) NUMA node scheduling method, device, equipment and medium of virtual machine
EP3507692B1 (en) Resource oversubscription based on utilization patterns in computing systems
CN109375985B (en) Dynamic memory management method and device
CN114096953A (en) Memory management method and device, electronic equipment and computer readable medium
CN109032805A (en) A kind of scalable appearance method, apparatus of elasticity, server and storage medium
CN108874502B (en) Resource management method, device and equipment of cloud computing cluster
CN112579304A (en) Resource scheduling method, device, equipment and medium based on distributed platform
CN110750336B (en) OpenStack virtual machine memory hot-expanding method
CN112650575B (en) Resource scheduling method, device and cloud service system
US20210406053A1 (en) Rightsizing virtual machine deployments in a cloud computing environment
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN110647392A (en) Intelligent elastic expansion method based on container cluster
US20120144389A1 (en) Optimizing virtual image deployment for hardware architecture and resources
CN109960579B (en) Method and device for adjusting service container
CN109062666A (en) Virtual machine cluster management method and related device
CN115113987A (en) Method, device, equipment and medium for allocating non-uniform memory access resources
CN110806918A (en) Virtual machine operation method and device based on deep learning neural network
US20200272526A1 (en) Methods and systems for automated scaling of computing clusters
CN110096339B (en) System load-based capacity expansion and contraction configuration recommendation system and method
CN115211092A (en) Message pulling method and device and computer storage medium
CN104391736A (en) Method for setting up sleep mode of virtual machine and device
CN114035947A (en) Method, device, equipment and system for dynamically allocating resources
CN115794305B (en) Method and device for adjusting memory of virtual machine, storage medium and electronic device

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