1. Technical Field
Embodiments of the present disclosure relate to virtual machine technology, and particularly to a guest operating system (OS) transferring system and method.
2. Description of Related Art
A guest operating system (OS) runs in a virtualized environment. The virtualized environment virtualizes a personal computer or a server on an OS kernel layer. By using the virtualized environment, multiple guest OS can co-exist and run independently on the same computer. Each guest OS may use processing time of a CPU of a computer, which is measured by a CPU utilization ratio of the CPU (e.g., 60% capacity usage of a CPU). The computer may run too slow when the CPU utilization ratio used by all guest OS installed in the computer exceeds a threshold (e.g., 80% capacity usage of a CPU). In such a situation, a user may have to stop the application(s) hogging the CPU processing time and delete or transfer one or more of the guest OS to other computers. This is tedious and thus, there is room for improvement in the art.
The disclosure, including the accompany drawings, is illustrated by way of example and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The cloud servers 500 store the CPU utilization ratio. The CPU utilization ratio may show performance of the cloud servers 500 and be generated by the cloud servers 500 themselves when the cloud servers 500 run. Additionally, the cloud servers 500 may store a serial number of each cloud server 500, a voltage of each cloud server 500, a rotational speed of a fan of each cloud server 500, a temperature of each cloud server 500, a status of each cloud server 500 (e.g., power on/off), a memory utilization ratio of each cloud server 500, a disk utilization ratio of each cloud server 500, and network traffic of each cloud server 500.
Each cloud server 500 is installed with one or more guest operating systems (OS). In order to manage the one or more guest OS, each cloud server 500 is installed with a virtual machine management application (e.g., HYPERVISOR). The HYPERVISOR is used to manage and monitor execution of the one or more guest OS. The HYPERVISOR also obtains the CPU utilization ratio of each guest OS from each cloud server 500.
The remote server 20, in one example, can be also a dynamic host configuration protocol (DHCP) server, which provides a DHCP service. In one embodiment, the remote server 20 assigns Internet protocol (IP) addresses to the cloud servers 500 by the DHCP service. In one embodiment, the remote server 20 uses dynamic allocation to assign the IP addresses to the cloud servers 500. For example, when the remote server 20 receives a request from a cloud server 500 via the network 40, the remote server 20 dynamically assigns an IP address to the cloud server 500. In one embodiment, the remote server 20 may be a personal computer (PC), a network server, or any other data-processing equipment which can provide IP address allocation function.
The obtaining module 210 periodically obtains a CPU utilization ratio of each guest OS installed in each cloud server 500 of the data center 50. The obtained CPU utilization ratio may be a percentage capacity usage of the CPU. In one embodiment, each guest OS includes a task manager, the task manager provides the CPU utilization ratio of the guest OS. The obtaining module 210 obtains the CPU utilization ratio from the task manager of the guest OS at a predetermined time (e.g., 1:00 AM per day). Regardless of the cloud sever 500 freezing up or not, the obtaining module 210 may still periodically obtain the CPU utilization ratio of each guest OS installed in the cloud server 500 many times (e.g., twenty four times). If the cloud server 500 freezes up, the CPU utilization ratio of each guest OS installed in the cloud server 500 is 100%. In addition, the obtaining module 210 further saves the obtained CPU utilization ratio into the database system 30 every time when the CPU utilization ratio is obtained from the task manager of the guest OS.
The counting module 220 counts the number of times of obtaining the CPU utilization ratio. In one embodiment, if the CPU utilization ratio is obtained twenty four times, the counting module 220 counts that the number of the times equals to twenty four times. In addition, the counting module 22 counts the number of times of obtaining the CPU utilization ratio until the number of times equal to a predetermined number.
The determination module 230 determines if the counted number of times is equal to the predetermined number. The predetermined number may be twenty four, for example.
The calculation module 240 calculates a predicted average of the CPU utilization ratio for each cloud server 500 if the counted number of the times is equal to the predetermined number. In one embodiment, the calculation module 240 calculates the average of the obtained CPU utilization ratio of each guest OS, then the calculation module 240 calculates the predicted average of the CPU utilization ratio of the cloud server 500 according to the average of the obtained CPU utilization ratio of each guest OS. The predicted average of the CPU utilization ratio of the cloud server 500 is equal to a summation of the average of the obtained CPU utilization ratio of each guest OS installed in the cloud server 500. The predicted average of the CPU utilization ratio of the cloud server 500 is regarded as the CPU utilization ratio of the cloud server 500 that would happen at the predetermined time.
The determination module 230 determines if the predicted average of the CPU utilization ratio of the cloud server 500 is greater than a predetermined average. The predetermined average may be set as 85%, for example.
The transferring module 250 transfers one or more guest OS from the cloud server 500 to other cloud servers 500 before the predetermined time, in response to a determination that the calculated average of the CPU utilization ratio of the cloud server 500 is greater than the predetermined average. The transferring module 250 transfers the one or more guest OS before the predetermined time, so as to avoid that the CPU utilization ratio of the cloud server 500 exceeds the predetermined time at the predetermined time in future. In one embodiment, the transferring module 250 invokes HYPERVISOR to transfer the one or more guest OS.
In step S10, the obtaining module 210 periodically obtains a CPU utilization ratio of each guest OS installed in each cloud server 500 of the data center 50. The obtaining module 210 obtains the CPU utilization ratio of the guest OS A and the CPU utilization ratio of the guest OS B at the predetermined time (e.g., at 1:00 AM per day.) In addition, the CPU utilization ratio of the guest OS A is saved into the database system 30, and the CPU utilization ratio of the guest OS B is saved into the database system 30.
In step S20, the counting module 220 counts the number of times of obtaining the CPU utilization ratio. In one embodiment, the counting module 240 may increase the number of times of obtaining the CPU utilization ratio by one after every time the CPU utilization ratio is obtained at 1:00 AM. For example, every time the CPU utilization ratio of the guest OS A is obtained at 1:00 AM, the counting module 240 increases the times of obtaining the CPU utilization ratio of the guest OS A by one.
In step S30, the determination module 230 determines if the counted number of the times is equal to a predetermined number. In one embodiment, assuming that the predetermined number is twenty four, if the counted number of the times is also equal to twenty four, the procedure goes to step S40. Otherwise, if the counted number of the times are less than twenty four, and the procedure returns to step S10.
In step S40, the calculation module 240 calculates a predicted average of the CPU utilization ratio for each cloud server 500 if the counted times are equal to a predetermined number. As mentioned above, the average of the CPU utilization ratio of the cloud server 500 is equal to a summation of the average of the obtained CPU utilization ratio of each guest OS installed in the cloud server 500. For example, if the cloud server 500 includes two guest OS A and B, the average of the obtained CPU utilization ratio of the guest OS A is calculated as 50%, the average of the obtained CPU utilization ratio of the guest OS B is calculated as 32%, then the predicted average of the CPU utilization ratio of the cloud server 500 is calculated as 82%. The predicted average of the CPU utilization ratio 82% is regard as the CPU utilization ratio of the cloud server 500 that would happen at 1:00 AM.
In step S50, the determination module 230 determines if the predicted average of the CPU utilization ratio of the cloud server 500 is greater than the predetermined average. In one embodiment, assuming that the predetermined average is 85%, if the predicted average of the CPU utilization ratio of the cloud server 500 is 88%, procedure goes to step S60. Otherwise, if the predicted average of the CPU utilization ratio of the cloud server 500 is 80%, and the procedure ends.
In step S60, the transferring module 250 transfers one or more guest OS from the cloud server 500 to other cloud servers 500 before the predetermined time. The transferring module 250 transfers the one or more guest OS before the predetermined time, so as to avoid that the CPU utilization ratio of the cloud server 500 exceeds the predetermined time at the predetermined time in future. In one embodiment, the transferring module 250 invokes HYPERVISOR to transfer the one or more guest OS. For example, assuming that the cloud server 500 includes two guest OS A and B, if the average of the CPU utilization ratio of the guest OS A is 60%, and the average of the CPU utilization ratio of the guest OS B is 22%, the transferring module 250 invokes HYPERVISOR to transfer the guest OS A to another cloud server 500 before 1:00 AM. Additionally, the transferring module 250 checks the average of the CPU utilization ratio of the another cloud server 500 to make sure that the another cloud server 500 is not overloading.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201110320227.0 | Oct 2011 | CN | national |