CN110471769A - A kind of method for managing resource and device of virtual machine - Google Patents

A kind of method for managing resource and device of virtual machine Download PDF

Info

Publication number
CN110471769A
CN110471769A CN201910748477.0A CN201910748477A CN110471769A CN 110471769 A CN110471769 A CN 110471769A CN 201910748477 A CN201910748477 A CN 201910748477A CN 110471769 A CN110471769 A CN 110471769A
Authority
CN
China
Prior art keywords
virtual machine
state
information
resource
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.)
Granted
Application number
CN201910748477.0A
Other languages
Chinese (zh)
Other versions
CN110471769B (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

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

Abstract

The present invention provides the method for managing resource and device of a kind of virtual machine, which comprises periodically obtains the essential information of each virtual machine;According to the essential information and the first judgment rule of each virtual machine, the first state of each virtual machine is obtained;Wherein, first judgment rule is preset;Information and the second judgment rule are judged according to the second state of each virtual machine, obtain the second state of each virtual machine;Wherein, second judgment rule is preset;According to the first state and the second state of each virtual machine, resource allocation processing is carried out to each virtual machine.Described device is for executing the above method.The method for managing resource and device of virtual machine provided in an embodiment of the present invention improve the resource allocation efficiency of virtual machine.

Description

A kind of method for managing resource and device of virtual machine
Technical field
The present invention relates to field of computer technology, and in particular to a kind of method for managing resource and device of virtual machine.
Background technique
With the arriving of Internet era, the bearing capacity of virtual machine was compared to there is great increasing in the past on virtual platform Long, the government pressure of virtual platform is also growing.
In the prior art, product vRealize can be monitored by the centralized management of the virtual platform of VMware Operations Manager (vROps) realizes the monitoring and early warning to virtual machine, and operation maintenance personnel can be allowed to find and solve in advance Certainly potential risks problem, such as: it can carry out early warning to busy virtual machine, operation maintenance personnel dilatation resource be reminded, to the spare time The virtual machine set equally will do it alarm, remind operation maintenance personnel to carry out the recycling of resource, these are all very necessary and practical Function.But in actual use, it is found that it has many problems, leads to not effectively reach management virtualization resource Purpose, such as: warning information it is excessive and can not automatic processing, idle virtual machine rate of false alarm it is excessively high and can not restore after recycling Deng.The reason of leading to the above problem be the prior art centralized management monitoring product only passage capacity data be index commented Estimate, appraisal procedure is single and a large amount of warning information of generation are handled to operation maintenance personnel, and treatment effeciency is lower.
Therefore, how to propose a kind of method for managing resource of virtual machine, effectively the resource of virtual machine can be moved State management, the resource allocation efficiency for improving virtual machine become the important topic that this field needs to solve.
Summary of the invention
For the problems of the prior art, the embodiment of the present invention provides the method for managing resource and device of a kind of virtual machine.
On the one hand, the present invention proposes a kind of method for managing resource of virtual machine, comprising:
Periodically obtain the essential information of each virtual machine;
According to the essential information and the first judgment rule of each virtual machine, the first of each virtual machine is obtained State;Wherein, first judgment rule is preset;
Information and the second judgment rule are judged according to the second state of each virtual machine, are obtained each described virtual Second state of machine;Wherein, second judgment rule is preset;
According to the first state and the second state of each virtual machine, each virtual machine is carried out at resource allocation Reason.
On the other hand, the present invention provides a kind of resource management apparatus of virtual machine, comprising:
Information acquisition unit, for periodically obtaining the essential information of each virtual machine;
First state obtaining unit is obtained for the essential information and the first judgment rule according to each virtual machine Obtain the first state of each virtual machine;Wherein, first judgment rule is preset;
Second state obtaining unit, for judging information and the second judgement according to the second state of each virtual machine Rule obtains the second state of each virtual machine;Wherein, second judgment rule is preset;
Allocation processing unit, for the first state and the second state according to each virtual machine, to each void Quasi- machine carries out resource allocation processing.
In another aspect, the present invention provides a kind of electronic equipment, including memory, processor and storage are on a memory and can The computer program run on a processor, the processor are realized virtual described in any of the above-described embodiment when executing described program The step of method for managing resource of machine.
Another aspect, the present invention provide a kind of computer readable storage medium, are stored thereon with computer program, the calculating Machine program realizes the step of method for managing resource of virtual machine described in any of the above-described embodiment when being executed by processor.
The method for managing resource and device of virtual machine provided in an embodiment of the present invention can periodically obtain each virtual machine Essential information obtains the first shape of each virtual machine then according to the essential information of each virtual machine and the first judgment rule State judges information and the second judgment rule further according to the second state of each virtual machine, obtains the second shape of each virtual machine State, first state and the second state then according to each virtual machine carry out resource allocation processing, Neng Goushi to each virtual machine The resource of each virtual machine is managed automatically now, improves the resource allocation efficiency of virtual machine.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.In the accompanying drawings:
Fig. 1 is the flow diagram of the method for managing resource for the virtual machine that one embodiment of the invention provides.
Fig. 2 be another embodiment of the present invention provides virtual machine method for managing resource flow diagram.
Fig. 3 is the structural schematic diagram of the resource management apparatus for the virtual machine that one embodiment of the invention provides.
Fig. 4 be another embodiment of the present invention provides virtual machine resource management apparatus structural schematic diagram.
Fig. 5 is the structural schematic diagram of the resource management apparatus for the virtual machine that further embodiment of this invention provides.
Fig. 6 is the entity structure schematic diagram for the electronic equipment that one embodiment of the invention provides.
Specific embodiment
Understand in order to make the object, technical scheme and advantages of the embodiment of the invention clearer, with reference to the accompanying drawing to this hair Bright embodiment is described in further details.Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but simultaneously It is not as a limitation of the invention.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Fig. 1 is the flow diagram of the method for managing resource for the virtual machine that one embodiment of the invention provides, as shown in Figure 1, The method for managing resource of virtual machine provided in an embodiment of the present invention, comprising:
S101, the essential information for periodically obtaining each virtual machine;
Specifically, server can periodically obtain the essential information of each virtual machine, and the essential information includes but unlimited In the power supply status of virtual machine, IP address quantity, CPU number, the average load (Load Average) of CPU, memory free time Swapace (SwapFree), free memory (MemAvailable), the available space (Avail) of file system and file system Idle percentages (%util).Wherein, described to be periodically configured according to actual needs, such as obtained once every 5 seconds, this Inventive embodiments are without limitation.The executing subject of the method for managing resource of virtual machine provided in an embodiment of the present invention includes but unlimited In server.
For example, the server periodically can obtain each virtual machine by VMware or OpenStackAPI interface Essential information.
S102, essential information and first state judgment rule according to each virtual machine obtain each void The first state of quasi- machine;Wherein, the first state judgment rule is preset;
Specifically, the server, can be according to each described after the essential information for obtaining each virtual machine The essential information and first state judgment rule of virtual machine obtain the first state of each virtual machine.Wherein, described One state includes busy, normal or three kinds idle.The first state judgment rule be it is preset, part is set based on practical experience It sets, the embodiment of the present invention is without limitation.
For example, the essential information of the virtual machine includes the idle exchange sky of CPU number, the average load of CPU, memory Between, free memory, total memory, the available space of file system and file system idle percentages.Correspondingly, first shape State judgment rule includes: first state Rule of judgment A, first state Rule of judgment B, first state Rule of judgment C, first state Rule of judgment D, first state Rule of judgment E, first state Rule of judgment F and first state Rule of judgment G.Wherein, the first shape State Rule of judgment A are as follows: in one cycle, the average load of the CPU of virtual machine be greater than the number of the CPU of the virtual machine when Between be greater than signal period total time 20%;First state Rule of judgment B are as follows: the idle of the memory of virtual machine is handed in a cycle The growth rate that the average value in space is changed relative to the average value of the idle swapace of the memory of upper a cycle virtual machine is greater than 10%;First state Rule of judgment C are as follows: the average value of the available space of the file system of virtual machine is less than in one cycle 5%;First state Rule of judgment D are as follows: in one cycle, the idle percentages of the file system of virtual machine reach 100% Time is greater than the 80% of signal period total time;First state Rule of judgment E are as follows: the CPU of the virtual machine in one cycle Average load be greater than the virtual machine CPU number half time be greater than signal period total time 50%;First State Rule of judgment F are as follows: in one cycle, the average value of the free memory of virtual machine is less than total memory of virtual machine 50%;First state Rule of judgment G are as follows: in one cycle, the average value of the idle percentages of the file system of virtual machine is big In 30%.Wherein, the signal period is configured according to actual needs, and for example, 7 days, the embodiment of the present invention was without limitation.
The server can obtain the average load of the CPU of virtual machine described in every five seconds and CPU number in signal period, Then statistics obtain signal period in the virtual machine CPU average load be greater than the virtual machine CPU number when Between a, if above-mentioned time a be greater than signal period total time 20%, the virtual machine meets first state Rule of judgment A, it is otherwise, described to be virtually unsatisfactory for the first state Rule of judgment A.
The server can obtain the idle swapace of the memory of virtual machine described in every five seconds in signal period, then The idle swapace of the memory of the virtual machine according to every five seconds in signal period, which calculates, to be obtained in signal period in virtual machine The average value for the idle swapace deposited, then calculate the average value phase of the idle swapace of the memory of virtual machine in signal period For the growth rate b of the average value of the idle swapace of the memory of virtual machine in upper a cycle, if above-mentioned growth rate b is big It is otherwise, described to be virtually unsatisfactory for the first state and sentence then the virtual machine meets first state Rule of judgment B in 10% Broken strip part B.
The server can obtain the available space of the file system of virtual machine described in every five seconds in signal period, then The available space of the file system of the virtual machine according to every five seconds in signal period, which calculates, to be obtained in signal period in virtual machine The average value c of the available space for the file system deposited, if above-mentioned average value c, less than 5%, the virtual machine meets first State Rule of judgment C, it is otherwise, described to be virtually unsatisfactory for the first state Rule of judgment C.
The server can obtain the idle percentages of the file system of virtual machine described in every five seconds in signal period, so Statistics obtains the time d that the idle percentages of the file system of the virtual machine in signal period reach 100% afterwards, if on Time d is greater than signal period total time 80% is stated, then the virtual machine meets first state Rule of judgment D, it is otherwise, described Virtually it is unsatisfactory for the first state Rule of judgment D.
The server can obtain the average load of the CPU of virtual machine described in every five seconds in signal period and CPU number Half, the average load that then statistics obtains the CPU of the virtual machine in signal period are greater than the number of the CPU of the virtual machine Half time e, if above-mentioned time e is greater than the 50% of signal period total time, the virtual machine meets the first shape State Rule of judgment E, it is otherwise, described to be virtually unsatisfactory for the first state Rule of judgment E.
The server can obtain the free memory of virtual machine described in every five seconds and total memory in signal period, then root It is calculated according to the free memory of virtual machine described in every five seconds in signal period and obtains the free memory of virtual machine in signal period and be averaged Value f, if above-mentioned average value f is less than the 50% of total memory of virtual machine, the virtual machine meets first state and judges item Part F, it is otherwise, described to be virtually unsatisfactory for the first state Rule of judgment F.
The server can obtain the idle percentages of the file system of virtual machine described in every five seconds in signal period, so The idle percentages of the file system of the virtual machine according to every five seconds in signal period, which calculate, afterwards obtains virtual machine in signal period File system idle percentages average value g, if above-mentioned average value g is greater than 30%, the virtual machine meets the One state Rule of judgment G, it is otherwise, described to be virtually unsatisfactory for the first state Rule of judgment G.
If the virtual machine, which meets first state Rule of judgment A, first state Rule of judgment B, first state, judges item Part C or first state Rule of judgment D, then the first state of the virtual machine is busy;If full according to the virtual machine Sufficient first state Rule of judgment E, first state Rule of judgment F or first state Rule of judgment G, then the of the virtual machine One state is normal;If being unsatisfactory for first state Rule of judgment A, first state Rule of judgment B, first according to the virtual machine State Rule of judgment C, first state Rule of judgment D, first state Rule of judgment E, first state Rule of judgment F and first state Rule of judgment G, the first state of the virtual machine are the free time.
S103, information and the second judgment rule are judged according to the second state of each virtual machine, obtains each institute State the second state of virtual machine;Wherein, second judgment rule is preset;
Specifically, the second state that the server can obtain each virtual machine judges information, then according to institute It states the second state and judges information and the second state judgment rule, obtain the second state of each virtual machine.Described second State judges that information may include that the first kind of the virtual machine judges that information, the second class of the virtual machine judge information and institute The third class for stating virtual machine judges an at least category information in information, and every class judges that information is configured based on practical experience, this Inventive embodiments are without limitation.Second state may include with not with two states.Wherein, second state Judgment rule be it is preset, be configured based on practical experience, the embodiment of the present invention is without limitation.The of each virtual machine The specific acquisition process of two-state sees below described, herein without repeating.
S104, first state and the second state according to each virtual machine carry out resource to each virtual machine Allocation processing.
Specifically, the server is after the first state and the second state for obtaining each virtual machine, Ke Yigen According to the first state and the second state of each virtual machine, resource allocation processing, the money are carried out to each virtual machine Source allocation processing may include carrying out resource to the virtual machine to rise with processing, resource drop with processing and resource reclaim processing.
For example, when the first state of the virtual machine be idle and the second state be in the used time, can to it is described virtually into Row resource drop is with processing.When the first state of the virtual machine is idle and the second state is not with can be to described virtual Machine carries out resource reclaim processing.
The method for managing resource of virtual machine provided in an embodiment of the present invention periodically obtains the essential information of each virtual machine, Then according to the essential information of each virtual machine and the first judgment rule, the first state of each virtual machine is obtained, further according to Second state of each virtual machine judges information and the second judgment rule, obtains the second state of each virtual machine, then root According to the first state and the second state of each virtual machine, resource allocation processing is carried out to each virtual machine, can be realized to each The resource of virtual machine is managed automatically, improves the resource allocation efficiency of virtual machine.Further, since utilizing the basic of virtual machine Information and the second state judge the different conditions of information acquisition virtual machine, and the information based on virtual machine different dimensions is to virtual machine Resource carries out allocation processing, improves the accuracy of the resource allocation of virtual machine.
On the basis of the various embodiments described above, further, second state judges that information includes the virtual machine The first kind judges that information, the second class judge that information and third class judge at least category information in information;Correspondingly, the basis Second state of each virtual machine judges information and the second judgment rule, obtains the second state of each virtual machine Include:
Judge that information, the second class judge that information and third class judge in information at least according to the first kind of the virtual machine One category information and corresponding second state judgment rule, obtain the second state of the virtual machine.
Specifically, second state judges that information may include that the first kind of the virtual machine judges information, the void Second class of quasi- machine judges that the third class of information and the virtual machine judges at least category information in information.The virtual machine The first kind judge information may include the subscriber usage of the virtual machine, free memory, file system IO number/second of reading, File system write IO number/second, the reading MB/s of file system, file system write the parameter informations such as MB/s.The virtual machine The second class judge information may include the operating system log-on message of the virtual machine, User operation log, system log and Using log.The third class of the virtual machine judges that information may include the application version mount message of the virtual machine, that is, pacifies It is attached to the application version of each application on the virtual machine.Wherein, every class judges that information is configured based on practical experience, this Inventive embodiments are without limitation.The server the first kind for obtaining the virtual machine judge information, the virtual machine the It, can be according to above-mentioned at least one after two classes judge that the third class of information and the virtual machine judges at least category information in information Category information and corresponding second state judgment rule obtain the second state of each virtual machine.
For example, the server, which can obtain the first kind, judges that information judges information as second state, institute The first kind for stating virtual machine judges that information includes the subscriber usage of the virtual machine, free memory, reading IO times of file system Number/the second, file system write IO number/second, the reading MB/s of file system, file system write MB/s.The first kind judgement Information can be obtained with taken at regular intervals, such as the acquisition of every five seconds clock is primary.Judge that corresponding second state of information is sentenced with the first kind Disconnected rule are as follows: in one cycle, the subscriber usage of virtual machine, free memory, file system reading IO number/second, file There is obvious fluctuation in the MB/s that writes for writing IO number/second, the reading MB/s of file system or file system of system.It is described that there are bright Aobvious fluctuation is configured based on practical experience, and the embodiment of the present invention is without limitation.The obvious fluctuation can refer in signal period The interior first kind judges that the parameter information that information includes is greater than m beyond the number of corresponding fluctuation range, and m is according to reality Experience is configured, the 20% of total times of collection in for example, described signal period.Wherein, the fluctuation range is to preset , it is configured based on practical experience, the embodiment of the present invention is without limitation.
For the subscriber usage of the virtual machine, the server can count the total acquisition obtained in signal period Times N, if signal period is 7 days, every five seconds clock acquires the subscriber usage of the primary virtual machine, then in 7 day time The total times of collection N for acquiring the subscriber usage of the virtual machine altogether is 120960 times.It will each collected virtual machine Subscriber usage be compared with corresponding fluctuation range, if in the subscriber usage of the collected virtual machine of n times, The subscriber usage of the n virtual machines is beyond corresponding fluctuation range and n is greater than m, then the second state of the virtual machine For with.Wherein, the subscriber usage fluctuation range of the virtual machine, can be according to the subscriber usage of the virtual machine in list Average value p in a period is determined, calculates average value of the subscriber usage of the virtual machine in signal period, i.e., to N The subscriber usage of a virtual machine is averaging, and p (1+10%) can be exceeded pair as the subscriber usage for stating virtual machine P (1-10%) is exceeded corresponding fluctuation range as the subscriber usage for stating virtual machine by the upper limit value for the fluctuation range answered Lower limit value.
For the free memory of the virtual machine, IO number/second of reading of file system, file system write IO number/second, The reading MB/s of file system or file system write MB/s, for judge the virtual machine the second state detailed process with Judge that the deterministic process of the second state of the virtual machine is similar according to the subscriber usage of the virtual machine, herein without superfluous It states.
If the first kind of the virtual machine judges have any one parameter information to meet corresponding second state in information Judgment rule, then the second state of the virtual machine be with;If the first kind of the virtual machine judges own in information Parameter information be all unsatisfactory for corresponding second state judgment rule, then the second state of the virtual machine be not with.
The server can obtain second class and judge that information judges information as second state, described virtual Second class of machine judges that information includes the operating system log-on message of the virtual machine, User operation log, system log and answers With at least one information in log.Judge that the corresponding second state judgment rule of information may include judgement with second class At least one Rule of judgment in condition 1, Rule of judgment 2, Rule of judgment 3 and Rule of judgment 4.Rule of judgment 1 includes: single In period, there are log-on messages in the operating system log-on message of virtual machine.Wherein, the log-on message can use last life Enable output.Rule of judgment 2 includes: in signal period, and the .bash_history file of the User operation log of virtual machine exists Newly-increased execution order.Rule of judgment 3 includes: in signal period, and the messages file of the system log of virtual machine exists Ftp, ssh, sftp's logs in or transmits information log.Rule of judgment 4 includes: in signal period, and virtual machine applies log SystemOut.log file exist apply logon information.
It is described virtual if there are log-on messages in the operating system log-on message of the virtual machine in signal period The operating system log-on message of machine meets in Rule of judgment 1, then the virtual machine, which meets second class, judges that information is corresponding The second state judgment rule, the second state of the virtual machine be with;In signal period, if the user of virtual machine grasps There is newly-increased execution order in the .bash_history file for making log, the User operation log satisfaction of the virtual machine is being sentenced Broken strip part 2, then the virtual machine, which meets second class, judges the corresponding second state judgment rule of information, the virtual machine The second state be with;In signal period, if the messages file of the system log of virtual machine there are ftp, ssh, Sftp's logs in or transmits information log, and the system log of the virtual machine meets in Rule of judgment 3, then the virtual machine is full Foot second class judge corresponding second state judgment rule of information, the second state of the virtual machine for;Single In period, if the SystemOut.log file using log of virtual machine, which exists, applies logon information, the virtual machine is answered Met with log in Rule of judgment 4, then the virtual machine, which meets second class, judges the corresponding second state judgement of information Rule, the second state of the virtual machine be with.That is, the second class of the virtual machine judges there is any one in information A information meets described any one Rule of judgment judged with second class in the corresponding second state judgment rule of information, The virtual machine meets second class and judges the corresponding second state judgment rule of information, and the second state of the virtual machine is With.Otherwise, the state of the virtual machine be not with.
The server can obtain the third class and judge that information judges information as second state, described virtual The third class of machine judges that information includes the application version mount message of the virtual machine, and the application version mount message can wrap The version mount message for including an application, also may include the version mount message of multiple applications.Judge to believe with the third class Ceasing corresponding second state judgment rule may include: the version installation of any one application of virtual machine in one cycle Information includes application version not less than corresponding default application version.I.e. by the application version of each application of the virtual machine with Corresponding default application version is compared, if the application version of all applications is not less than corresponding default application version, that The virtual machine, which meets, judges the corresponding second state judgment rule of information, the second shape of the virtual machine with the third class State be with.If the application version of the virtual machine applied there are one is lower than corresponding application version, the void Quasi- machine is unsatisfactory for judging the corresponding second state judgment rule of information with the third class, and the second state of the virtual machine is not With.
The server can obtain the first kind and judge that information and the second class judge information as second state Judge information, with the first kind judge information and second class judge the corresponding second state judgment rule of information include with The first kind judges the corresponding second state judgment rule of information, and judges corresponding second shape of information with second class State judgment rule.If the virtual machine, which meets, judges the corresponding second state judgment rule of information with the first kind, or The virtual machine, which meets, judges the corresponding second state judgment rule of information with second class, then the second of the virtual machine State be with;If the virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with the first kind, and The virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with second class, then the of the virtual machine Two-state be not with.
The server can obtain second class and judge that information and third class judge information as second state Judge information, with second class judge information and the third class judge the corresponding second state judgment rule of information include with Second class judges the corresponding second state judgment rule of information, and judges corresponding second shape of information with the third class State judgment rule.If the virtual machine, which meets, judges the corresponding second state judgment rule of information with second class, or The virtual machine, which meets, judges the corresponding second state judgment rule of information with the third class, then the second of the virtual machine State be with;If the virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with second class, and The virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with the third class, then the of the virtual machine Two-state be not with.
The server can obtain the first kind and judge that information and third class judge information as second state Judge information, with the first kind judge information and the third class judge the corresponding second state judgment rule of information include with The first kind judges the corresponding second state judgment rule of information, and judges corresponding second shape of information with the third class State judgment rule.If the virtual machine, which meets, judges the corresponding second state judgment rule of information with the first kind, or The virtual machine, which meets, judges the corresponding second state judgment rule of information with the third class, then the second of the virtual machine State be with;If the virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with the first kind, and The virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with the third class, then the of the virtual machine Two-state be not with.
The server can obtain the first kind and judge that information, second class judge information and third class judgement letter Breath judges information as second state, judges that information, second class judge information and the third with the first kind Class judges that the corresponding second state judgment rule of information includes judging that information corresponding second state judgement is advised with the first kind Then, judge the corresponding second state judgment rule of information with second class and judge information corresponding with the third class Two-state judgment rule.If the virtual machine, which meets, judges the corresponding second state judgment rule of information with the first kind, The virtual machine meet with second class judge corresponding second state judgment rule of information or virtual machine satisfaction and The third class judges the corresponding second state judgment rule of information, then the second state of the virtual machine be with;If The virtual machine is unsatisfactory for judging the corresponding second state judgment rule of information with the first kind, the virtual machine be unsatisfactory for Second class judges the corresponding second state judgment rule of information, and the virtual machine is unsatisfactory for judging to believe with the third class Cease corresponding second state judgment rule, then the second state of the virtual machine be not with.
It is further, described according to the first state of each virtual machine and on the basis of the various embodiments described above Two-state, carrying out resource allocation processing to each virtual machine includes:
If judging to know that the first state of the virtual machine is idle and the second state as with to the virtual progress Resource drop is with processing.
Specifically, the server judge the first state of the virtual machine be idle and the second state be with it Afterwards, illustrate that the frequency of use of the virtual machine is lower, resource drop can be carried out to the virtual machine with processing, that is, reduces the void The resource of quasi- machine.It will be appreciated that carrying out to send resource drop to the virtual machine before resource rises with processing with processing Confirmation message gives the user of the virtual machine, carries out resource drop with processing to the virtual machine after user agrees to, makes Employment, which is also an option that, carries out resource time of the drop with processing;It, can be with after carrying out resource drop to the virtual machine with processing Result of the resource drop with processing is sent to the user of the virtual machine, allows user that can know the money of the virtual machine in time Source configuration variation situation.
For example, resource drop can be preset with processing are as follows: reduce by CPU and two standard memory.When described virtual The first state of machine is that idle and the second state is to reduce CPU and two standard memory of the virtual machine in the used time.Its In, the standard memory is configured according to actual needs, and the embodiment of the present invention is without limitation.
It is further, described according to the first state of each virtual machine and on the basis of the various embodiments described above Two-state, carrying out resource allocation processing to each virtual machine includes:
If judging to know that the first state of the virtual machine is idle and the second state as not with to the virtual machine Handled using closing, and is to leave unused and the second state is does not exist in the first state for judge to know the virtual machine next time With later, resource reclaim processing is carried out to the virtual machine.
Specifically, the server judge the first state of the virtual machine be idle and the second state be not with Later, the virtual machine handle using closing, that is, close all applications on the virtual machine.The server is to institute The resource management for stating virtual machine is periodically that the server described in next cycle can equally obtain the first of the virtual machine State and the second state, if it is judged that it is not with then right that the first state of the virtual machine, which is idle and the second state, The virtual machine carries out resource reclaim processing, that is, deletes the virtual machine.Wherein, it is carried out at resource reclaim to the virtual machine When reason, can wait for a period of time execution, such as wait 30 days, cause virtual machine accidentally to be deleted to avoid the erroneous judgement due to server It removes and can not restore.
On the basis of the various embodiments described above, further, the resource management side of virtual machine provided in an embodiment of the present invention Method further include:
If judging, the first state for knowing the virtual machine to be busy, carry out resource to the virtual machine and rises with processing.
Specifically, the server is after the first state for judging the virtual machine is busy, to the virtual machine It carries out resource to rise with processing, that is, increases the resource of the virtual machine.The first state of the virtual machine be it is busy, illustrate the void The resource of quasi- machine is nervous, needs to distribute more resources to the virtual machine to improve the operational efficiency of virtual machine.To described Virtual machine carries out resource and rises with the user that can send resource liter before processing with processing confirmation message to the virtual machine, In User carries out resource to the virtual machine after agreeing to and rises with processing, and user is also an option that carrying out resource rises with processing Time;After carrying out resource to the virtual machine and rising with processing, resource can be sent and rise the result with processing to described virtual The user of machine allows user that can know the resource distribution situation of change of the virtual machine in time.It will be appreciated that if institute State virtual machine first state be it is normal, illustrate that the Current resource of the virtual machine can satisfy the operation of virtual machine, do not need Resource allocation processing is carried out to the virtual machine.
It rises for example, resource can be preset with processing are as follows: increase CPU and two standard memory.When described virtual When the first state of machine is busy, increase CPU and two standard memory for the virtual machine.Wherein, the standard memory It is configured according to actual needs, the embodiment of the present invention is without limitation.
Fig. 2 be another embodiment of the present invention provides virtual machine method for managing resource flow diagram, such as Fig. 2 institute Show, on the basis of the various embodiments described above, further, the method for managing resource of virtual machine provided in an embodiment of the present invention is also wrapped It includes:
The power supply status of S201, basis each virtual machine in preset number of days, obtain the pass of each virtual machine Machine number of days;Wherein, the essential information of each virtual machine includes power supply status;
Specifically, the server can obtain the power supply status of each virtual machine in preset number of days, according to The daily power supply status of each virtual machine in preset number of days, determining the virtual machine daily is off-mode or booting shape State, if the power supply status that the virtual machine obtains every time in one day is all powered off, the virtual machine is off-mode, Otherwise, the virtual machine is open state.The server can count the virtual machine in the preset number of days and be in pass The number of days of machine state obtains the shutdown number of days of each virtual machine.Wherein, the essential information packet of each virtual machine Include power supply status.The preset number of days is configured according to actual needs, and the embodiment of the present invention is without limitation.
For example, the preset number of days is 15 days, the server can count the power supply that the virtual machine is daily in 15 days State, if the power supply status of the virtual machine obtained every time in one day is all powered off, the virtual machine, which is in, to be closed Machine state, the server can count number of days in off-mode of the virtual machine in 15 days, if it is 9 days, that The shutdown number of days of the virtual machine is 9 days.
If S202, judgement know that the shutdown number of days of the virtual machine is greater than preset value, the virtual progress resource is returned Receipts processing.
Specifically, the server is after the shutdown number of days for obtaining each virtual machine, by the pass of the virtual machine Machine number of days is compared with preset value, if the shutdown number of days is greater than the preset value, the server is to the void Quasi- machine carries out resource reclaim processing.The platform of virtual machine can also be inquired before carrying out resource reclaim processing to the virtual machine Account has the register information of virtual machine on account, and can send resource reclaim processing confirmation message makes to the virtual machine Employment carries out resource reclaim processing to the virtual machine after user agrees to or user does not ring within the set time It is seasonable to carry out resource reclaim processing.After carrying out resource reclaim processing to the virtual machine, the knot of resource reclaim processing is sent Fruit gives the user of the virtual machine.It, can be straight if information is not registered on the account of virtual machine in the virtual machine Tap into the processing of row resource reclaim.Wherein, the preset value is configured based on practical experience, and the embodiment of the present invention is without limitation. The register information of the virtual machine includes but is not limited to the communication informations such as the mobile phone of user, mailbox.The setting time, such as It is 15 days, is configured based on practical experience, the embodiment of the present invention is without limitation.
Fig. 3 is the structural schematic diagram of the resource management apparatus for the virtual machine that one embodiment of the invention provides, as shown in figure 3, The resource management apparatus of virtual machine provided in an embodiment of the present invention includes information acquisition unit 301, first state obtaining unit 302, the second state obtaining unit 303 and allocation processing unit 304, in which:
Information acquisition unit 301 is used to periodically obtain the essential information of each virtual machine;First state obtaining unit 302 is used In essential information and the first judgment rule according to each virtual machine, the first state of each virtual machine is obtained; Wherein, first judgment rule is preset;Second state obtaining unit 303 is used for according to the second of each virtual machine State judges information and the second judgment rule, obtains the second state of each virtual machine;Wherein, the second judgement rule It is then preset;Allocation processing unit 304 is used for first state and the second state according to each virtual machine, to each institute It states virtual machine and carries out resource allocation processing.
Specifically, information acquisition unit 301 can periodically obtain the essential information of each virtual machine, the essential information packet Include but be not limited to the idle exchange sky of the power supply status of virtual machine, IP address quantity, CPU number, the average load of CPU, memory Between, the idle percentages of the available space of free memory, file system and file system.Wherein, described periodically according to practical need It is configured, such as was obtained once every 5 seconds, the embodiment of the present invention is without limitation.
After the essential information for obtaining each virtual machine, first state obtaining unit 302 can be according to each institute The essential information and first state judgment rule of virtual machine are stated, the first state of each virtual machine is obtained.Wherein, described First state includes busy, normal or three kinds idle.The first state judgment rule is preset, part based on practical experience Setting, the embodiment of the present invention is without limitation.
The second state that second state obtaining unit 303 can obtain each virtual machine judges information, then basis Second state judges information and the second state judgment rule, obtains the second state of each virtual machine.Described Two-state judge information may include the first kind of the virtual machine judge information, the second class of the virtual machine judge information and The third class of the virtual machine judges at least category information in information, and every class judges that information is configured based on practical experience, The embodiment of the present invention is without limitation.Second state may include with not with two states.Wherein, second shape State judgment rule be it is preset, be configured based on practical experience, the embodiment of the present invention is without limitation.
After the first state and the second state for obtaining each virtual machine, allocation processing unit 304 can basis The first state and the second state of each virtual machine carry out resource allocation processing, the resource to each virtual machine Allocation processing may include carrying out resource to the virtual machine to rise with processing, resource drop with processing and resource reclaim processing.
The resource management apparatus of virtual machine provided in an embodiment of the present invention periodically obtains the essential information of each virtual machine, Then according to the essential information of each virtual machine and the first judgment rule, the first state of each virtual machine is obtained, further according to Second state of each virtual machine judges information and the second judgment rule, obtains the second state of each virtual machine, then root According to the first state and the second state of each virtual machine, resource allocation processing is carried out to each virtual machine, can be realized to each The resource of virtual machine is managed automatically, improves the resource allocation efficiency of virtual machine.Further, since utilizing the basic of virtual machine Information and the second state judge the different conditions of information acquisition virtual machine, and the information based on virtual machine different dimensions is to virtual machine Resource carries out allocation processing, improves the accuracy of the resource allocation of virtual machine.
On the basis of the various embodiments described above, further, second state judges that information includes the virtual machine The first kind judges that information, the second class judge that information and institute's third class judge at least category information in information;Correspondingly, the second shape State obtaining unit 303 is specifically used for:
Judge that information, the second class judge that information and third class judge in information at least according to the first kind of the virtual machine One category information and corresponding second state judgment rule, obtain the second state of the virtual machine.
Specifically, second state judges that information may include that the first kind of the virtual machine judges information, the void Second class of quasi- machine judges that the third class of information and the virtual machine judges at least category information in information.The virtual machine The first kind judge information may include the subscriber usage of the virtual machine, free memory, file system IO number/second of reading, File system write IO number/second, the reading MB/s of file system, file system write the parameter informations such as MB/s.The virtual machine The second class judge information may include the operating system log-on message of the virtual machine, User operation log, system log and Using log.The third class of the virtual machine judges that information may include the application version mount message of the virtual machine, that is, pacifies It is attached to the application version of each application on the virtual machine.Wherein, every class judges that information is configured based on practical experience, this Inventive embodiments are without limitation.Second state obtaining unit 303 judges information, the void in the first kind for obtaining the virtual machine After second class of quasi- machine judge that the third class of information and the virtual machine judges at least category information in information, understand according to upper An at least category information and corresponding second state judgment rule are stated, the second state of each virtual machine is obtained.
On the basis of the various embodiments described above, further, allocation processing unit 304 is specifically used for:
Be idle and the second state as with later in the first state for judging to know the virtual machine, to it is described virtually into Row resource drop is with processing.
Specifically, judging that the first state of the virtual machine is idle and the second state is with later, illustrating institute The frequency of use for stating virtual machine is lower, and allocation processing unit 304 can carry out resource drop with processing to the virtual machine, that is, reduces The resource of the virtual machine.It will be appreciated that carrying out that resource drop can be sent before resource rises with processing to the virtual machine The user that the virtual machine is given with processing confirmation message carries out resource drop with place to the virtual machine after user agrees to Reason, user, which is also an option that, carries out resource time of the drop with processing;After carrying out resource drop to the virtual machine with processing, Result of the resource drop with processing can be sent to the user of the virtual machine, allow user that can know the virtual machine in time Resource distribution situation of change.
On the basis of the various embodiments described above, further, allocation processing unit 304 is specifically used for:
The first state for judging to know the virtual machine be idle and the second state be not with later, to it is described virtually Machine handle using closing, and is judging to know that the first state of the virtual machine is idle and the second state as not next time With later, resource reclaim processing is carried out to the virtual machine.
Specifically, allocation processing unit 304 is judging that the first state of the virtual machine is that idle and the second state is Not with later, the virtual machine handle using closing, that is, closes all applications on the virtual machine.To the void The resource management of quasi- machine is periodically that the server described in next cycle can equally obtain the first state of the virtual machine With the second state, allocation processing unit 304 is if it is judged that it is not that the first state of the virtual machine, which is idle and the second state, With then deleting the virtual machine to virtual machine progress resource reclaim processing.Wherein, to the virtual machine into When the processing of row resource reclaim, can wait for a period of time execution, such as wait 30 days, lead to virtual machine quilt to avoid due to erroneous judgement It accidentally deletes and can not restore.
Fig. 4 be another embodiment of the present invention provides virtual machine resource management apparatus structural schematic diagram, above-mentioned each On the basis of embodiment, further, the resource management apparatus of virtual machine provided in an embodiment of the present invention further include:
It rises and is used for after the first state for judging to know the virtual machine is busy with processing unit 305, to the void Quasi- machine carries out resource and rises with processing.
Specifically, it rises with processing unit 305 after the first state for judging the virtual machine is busy, to the void Quasi- machine carries out resource and rises with processing, that is, increases the resource of the virtual machine.The first state of the virtual machine be it is busy, illustrate institute The resource for stating virtual machine is nervous, needs to distribute more resources to the virtual machine to improve the operational efficiency of virtual machine.Right The virtual machine carries out resource and rises with the use that can send resource liter before processing with processing confirmation message to the virtual machine People carries out resource to the virtual machine after user agrees to and rises with processing, and user is also an option that carrying out resource liter matches The time of processing;After carrying out resource to the virtual machine and rising with processing, resource can be sent and rise the result with processing to institute The user for stating virtual machine allows user that can know the resource distribution situation of change of the virtual machine in time.It will be appreciated that If the first state of the virtual machine be it is normal, illustrate that the Current resource of the virtual machine can satisfy the operation of virtual machine, It does not need to carry out resource allocation processing to the virtual machine.
Fig. 5 is the structural schematic diagram of the resource management apparatus for the virtual machine that further embodiment of this invention provides, such as Fig. 5 institute Show, on the basis of the various embodiments described above, further, the resource management apparatus of virtual machine provided in an embodiment of the present invention is also wrapped Include number of days obtaining unit 306 and judging unit 307, in which:
Number of days obtaining unit 306 is used for the power supply status according to each virtual machine in preset number of days, obtains each The shutdown number of days of the virtual machine;Wherein, the essential information of each virtual machine includes power supply status;Judging unit 307 is used After knowing that the shutdown number of days of the virtual machine is greater than preset number of days in judgement, to the virtual progress resource reclaim processing.
Specifically, number of days obtaining unit 306 can obtain the power supply status of each virtual machine, root in preset number of days According to the daily power supply status of the virtual machine each in preset number of days, to determine the virtual machine daily be off-mode or is opened Machine state, if the power supply status that the virtual machine obtains every time in one day is all powered off, the virtual machine is shutdown State, otherwise, the virtual machine are open state.Number of days obtaining unit 306 can count the void in the preset number of days Quasi- machine is in the number of days of off-mode, obtains the shutdown number of days of each virtual machine.Wherein, each virtual machine Essential information includes power supply status.The preset number of days is configured according to actual needs, and the embodiment of the present invention is without limitation.
Judging unit 307 is after the shutdown number of days for obtaining each virtual machine, by the shutdown number of days of the virtual machine Be compared with preset value, if the shutdown number of days be greater than the preset value, the server to the virtual machine into The processing of row resource reclaim.The account that virtual machine can also be inquired before carrying out resource reclaim processing to the virtual machine, in platform There is the register information of virtual machine in account, user of the resource reclaim processing confirmation message to the virtual machine, In can be sent User agree to after to the virtual machine carry out when resource reclaim processing or user do not respond within the set time into The processing of row resource reclaim.After carrying out resource reclaim processing to the virtual machine, the result of resource reclaim processing is sent to institute State the user of virtual machine.If information is not registered on the account of virtual machine in the virtual machine, can directly carry out Resource reclaim processing.Wherein, the preset value is configured based on practical experience, and the embodiment of the present invention is without limitation.The void The register information of quasi- machine includes but is not limited to the communication informations such as the mobile phone of user, mailbox.The setting time, for example, 15 It, is configured based on practical experience, and the embodiment of the present invention is without limitation.
The embodiment of server provided in an embodiment of the present invention specifically can be used for executing the place of above-mentioned each method embodiment Process is managed, details are not described herein for function, is referred to the detailed description of above method embodiment.
Fig. 6 is the entity structure schematic diagram for the electronic equipment that one embodiment of the invention provides, as shown in fig. 6, the electronics is set Standby may include: processor (processor) 601,602, memory communication interface (Communications Interface) (memory) 603 and communication bus 604, wherein processor 601, communication interface 602, memory 603 pass through communication bus 604 Complete mutual communication.Processor 601 can call the logical order in memory 603, to execute following method: periodically obtaining Take the essential information of each virtual machine;According to the essential information and the first judgment rule of each virtual machine, obtain each The first state of the virtual machine;Wherein, first judgment rule is preset;According to the second shape of each virtual machine State judges information and the second judgment rule, obtains the second state of each virtual machine;Wherein, second judgment rule It is preset;According to the first state and the second state of each virtual machine, resource allocation is carried out to each virtual machine Processing.
In addition, the logical order in above-mentioned memory 603 can be realized by way of SFU software functional unit and conduct Independent product when selling or using, can store in a computer readable storage medium.Based on this understanding, originally Substantially the part of the part that contributes to existing technology or the technical solution can be in other words for the technical solution of invention The form of software product embodies, which is stored in a storage medium, including some instructions to So that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation of the present invention The all or part of the steps of example the method.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. it is various It can store the medium of program code.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating Computer program on machine readable storage medium storing program for executing, the computer program include program instruction, when described program instruction is calculated When machine executes, computer is able to carry out method provided by above-mentioned each method embodiment, for example, periodically obtains each virtual The essential information of machine;According to the essential information and the first judgment rule of each virtual machine, each virtual machine is obtained First state;Wherein, first judgment rule is preset;Information is judged according to the second state of each virtual machine And second judgment rule, obtain the second state of each virtual machine;Wherein, second judgment rule is preset; According to the first state and the second state of each virtual machine, resource allocation processing is carried out to each virtual machine.
The present embodiment provides a kind of computer readable storage medium, the computer-readable recording medium storage computer journey Sequence, the computer program make the computer execute method provided by above-mentioned each method embodiment, for example, periodically obtain Take the essential information of each virtual machine;According to the essential information and the first judgment rule of each virtual machine, obtain each The first state of the virtual machine;Wherein, first judgment rule is preset;According to the second shape of each virtual machine State judges information and the second judgment rule, obtains the second state of each virtual machine;Wherein, second judgment rule It is preset;According to the first state and the second state of each virtual machine, resource allocation is carried out to each virtual machine Processing.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In the description of this specification, reference term " one embodiment ", " specific embodiment ", " some implementations Example ", " such as ", the description of " example ", " specific example " or " some examples " etc. mean it is described in conjunction with this embodiment or example Particular features, structures, materials, or characteristics are included at least one embodiment or example of the invention.In the present specification, Schematic expression of the above terms may not refer to the same embodiment or example.Moreover, the specific features of description, knot Structure, material or feature can be combined in any suitable manner in any one or more of the embodiments or examples.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical scheme and beneficial effects Describe in detail it is bright, it should be understood that the above is only a specific embodiment of the present invention, the guarantor being not intended to limit the present invention Range is protected, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should be included in this Within the protection scope of invention.

Claims (14)

1. a kind of method for managing resource of virtual machine characterized by comprising
Periodically obtain the essential information of each virtual machine;
According to the essential information and the first judgment rule of each virtual machine, the first shape of each virtual machine is obtained State;Wherein, first judgment rule is preset;
Information and the second judgment rule are judged according to the second state of each virtual machine, obtain each virtual machine Second state;Wherein, second judgment rule is preset;
According to the first state and the second state of each virtual machine, resource allocation processing is carried out to each virtual machine.
2. the method according to claim 1, wherein second state judges that information includes the virtual machine The first kind judges that information, the second class judge that information and third class judge at least category information in information;Correspondingly, the basis Second state of each virtual machine judges information and the second judgment rule, obtains the second state of each virtual machine Include:
It is at least a kind of in information to judge that information, the second class judge that information and third class judge according to the first kind of the virtual machine Information and corresponding second state judgment rule, obtain the second state of the virtual machine.
3. the method according to claim 1, wherein described according to the first state of each virtual machine and Two-state, carrying out resource allocation processing to each virtual machine includes:
If judging to know that the first state of the virtual machine is idle and the second state as with to the virtual carry out resource Drop is with processing.
4. the method according to claim 1, wherein described according to the first state of each virtual machine and Two-state, carrying out resource allocation processing to each virtual machine includes:
If judging to know that the first state of the virtual machine is idle and the second state as not with to virtual machine progress Handled using closing, and the first state for judging to know the virtual machine next time be idle and the second state as not with it Afterwards, resource reclaim processing is carried out to the virtual machine.
5. the method according to claim 1, wherein further include:
If judging, the first state for knowing the virtual machine to be busy, carry out resource to the virtual machine and rises with processing.
6. method according to any one of claims 1 to 5, which is characterized in that further include:
According to the power supply status of the virtual machine each in preset number of days, the shutdown number of days of each virtual machine is obtained;Its In, the essential information of each virtual machine includes power supply status;
If judgement knows that the shutdown number of days of the virtual machine is greater than preset number of days, to the virtual progress resource reclaim processing.
7. a kind of resource management apparatus of virtual machine characterized by comprising
Information acquisition unit, for periodically obtaining the essential information of each virtual machine;
First state obtaining unit obtains every for the essential information and the first judgment rule according to each virtual machine The first state of a virtual machine;Wherein, first judgment rule is preset;
Second state obtaining unit, for judging that information and the second judgement are advised according to the second state of each virtual machine Then, the second state of each virtual machine is obtained;Wherein, second judgment rule is preset;
Allocation processing unit, for the first state and the second state according to each virtual machine, to each virtual machine Carry out resource allocation processing.
8. device according to claim 7, which is characterized in that second state judges that information includes the virtual machine The first kind judges that information, the second class judge that information and third class judge at least category information in information;Correspondingly, described second State obtaining unit is specifically used for:
It is at least a kind of in information to judge that information, the second class judge that information and third class judge according to the first kind of the virtual machine Information and corresponding second state judgment rule, obtain the second state of the virtual machine.
9. device according to claim 7, which is characterized in that the allocation processing unit is specifically used for:
The first state for judging to know the virtual machine is idle and the second state virtually to be provided to described with later Source drop is with processing.
10. device according to claim 7, which is characterized in that the allocation processing unit is specifically used for:
Be idle and the second state as not with later in the first state for judging to know the virtual machine, to the virtual machine into Row is handled using closing, and the first state for judge to know the virtual machine next time be leave unused and the second state as not with Later, resource reclaim processing is carried out to the virtual machine.
11. device according to claim 7, which is characterized in that further include:
Rise and match processing unit, after being busy in the first state for judging to know the virtual machine, to the virtual machine into Row resource rises with processing.
12. according to the described in any item devices of claim 7 to 11, which is characterized in that further include:
Number of days obtaining unit obtains each void for the power supply status according to each virtual machine in preset number of days The shutdown number of days of quasi- machine;Wherein, the essential information of each virtual machine includes power supply status;
Judging unit, for judgement know the virtual machine shutdown number of days be greater than preset number of days after, to it is described virtually into The processing of row resource reclaim.
13. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor realizes any one of claim 1 to 6 side when executing the computer program The step of method.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of any one of claim 1 to 6 the method is realized when being executed by processor.
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 true CN110471769A (en) 2019-11-19
CN110471769B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395045A (en) * 2020-11-13 2021-02-23 深圳力维智联技术有限公司 Virtual machine recovery and resource adjustment method thereof
CN113312136A (en) * 2020-02-27 2021-08-27 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for controlling a virtual machine
CN114816776A (en) * 2022-07-01 2022-07-29 锐盈云科技(天津)有限公司 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

Cited By (4)

* 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
CN112395045A (en) * 2020-11-13 2021-02-23 深圳力维智联技术有限公司 Virtual machine recovery and resource adjustment method thereof
CN114816776A (en) * 2022-07-01 2022-07-29 锐盈云科技(天津)有限公司 Enterprise intelligent cloud asset management system
CN114816776B (en) * 2022-07-01 2022-09-23 锐盈云科技(天津)有限公司 Enterprise intelligent cloud asset management system

Also Published As

Publication number Publication date
CN110471769B (en) 2022-03-29

Similar Documents

Publication Publication Date Title
US9722945B2 (en) Dynamically identifying target capacity when scaling cloud resources
CN105989155B (en) Identify the method and device of risk behavior
CN108023742A (en) A kind of expansion method of application, device and system
US10572156B2 (en) Capacity forecasting based on capacity policies and transactions
CN104657194B (en) Method and system for calculating the influence acted in network
WO2016119412A1 (en) Resource scaling method on cloud platform and cloud platform
CN110471769A (en) A kind of method for managing resource and device of virtual machine
CN109889999B (en) Flow pool management method, system and terminal of Internet of things card
CN109067890A (en) A kind of CDN node edge calculations system based on docker container
CN108090225A (en) Operation method, device, system and the computer readable storage medium of database instance
CN108376299A (en) A kind of prediction technique and device of running trend of the equipment
CN112579304A (en) Resource scheduling method, device, equipment and medium based on distributed platform
CN107645410A (en) A kind of virtual machine management system and method based on OpenStack cloud platforms
CN103701934A (en) Resource optimal scheduling method and virtual machine host machine optimal selection method
CN102521662A (en) Consumption charging method in cloud computing environment
CN109902919A (en) Server assets management method, device, equipment and readable storage medium storing program for executing
CN105302641A (en) Node scheduling method and apparatus in virtual cluster
CN114911598A (en) Task scheduling method, device, equipment and storage medium
US11461210B2 (en) Real-time calculation of data center power usage effectiveness
Chamas et al. Two-phase virtual machine placement algorithms for cloud computing: An experimental evaluation under uncertainty
CN114490089A (en) Cloud computing resource automatic adjusting method and device, computer equipment and storage medium
CN113608751A (en) Operation method, device and equipment of reasoning service platform and storage medium
CN105264457A (en) Energy consumption monitoring method and device
CN109039714A (en) The management method and device of resource in cloud computing system
CN107092551A (en) A kind of server system performance optimization method and 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