Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Execution mode described in following exemplary embodiment does not represent all execution modes consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
The term used in the present invention is only for the object describing specific embodiment, and not intended to be limiting the present invention." one ", " described " and " being somebody's turn to do " of the singulative used in the present invention and appended claims is also intended to comprise most form, unless context clearly represents other implications.It is also understood that term "and/or" used herein refer to and comprise one or more project of listing be associated any or all may combine.
Term first, second, third, etc. may be adopted although should be appreciated that to describe various information in the present invention, these information should not be limited to these terms.These terms are only used for the information of same type to be distinguished from each other out.Such as, without departing from the present invention, the first information also can be called as the second information, and similarly, the second information also can be called as the first information.Depend on linguistic context, word as used in this " if " can be construed as into " ... time " or " when ... time " or " in response to determining ".
See Fig. 1, be an embodiment flow chart of storage means of the present invention, this embodiment can be applied on storage server, comprises the following steps:
Step 101, monitors the load parameter value that the virtual machine of described server admin is current.
In this step, the load parameter value under the virtual machine present port adopting polling dispatching algorithm RR, weighted round-robin dispatching algorithm WRR or Source Hashing Scheduling algorithm monitors to manage by server, described load parameter value is flow value and/or load value.Wherein, alternatively, described server can obtain once described load parameter value every predetermined time interval.
Step 102, determines the threshold value corresponding with the application message of the application that described virtual machine associates preset.
Before execution step 102, described server needs first to obtain described application message, could determine corresponding threshold value, and namely before execution step 102, described method also comprises:
Step 101-1, obtains the current information on services providing described load services of described virtual machine, at least comprises described application message in described information on services.
In this step, virtual machine under server admin is when providing described load services, described information on services can be reported to described server, described information on services at least needs to comprise described application message, alternatively, the information such as described application message, the network address, serve port, Web vector graphic expection can be comprised.Wherein, the described network address and serve port use during described load services for described virtual machine provides, and described Web vector graphic is contemplated to the flow information or load information that described virtual machine provides meeting during described load services to produce.
After server obtains described information on services, determine the threshold value corresponding with described application message preset.
Step 103, the size of more described load parameter value and described threshold value, obtains comparative result.
In this step, when comparing, can be compared by any one mode following.
< mode one >
Relatively the described load parameter value of each virtual machine and the size of default first threshold, obtain described comparative result.
In the embodiment of the present invention, the load parameter value of each virtual machine of the described server admin monitored can be compared with the first threshold corresponding with the application message of the application that described virtual machine associates preset, thus obtain described comparative result.Illustrate as follows.
< example 1>
Server admin three virtual machines, load parameter value and first threshold adopt flow value, the application message of the load value of virtual machine, the application of association and the preset first threshold value of correspondence as shown in table 1.The load value of more each virtual machine and the size of corresponding preset first threshold value respectively, thus obtain described comparative result.
Table 1
Aforesaid way be for all virtual machines under server admin load parameter value and preset first threshold compare, to provide the number of the virtual machine of load services in subsequent steps according to comparative result dynamic conditioning.In the embodiment of the present invention, in order to improve the utilance of virtual machine further, the average load parameter value of the virtual machine possessing same application information and the size of default threshold value can also be compared, obtain described comparative result, as follows.
< mode two >
Calculate the average load parameter value possessing the virtual machine of same application information, then the size of more described average load parameter value and default threshold value, obtains described comparative result.
When adopting this kind of mode, the load parameter value of no longer more each virtual machine and default threshold value, but using the virtual machine of same application information as a class, the relatively size of average load parameter value and the Second Threshold preset or the 3rd threshold value, wherein said 3rd threshold value is less than described Second Threshold, thus obtains described comparative result.Illustrate as follows.
< example 2>
Server admin three virtual machines, load parameter value and first threshold adopt flow value, and the application message of the load value of virtual machine, the application of association is as shown in table 1.So when employing mode two compares, need to compare the average flow rate value of virtual machine A and the virtual machine B possessing respective application information and the Second Threshold preset or the 3rd threshold value.The corresponding relation of the application message of the mean load value of virtual machine, the application of association, Second Threshold and the 3rd threshold value is as shown in table 2.
Table 2
In the embodiment of the present invention, above-mentioned two kinds of modes can be adopted to compare, thus obtain described comparative result, when after the described comparative result of acquisition, perform step 104.
Step 104, according to described comparative result, adjusts the current number providing the virtual machine of load services.
According to modes different in step 103, the current number that the virtual machine of load services is provided of dynamic conditioning.Particularly, described step 104 can be adjusted by the number of following two kinds of modes to the virtual machine providing load services.As follows.
< mode one >
When passing through the mode one in step 103, when relatively the described load parameter value of each virtual machine and the size of first threshold obtain described comparative result, if when described comparative result indicates the current described load parameter value of the first virtual machine of described server admin to exceed described first threshold, a newly-increased virtual machine under described server.
Alternatively, when the described load parameter value of the first virtual machine exceedes described first threshold, server can be reported to the police, so that user understands the situation of virtual machine server occurring load anxiety in real time.Illustrate as follows.
< example 3>
Server admin three virtual machines, load parameter value and first threshold adopt flow value, the application message of the load value of virtual machine, the application of association and the preset first threshold value of correspondence as shown in table 1.When the described load parameter value of virtual machine A exceedes corresponding first threshold, server needs dynamically to increase by a new virtual machine, so that by virtual machine newly-increased for unnecessary load access.Alternatively, when monitoring server exceedes corresponding first threshold to the described load parameter value of virtual machine A, server can be reported to the police, and prompting user virtual machine A present load is nervous.
Said process is the process that server dynamically increases virtual machine number, and server in the following manner, can dynamically reduce the number of virtual machine:
Server, when the load parameter value of the second virtual machine is 0, deletes described second virtual machine.
Illustrate as follows.
< example 4>
Monitoring server constantly reduces to the described load parameter value of virtual machine B, until when load parameter value reduces to 0, server deletes virtual machine B.
The embodiment of the present invention passes through said process, the load parameter value that relatively each virtual machine of server admin is current and the size of the default threshold value corresponding with the application message of the application that described virtual machine associates, according to comparative result, carry out the number that dynamic conditioning provides the virtual machine of load services, improve the utilance of virtual machine, for offered load service provides higher availability.
< mode two >
When passing through the mode two in step 103, relatively possess the average load parameter value of the virtual machine of same application information and the size of Second Threshold to obtain described comparative result, when the described average load parameter value that described 3rd virtual machine of described comparative result instruction is current exceedes default Second Threshold, wherein, Second Threshold representative possesses the maximum of the average load parameter value of the virtual machine of same application information, when average load parameter value exceedes Second Threshold, illustrate that the overall load of the virtual machine possessing same application information is very large, the number of virtual machine can be increased.
Illustrate as follows.
< example 5>
The corresponding relation of the application message of the mean load value of virtual machine, the application of association, Second Threshold and the 3rd threshold value is as shown in table 2.When the mean load value of the virtual machine A and virtual machine B that possess same application information exceedes Second Threshold, a newly-increased virtual machine under described server.
When the described average load parameter value that described 3rd virtual machine of described comparative result instruction is current is less than the 3rd threshold value, wherein said 3rd predetermined threshold value is less than described second predetermined threshold value, 3rd threshold value representative possesses the minimum value of the average load parameter value of the virtual machine of same application information, when average load parameter value is less than the 3rd threshold value, illustrate that the overall load of the virtual machine possessing same application information is lower, the number of virtual machine can be reduced.
When virtual machine deleted by needs, alternatively, the virtual machine that in described 3rd virtual machine, current described load parameter value is minimum can be deleted, be specially, new load is no longer connected on the virtual machine of needs deletion by server, when waiting for that the load parameter value of this virtual machine reduces to 0 gradually, close the port that described virtual machine is corresponding, delete described virtual machine.Illustrate as follows.
< example 6>
When the average load parameter value of the virtual machine A and virtual machine B that possess same application information in monitoring server to table 2 is less than the 3rd threshold value 200, suppose that the load parameter value of now virtual machine A is 300, the load parameter value of virtual machine B is 100, then server determination virtual machine B is the virtual machine needing to delete, no longer new load is connected on virtual machine B, when waiting for that the load parameter value of virtual machine B reduces to 0 gradually, close the port that virtual machine B is corresponding, delete virtual machine B.
In the embodiment of the present invention, by the average load parameter value that compares the virtual machine possessing same application information and the size of threshold value preset, obtain comparative result, when the average load parameter value that described comparative result instruction possesses the virtual machine of same application information exceedes Second Threshold, then a newly-increased virtual machine; When the average load parameter value that the instruction of described comparative result possesses the virtual machine of same application information is lower than the 3rd threshold value, delete and possess the virtual machine that in the virtual machine of same application information, current described load parameter value is minimum, achieve equally and carry out according to the application message of the application that virtual machine associates the object that dynamic conditioning provides the number of the virtual machine of load services.
In above process, no matter newly-increased virtual machine or delete virtual machine, all to need information reportings such as the network address of the virtual machine of variation, serve port, application message, network and change conditions, to described server, to carry out unified management by server to virtual machine.
In embodiments of the present invention, in order to improve the utilance of virtual machine further, above-mentioned virtual machine management method also comprises (not shown in figure 1):
Step 105, whether the virtual machine detecting described server admin breaks down.
Step 106, when detecting that the 4th virtual machine under described server admin breaks down, deletes described 4th virtual machine.
In the embodiment of the present invention, server detects the virtual machine that it manages, and when the virtual machine broken down being detected, deletes corresponding virtual machine, thus improves the utilance of virtual machine, realize high availability.
See Fig. 2, it is an enforcement scene of virtual machine management method of the present invention.In this embodiment, described storage server is divided into different functional entitys, carrys out the Virtual Machine Manager process that the embodiment of the present invention provides.
Virtual flow-line network monitoring center 201, for monitoring the load parameter value providing the virtual machine of load services of described server admin.
Virtual flow-line load services center 202, for the strategy preset according to Virtual Machine Management Service center 203, determine the threshold value corresponding with the application message of the application that described virtual machine associates, and the load parameter value of the virtual machine obtained by described virtual flow-line network monitoring center 201 compares with the described threshold value preset, and comparative result is passed to described Virtual Machine Management Service center 203.
Described Virtual Machine Management Service center 203, for creating the strategy that described virtual flow-line load services center 201 compares, and when after the comparative result receiving described virtual flow-line load services center 201, according to policy information dynamic conditioning for providing the number of the virtual machine of load services.
See Fig. 3, be another embodiment flow chart of storage means of the present invention, this embodiment is described on the basis of Fig. 2 application scenarios, comprising:
Step 301, establishment virtual machine virtual flow-line load services strategy task is initiated to virtual flow-line load services center 202 in Virtual Machine Management Service center 203, and needing provides the information such as the network address, serve port, application message, Web vector graphic expection of started virtual machine for creating described load services.
Step 302, is monitored the load parameter value of virtual machine by virtual flow-line network monitoring center 201 according to the service network that comprises of load strategy created.
Step 303, when the size of the load parameter value threshold value corresponding with the application message of the application that described virtual machine associates is compared at virtual flow-line load services center 202, sends to Virtual Machine Management Service center 203 by comparative result.
Step 304, the comparative result that Virtual Machine Management Service center 203 is transmitted according to virtual flow-line load services center 202, increases or reduces the number providing the virtual machine of load services.
Step 305, when the virtual machine of newly-increased (or deletion) enters after (or exiting) provide the state of load services, the information such as the network address of the virtual machine of variation, serve port, application message, network and change conditions are passed to virtual flow-line load services center 202.
Certainly, in above-described embodiment, if when server detects that certain virtual machine breaks down, also need to delete corresponding virtual machine.
In above-described embodiment, by the size of the current load parameter value of the virtual machine comparing server admin with the threshold value corresponding with the application message of the application that described virtual machine associates preset, according to comparative result, carry out the number that dynamic conditioning provides the virtual machine of load services, improve the utilance of virtual machine, for offered load service provides higher availability.
Corresponding with the embodiment of preceding method, present invention also offers the embodiment of device.
Fig. 4 is an embodiment block diagram of virtual machine management device of the present invention, and with reference to Fig. 4, the virtual machine management device in the present embodiment is used for Virtual Machine Management Service device, comprising: monitoring means 410, determining unit 420, comparing unit 430 and adjustment unit 440.
Wherein, described monitoring means 410, the load parameter value that the virtual machine for monitoring described server admin is current;
Described determining unit 420, for determining the threshold value corresponding with the application message of the application that described virtual machine associates preset;
Comparing unit 430, for the size of more described load parameter value and described threshold value, obtains comparative result;
Adjustment unit 440, for according to described comparative result, adjusts the current number providing the virtual machine of load services.
As shown in Figure 5, Fig. 5 is the another kind of virtual machine management device block diagram of the disclosure according to an exemplary embodiment, and this embodiment is on aforementioned basis embodiment illustrated in fig. 4, and described device also comprises: acquiring unit 450.
Wherein, described acquiring unit 450, for obtaining the current information on services providing described load services of described virtual machine, at least comprises described application message in described information on services.
As shown in Figure 6, Fig. 6 is the another kind of virtual machine management device block diagram of the disclosure according to an exemplary embodiment, and this embodiment is on aforementioned basis embodiment illustrated in fig. 4, and described comparing unit 430 comprises: first compares subelement 431.
Wherein, described first compares subelement, for the described load parameter value of each virtual machine of more described server admin and the size of default first threshold, obtains described comparative result.
As shown in Figure 7, Fig. 7 is the another kind of virtual machine management device block diagram of the disclosure according to an exemplary embodiment, this embodiment is on aforementioned basis embodiment illustrated in fig. 6, and described adjustment unit 440 comprises: first increases subelement 441 and first deletes subelement 442.
Wherein, described first increases subelement 441, when exceeding described first threshold for indicating the current described load parameter value of the first virtual machine of described server admin when described comparative result, and a newly-increased virtual machine under described server;
Described first deletes subelement 442, when being 0 for the described load parameter value that the second virtual machine when described server admin is current, deletes described second virtual machine.
As shown in Figure 8, Fig. 8 is the another kind of virtual machine management device block diagram of the disclosure according to an exemplary embodiment, and this embodiment is on aforementioned basis embodiment illustrated in fig. 4, and described comparing unit 430 comprises: second compares subelement 432.
Wherein, described second compares subelement, for the average load parameter value of the 3rd virtual machine possessing same application information and the size of described threshold value of more described server admin, obtains described comparative result.
As shown in Figure 9, Fig. 9 is the another kind of virtual machine management device block diagram of the disclosure according to an exemplary embodiment, this embodiment is on aforementioned basis embodiment illustrated in fig. 8, and described adjustment unit 440 comprises: second increases subelement 443 and second deletes subelement 444.
Wherein, described second increases subelement 443, when exceeding default Second Threshold for the described average load parameter value current when described 3rd virtual machine of described comparative result instruction, and a newly-increased virtual machine;
Described second deletes subelement 444, when being less than the 3rd threshold value for the described average load parameter value current when described 3rd virtual machine of described comparative result instruction, delete the virtual machine that in described 3rd virtual machine, current described load parameter value is minimum, described 3rd predetermined threshold value is less than described second predetermined threshold value.
As shown in Figure 10, Figure 10 is the another kind of virtual machine block diagram of the disclosure according to an exemplary embodiment, and this embodiment is on the basis of any one of earlier figures 4-Fig. 9 illustrated embodiment, and described device also comprises: detecting unit 460 and delete cells 470.
Wherein, whether described detecting unit 460, break down for the virtual machine detecting described server admin;
Described delete cells 470, for when detecting that the 4th virtual machine under described server admin breaks down, deletes described 4th virtual machine.
In said apparatus, the implementation procedure of the function and efficacy of unit specifically refers to the implementation procedure of corresponding step in said method, does not repeat them here.
For device embodiment, because it corresponds essentially to embodiment of the method, so relevant part illustrates see the part of embodiment of the method.Device embodiment described above is only schematic, the wherein said unit illustrated as separating component or can may not be and physically separates, parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of module wherein can be selected according to the actual needs to realize the object of the present invention program.Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement.
As seen from the above-described embodiment, by the size of the current load parameter value of the virtual machine comparing server admin with the threshold value corresponding with the application message of the application that described virtual machine associates preset, according to comparative result, carry out the number that dynamic conditioning provides the virtual machine of load services, improve the utilance of virtual machine, for offered load service provides higher availability.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.