Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is only to be not intended to limit the invention merely for for the purpose of describing particular embodiments in terminology used in the present invention.
It is also intended in the present invention and the "an" of singular used in the attached claims, " described " and "the" including majority
Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the present invention
A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from
In the case where the scope of the invention, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination ".
It is one embodiment flow chart of storage method of the present invention referring to Fig. 1, which can apply in storage service
On device, comprising the following steps:
Step 101, the current load parameter value of the virtual machine of the server admin is monitored.
In this step, adjusted by server using polling dispatching algorithm RR, weighted round-robin scheduling algorithm WRR or source address hash
The load parameter value under the virtual machine present port of algorithm monitoring management is spent, the load parameter value is flow value and/or load
Value.Wherein, optionally, the server can the primary load parameter value of interval acquiring at every predetermined time.
Step 102, preset threshold value corresponding with the application message of associated application on the virtual machine is determined.
Before executing step 102, the server needs first to obtain the application message, just can determine that corresponding threshold
Value, i.e., before executing step 102, the method also includes:
Step 101-1 obtains the virtual machine and currently provides the information on services of the load services, in the information on services
Including at least the application message.
In this step, the virtual machine under server admin can report the information on services when providing the load services
To the server, the information on services at least needs to include the application message, it is alternatively possible to include that the application is believed
The information such as breath, network address, serve port, Web vector graphic expection.Wherein, the network address and serve port are the void
It is used when the quasi- machine offer load services, when the Web vector graphic is expected to the virtual machine offer load services
Meeting generate flow information or load information.
After server obtains the information on services, preset threshold value corresponding with the application message is determined.
Step 103, the size of the load parameter value and the threshold value obtains comparison result.
In this step, when being compared, it can be compared by any one following mode.
<mode one>
Compare the load parameter value of each virtual machine and the size of preset first threshold, obtains the relatively knot
Fruit.
It, can be by the load parameter value of each virtual machine of the server admin monitored in the embodiment of the present invention
It is compared with preset first threshold corresponding with the application message of associated application on the virtual machine, to obtain institute
State comparison result.It is illustrated below.
<example 1>
Three virtual machines of server admin, load parameter value and first threshold use flow value, and the load value of virtual machine closes
The application message of the application of connection and corresponding preset first threshold value are as shown in table 1.Be respectively compared each virtual machine load value and
The size of corresponding preset first threshold value, to obtain the comparison result.
Table 1
Aforesaid way be for all virtual machines under server admin load parameter value and preset first threshold into
Row compares, so as in subsequent steps according to the number of the virtual machine of comparison result dynamic adjustment offer load services.This hair
In bright embodiment, in order to further increase the utilization rate of virtual machine, the virtual machine for having same application information can also be compared
The size of average load parameter value and preset threshold value obtains the comparison result, as follows.
<mode two>
The average load parameter value for having the virtual machine of same application information is calculated, then the average load parameter
The size of value and preset threshold value, obtains the comparison result.
When using such mode, the load parameter value and preset threshold value of no longer more each virtual machine, but will be identical
The virtual machine of application message compares the size of average load parameter value and preset second threshold or third threshold value as one kind,
Wherein the third threshold value is less than the second threshold, to obtain the comparison result.It is illustrated below.
<example 2>
Three virtual machines of server admin, load parameter value and first threshold use flow value, and the load value of virtual machine closes
The application message of the application of connection is as shown in table 1.So when employing mode two is compared, needs to compare and have respective application letter
The average flow rate value and preset second threshold or third threshold value of the virtual machine A and virtual machine B of breath.The average load of virtual machine
The corresponding relationship of value, the application message of associated application, second threshold and third threshold value is as shown in table 2.
Table 2
It in the embodiment of the present invention, can be compared using above two mode, to obtain the comparison result, when obtaining
After taking the comparison result, step 104 is executed.
Step 104, according to the comparison result, the number of the current virtual machine that load services are provided is adjusted.
According to mode different in step 103, dynamic adjusts the number of the current virtual machine for providing load services.Specifically
Ground, the step 104 can be adjusted by number of following two mode to the virtual machine for providing load services.It is as follows.
<mode one>
When the load parameter value and first threshold for by the mode one in step 103, comparing each virtual machine
Size is come when obtaining the comparison result, if to indicate the first virtual machine of the server admin current for the comparison result
When the load parameter value is more than the first threshold, a virtual machine is increased newly under the server.
Optionally, when the load parameter value of the first virtual machine is more than the first threshold, server can be carried out
There is the case where loading nervous virtual machine so that user understands in real time in alarm on server.It is illustrated below.
<example 3>
Three virtual machines of server admin, load parameter value and first threshold use flow value, and the load value of virtual machine closes
The application message of the application of connection and corresponding preset first threshold value are as shown in table 1.When the load parameter value of virtual machine A is more than
When corresponding first threshold, server needs dynamic to increase by a new virtual machine, so as to the void that extra load access is newly-increased
Quasi- machine.Optionally, when the load parameter value of monitoring server to virtual machine A is more than corresponding first threshold, server
It can alarm, prompt user virtual machine A present load nervous.
The above process is the process that server dynamic increases virtual machine number, and server can in the following manner, dynamic
Reduce the number of virtual machine:
Server deletes second virtual machine when the load parameter value of the second virtual machine is 0.
It is illustrated below.
<example 4>
The load parameter value of monitoring server to virtual machine B are constantly reduced, when load parameter value is reduced to 0,
Server deletes virtual machine B.
The embodiment of the present invention by the above process, compare server admin the current load parameter value of each virtual machine and
The size of preset threshold value corresponding with the application message of associated application on the virtual machine, according to comparison result, to move
State adjustment provides the number of the virtual machine of load services, improves the utilization rate of virtual machine, provides more for network load service
High availability.
<mode two>
When comparing the average load parameter value for having the virtual machine of same application information by the mode two in step 103
Obtain the comparison result with the size of second threshold, when the comparison result indicate the third virtual machine it is current described in
When average load parameter value is more than preset second threshold, wherein second threshold represents the virtual machine for having same application information
Average load parameter value maximum value, when average load parameter value be more than second threshold when, illustrate have same application information
Virtual machine overall load it is very big, the number of virtual machine can be increased.
It is illustrated below.
<example 5>
The mean load value of virtual machine, the application message of associated application, second threshold and third threshold value corresponding relationship
As shown in table 2.When the mean load value of the virtual machine A and virtual machine B that have same application information are more than second threshold, in institute
It states and increases a virtual machine under server newly.
When the comparison result indicates that the current average load parameter value of the third virtual machine is less than third threshold value
When, wherein the third threshold value is less than second preset threshold, third threshold value represents the virtual machine for having same application information
Average load parameter value minimum value, when average load parameter value be less than third threshold value when, illustrate have same application information
Virtual machine overall load it is lower, it is possible to reduce the number of virtual machine.
When needing to delete virtual machine, it is alternatively possible to delete presently described load parameter value in the third virtual machine
The smallest virtual machine waits the virtual machine specifically, new load is no longer connected on the virtual machine for needing to delete by server
Load parameter value when being gradually reduced to 0, close the corresponding port of the virtual machine, delete the virtual machine.It illustrates such as
Under.
<example 6>
The average load parameter value that monitoring server has the virtual machine A and virtual machine B of same application information into table 2 is small
When third threshold value 200, it is assumed that the load parameter value of virtual machine A is 300 at this time, and the load parameter value of virtual machine B is 100, then
Server determines that virtual machine B is the virtual machine for needing to delete, and no longer new load is connected on virtual machine B, waits virtual machine B
Load parameter value when being gradually reduced to 0, close the corresponding port virtual machine B, delete virtual machine B.
In the embodiment of the present invention, has the average load parameter value of the virtual machine of same application information by comparing and preset
Threshold value size, obtain comparison result, when the comparison result instruction have same application information virtual machine it is average bear
When carrying parameter value more than second threshold, then a virtual machine is increased newly;When comparison result instruction has the void of same application information
When the average load parameter value of quasi- machine is lower than third threshold value, presently described load in the virtual machine for having same application information is deleted
The smallest virtual machine of parameter value is equally realized to adjust to provide come dynamic according to the application message of application associated on virtual machine and be born
Carry the purpose of the number of the virtual machine of service.
In above process, no matter increase virtual machine newly or delete virtual machine, with requiring the network for the virtual machine that will be changed
The information reportings such as location, serve port, application message, network and change conditions give the server, by server to virtual machine into
Row unified management.
In embodiments of the present invention, in order to further increase the utilization rate of virtual machine, above-mentioned virtual machine management method is also
Including (not shown in figure 1):
Step 105, whether the virtual machine for detecting the server admin breaks down.
Step 106, when detecting that the 4th virtual machine under the server admin breaks down, it is empty to delete the described 4th
Quasi- machine.
In the embodiment of the present invention, server detects the virtual machine that it is managed, when detecting the virtual of failure
When machine, corresponding virtual machine is deleted, to improve the utilization rate of virtual machine, realizes high availability.
It referring to fig. 2, is an implement scene of virtual machine management method of the present invention.In the embodiment, the storage is taken
Business device is divided into different functional entitys, to complete Virtual Machine Manager process provided in an embodiment of the present invention.
Virtual flow-line network monitoring center 201, the virtual machine of the offer load services for monitoring the server admin
Load parameter value.
Virtual flow-line load services center 202, for determining according to the preset strategy in Virtual Machine Management Service center 203
Threshold value corresponding with the application message of application associated on the virtual machine, and by the virtual flow-line network monitoring center 201
The load parameter value of the virtual machine of acquisition is compared with the preset threshold value, and comparison result is passed to the virtual machine pipe
Manage service centre 203.
The Virtual Machine Management Service center 203 is compared for creating virtual flow-line load services center 201
Strategy adjusted according to policy information dynamic and after receiving the comparison result at virtual flow-line load services center 201
The number of the whole virtual machine for being used to provide load services.
It is another embodiment flow chart of storage method of the present invention, the embodiment is in Fig. 2 application scenarios referring to Fig. 3
On the basis of be described, comprising:
Step 301, Virtual Machine Management Service center 203 initiates to create virtual machine virtual flow-line load services strategy times
It is engaged in virtual flow-line load services center 202, it is desirable to provide the network address of the virtual machine started, serve port, using letter
The information such as breath, Web vector graphic expection are for creating the load services.
Step 302, the service network for being included according to the load strategy of creation is supervised by virtual flow-line network monitoring center 201
Survey the load parameter value of virtual machine.
Step 303, compare load parameter value when virtual flow-line load services center 202 to answer with associated on the virtual machine
Comparison result is sent to Virtual Machine Management Service center 203 by the size of the corresponding threshold value of application message.
Step 304, the comparison knot that Virtual Machine Management Service center 203 is transmitted according to virtual flow-line load services center 202
Fruit increases or decreases and provides the number of the virtual machine of load services.
Step 305, it after the virtual machine of newly-increased (or deletion), which enters (or exiting), provides the state of load services, will change
The information such as network address, serve port, application message, network and the change conditions of virtual machine pass to virtual flow-line load clothes
Business center 202.
Certainly, in above-described embodiment, if server detects that certain virtual machine breaks down, it is also desirable to delete corresponding
Virtual machine.
In above-described embodiment, by comparing the current load parameter value of the virtual machine of server admin and it is preset with it is described
It is negative dynamically to adjust offer according to comparison result for the size of the corresponding threshold value of the application message of associated application on virtual machine
The number for carrying the virtual machine of service, improves the utilization rate of virtual machine, provides higher availability for network load service.
Corresponding with the embodiment of preceding method, the present invention also provides the embodiments of device.
Fig. 4 is one embodiment block diagram of virtual machine management device of the present invention, reference Fig. 4, the virtual machine in the present embodiment
Managing device is used for Virtual Machine Management Service device, comprising: monitoring unit 410, determination unit 420, comparing unit 430 and adjustment are single
Member 440.
Wherein, the monitoring unit 410, the current load parameter value of virtual machine for monitoring the server admin;
The determination unit 420, it is preset opposite with the application message of associated application on the virtual machine for determining
The threshold value answered;
Comparing unit 430 obtains comparison result for the size of the load parameter value and the threshold value;
Adjustment unit 440, for adjusting the number of the current virtual machine for providing load services according to the comparison result.
As shown in figure 5, Fig. 5 is the disclosure another virtual machine management device frame shown according to an exemplary embodiment
Figure, the embodiment is on the basis of aforementioned embodiment illustrated in fig. 4, described device further include: acquiring unit 450.
Wherein, the acquiring unit 450 currently provides the service letter of the load services for obtaining the virtual machine
It ceases, the application message is included at least in the information on services.
As shown in fig. 6, Fig. 6 is the disclosure another virtual machine management device frame shown according to an exemplary embodiment
Figure, for the embodiment on the basis of aforementioned embodiment illustrated in fig. 4, the comparing unit 430 includes: the first comparing subunit 431.
Wherein, first comparing subunit, the load of each virtual machine for the server admin
The size of parameter value and preset first threshold obtains the comparison result.
As shown in fig. 7, Fig. 7 is the disclosure another virtual machine management device frame shown according to an exemplary embodiment
Figure, for the embodiment on the basis of aforementioned embodiment illustrated in fig. 6, the adjustment unit 440 includes: the first increase subelement 441
Subelement 442 is deleted with first.
Wherein, described first increases subelement 441, for indicating the first of the server admin when the comparison result
When the current load parameter value of virtual machine is more than the first threshold, a virtual machine is increased newly under the server;
Described first deletes subelement 442, the load current for the second virtual machine when the server admin
When parameter value is 0, second virtual machine is deleted.
As shown in figure 8, Fig. 8 is the disclosure another virtual machine management device frame shown according to an exemplary embodiment
Figure, for the embodiment on the basis of aforementioned embodiment illustrated in fig. 4, the comparing unit 430 includes: the second comparing subunit 432.
Wherein, second comparing subunit, have same application information for the server admin
The average load parameter value of three virtual machines and the size of the threshold value, obtain the comparison result.
As shown in figure 9, Fig. 9 is the disclosure another virtual machine management device frame shown according to an exemplary embodiment
Figure, for the embodiment on the basis of aforementioned embodiment illustrated in fig. 8, the adjustment unit 440 includes: the second increase subelement 443
Subelement 444 is deleted with second.
Wherein, described second increases subelement 443, for indicating that the third virtual machine is current when the comparison result
When the average load parameter value is more than preset second threshold, a virtual machine is increased newly;
Described second deletes subelement 444, described in indicating the third virtual machine currently when the comparison result
When average load parameter value is less than third threshold value, it is the smallest virtual to delete presently described load parameter value in the third virtual machine
Machine, the third threshold value are less than second preset threshold.
As shown in Figure 10, Figure 10 is the disclosure another virtual machine block diagram shown according to an exemplary embodiment,
The embodiment is on the basis of any one of earlier figures 4- Fig. 9 illustrated embodiment, described device further include: detection unit 460 and deletes
Except unit 470.
Wherein, whether the detection unit 460, the virtual machine for detecting the server admin break down;
The deletion unit 470, for deleting when detecting that the 4th virtual machine under the server admin breaks down
Except the 4th virtual machine.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying
Out in the case where creative work, it can understand and implement.
As seen from the above-described embodiment, by comparing the current load parameter value of the virtual machine of server admin and it is preset with
The size of the corresponding threshold value of the application message of associated application on the virtual machine, according to comparison result, next dynamic, which adjusts, to be mentioned
For the number of the virtual machine of load services, the utilization rate of virtual machine is improved, is provided for network load service higher available
Property.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.