This application claims priority to Taiwan Application Serial Number 100141069, filed Nov. 10, 2011, which is herein incorporated by reference.
1. Technical Field
The present invention relates to a virtual machine technology. More particularly, the present invention relates to a method and device for adjusting virtual resource adjusting, and a computer readable storage medium.
2. Description of Related Art
In the conventional technology, only one operating system can be executed on one physical machine. The hardware resource of the physical machine thus cannot be fully utilized. In order to improve the efficiency and availability of the hardware resource and applications, a virtualization technology is used to establish a virtual environment for running multiple virtual machines on the physical machine to fully utilize the hardware resource.
In a virtual system, the resource is needed to be adjusted according to the amount of data processed in the system. It is one of the most intuitive manners to adjust the resource of the virtual system through a graphic user interface. In a conventional graphic user interface, the user may adjust the amount of resource through the use of an empty field, a pull down menu or an adjusting bar, in which the empty field is used for inputting a value, the pull down menu is used for providing options, and the adjusting bar is used for adjusting values by moving the bar. However, the user has to type or select the correct values carefully if one of the above methods is used, which is not intuitive. Further, it is time-consuming to type or select the correct values.
Accordingly, it is an issue needed to be resolved by those in this field regarding how to design a system and a method for operating a graphic user interface, and a computer readable storage medium to overcome the aforementioned problems.
An aspect of the present disclosure is to provide a method for adjusting virtual resource used in a virtual system. The method comprises the steps outlined below. At least one virtual machine in the virtual system having a maximum I/O load threshold, a minimum I/O load threshold, a maximum operation load threshold and a minimum operation load threshold is provided. An I/O loading amount and an operation loading amount of the total data loading amount of the virtual system are retrieved. A relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold is determined, and a relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold is determined. The number of the virtual machine is adjusted according to the relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold and an unit resource amount of the virtual machine is adjusted according to the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold.
Another aspect of the present disclosure is to provide a device for adjusting virtual resource used in a virtual system having at least one virtual machine. The device comprises a retrieving module, a determining module and an adjusting module. The retrieving module retrieves an I/O loading amount and an operation loading amount of the total data loading amount of the virtual system. The determining module determines the relationship of the I/O loading amount and a maximum I/O load threshold and a minimum I/O load threshold of the virtual machine and determining the relationship of the operation loading amount and a maximum operation load threshold and a minimum operation load threshold of the virtual machine. The adjusting module adjusts the number of the virtual machine according to the relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold and to adjust an unit resource amount of the virtual machine according to the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold.
Yet another aspect of the present disclosure is to provide a computer readable storage medium to store a computer program to execute a method for adjusting virtual resource used in a virtual system. The method comprises the following steps. At least one virtual machine in the virtual system having a maximum I/O load threshold, a minimum I/O load threshold, a maximum operation load threshold and a minimum operation load threshold is provided. An I/O loading amount and an operation loading amount of the total data loading amount of the virtual system are retrieved. The relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold is determined and the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold is determined. The number of the virtual machine is adjusted according to the relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold and an unit resource amount of the virtual machine is adjusted according to the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold.
It is to be understood that both the foregoing general description and the following detailed description are by examples, and are intended to provide further explanation of the invention as claimed.
The invention can be more fully understood by reading the following detailed description of the embodiment, with reference made to the accompanying drawings as follows:
Reference will now be made in detail to the present embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
The virtual system 1 is a virtual environment established on a physical operation device (not shown) for generating a plurality of virtual machines 12 (depicted as VM in
In step 301, virtual machines 12 in the virtual system 1 are provided. The virtual machines 12 have a maximum I/O load threshold, a minimum I/O load threshold, a maximum operation load threshold and a minimum operation load threshold.
In step 302, the retrieving module 20 depicted in
In general, the processing of the I/O type data is restricted by the number of the virtual machines 12. The number of the I/O ports of the virtual machines 12 is less when the number of the virtual machines 12 is less. Accordingly, the processing of the I/O type data is slower when there are not enough ports due to fewer virtual machines 12. On the other hand, the processing of the operational type data is restricted by the unit resource amount of the virtual machines 12. When the virtual machines 12 have a larger amount of the central processing units or a larger amount of the capacity of the memory, the processing of the operational type data will be faster.
In an embodiment, the determining module 22 retrieves related thresholds 23 from the virtual machines 12 or from the setting of the user. The relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold is determined by the determining module 22, and the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold is determined by the determining module 22 in step 303. The maximum I/O load threshold and the minimum I/O load threshold are the upper limit and the lower limit of the amount of the I/O type data that can be processed by the virtual machine 12 respectively. The amount of the I/O type data is beyond the upper limit of the amount of data that can be processed by the virtual machines 12 if the I/O loading amount is larger than the maximum I/O load threshold. On the contrary, there are many unused resources of the virtual machines 12 if the I/O loading amount is smaller than the minimum I/O load threshold. Similarly, the amount of the operational type data is beyond the upper limit of the amount of the data that can be processed by the virtual machines 12 if the operation loading amount is larger than the maximum operation load threshold. On the contrary, there are many unused resources of the virtual machines 12 if the operation loading amount is smaller than the minimum operation load threshold.
The adjusting module 24 adjusts the number of the virtual machines 12 according to the relationship of the I/O loading amount and the maximum I/O load threshold and the minimum I/O load threshold and adjusts an unit resource amount of the virtual machines 12 according to the relationship of the operation loading amount and the maximum operation load threshold and the minimum operation load threshold in step 304.
In an embodiment, the adjusting module 24 can perform adjustment according to the I/O loading amount and the operation loading amount respectively. For example, when the determining module 22 determines that the I/O loading amount is larger than the maximum I/O load threshold, the adjusting module 24 increases the number of the virtual machines 12. When the determining module 22 determines that the operation loading amount is larger than the maximum operation load threshold, the adjusting module 24 increases the unit resource amount of the virtual machines 12. In other words, when the I/O loading amount is larger than the maximum I/O load threshold, the number of the virtual machines 12 is increased. The unit resources of the virtual machines 12 that can be adjusted may comprises central processing unit or memory capacity. In an embodiment, the number of the virtual machines 12 having the smallest unit resource amount is increased first. In another embodiment, the adjusting module can perform more efficient adjustment strategy by referring to both of the I/O loading amount and the operation loading amount.
In step 401, the determining module 22 retrieves the total data loading amount 21 and determines whether the I/O loading amount is larger than the maximum I/O load threshold in step 402. When the I/O loading amount is larger than the maximum I/O load threshold, the determining module 22 sets a flag of increasing the number of virtual machines in step 403. When the I/O loading amount is not larger than the maximum I/O load threshold, the determining module 22 further determines whether the I/O loading amount is smaller than the minimum I/O load threshold in step 404. When the I/O loading amount is smaller than the minimum I/O load threshold, the determining module 22 sets a flag of decreasing the number of virtual machines in step 405. When the I/O loading amount is not smaller than the minimum I/O load threshold, the determining module 22 does not set any flag and the process proceeds to step 406 directly. It is noted that when step 403 or step 405 is finished, the process also proceeds to step 406 to reload the total data loading amount 21. If the determining module 22 determines that the number of the virtual machines 12 needs to be adjusted in the above process, the new number of the virtual machines will be taken into account when the total data loading amount 21 is reloaded. After reloading the total data loading amount 21, the process proceeds to point A to continue with the determination process depicted in
The process in
When the determining module 22 determines that the operation loading amount is larger than the maximum operation load threshold, the determining module 22 sets a flag of increasing unit resource amount in step 408. When the operation loading amount is not larger than the maximum operation load threshold, the determining module 22 further determines whether the operation loading amount is smaller than the minimum operation load threshold in step 409. When the operation loading amount is smaller than the minimum operation load threshold, the determining module 22 sets a flag of decreasing unit resource amount in step 410. When the operation loading amount is not smaller than the minimum operation load threshold, no flag is set by the determining module 22 and the process proceeds to step 411 directly. It is noted that when step 408 or step 410 is finished, the process also proceeds to step 411 to generate a determination result.
When the adjusting module 24 determines that the flag of increasing the number of virtual machine and the of increasing unit resource amount are not set, the adjusting module 24 determines whether the flag of decreasing the number of virtual machine or the flag of decreasing unit resource amount is set in step 507. If both of the flags are not set, the process proceeds back to step 504, where no adjustment is made by the adjusting module 24. If one of the flags is set, the adjusting module 24 determines whether the minimum number of the virtual machines is reached in step 508. If the minimum number of the virtual machines is reached, the process proceeds back to step 504, where the adjusting module 24 does not make adjustment. If the minimum number of the virtual machines is not reached, the process proceeds to point B to continue with the process depicted in
The process in
Accordingly, the adjustment made along the vertical direction is used to adjust the number of the virtual machines and the adjustment made along the horizontal direction is used to adjust the amount of the unit resource of the virtual machines. In an embodiment, when there are two or more than two virtual machines 12 in the virtual system 1 and the I/O loading amount of the virtual system 1 is larger than the maximum I/O load threshold of the virtual machines 12, the main adjustment strategy is to adjust the number of the virtual machines since the I/O ports of the virtual machines are not enough. The adjustment of the unit resource of the virtual machines is not taken into consideration in the first place. Hence, the adjusting module 24 can increase the number of the virtual machines 12 that have the smallest unit resource first.
In an embodiment, when there are two or more than two virtual machines 12 in the virtual system 1 and the operation loading amount of the virtual system 1 is larger than the maximum operation load threshold of the virtual machines 12, the main adjustment strategy is to adjust the unit resource amount of the virtual machines that have the largest unit resource. Hence, by increasing the unit resource amount of the virtual machines that have the largest unit resource first, the resource demanded by the operation data loading can be satisfied.
In an embodiment, when there are two or more than two virtual machines 12 in the virtual system 1 and the I/O loading amount of the virtual system 1 is smaller than the minimum I/O load threshold of the virtual machines 12, it is possible to decrease the resource too much if the virtual machines 12 having larger unit resource amount are turned off. Accordingly, the adjusting module 24 can decrease the number of the virtual machines 12 having the smallest unit resource amount first.
In an embodiment, when there are two or more than two virtual machines 12 in the virtual system 1 and the operation loading amount of the virtual system 1 is smaller than the minimum operation load threshold of the virtual machines 12, it is possible to decrease the resource too much if the unit resource amount of the virtual machines 12 having larger unit resource amount are decreased. Accordingly, the adjusting module 24 can decrease the unit resource amount of the virtual machines 12 having the smallest unit resource amount first.
Consequently, the method and the device for adjusting the virtual resource used in the virtual system can perform adjustment on the number of the virtual machines and the unit resource according to different types of data loading. Further, the method and the device can perform efficient adjustment by taking the change in one of the resources into consideration to adjust other kinds of resource for avoiding over-adjustment.
In another embodiment, a computer readable storage medium to store a computer program to execute the method for adjusting virtual resource used in the virtual system described above is provided. The process of the method is the same as the process described above. No further detail is discussed here.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
100141069 | Nov 2011 | TW | national |