1. Technical Field
Embodiments of the present disclosure relate to cloud computing technology, and particularly to a control computer and method for managing virtual machines installed in physical machines.
2. Description of Related Art
In cloud computing technology, a data center includes a plurality of physical machines (e.g., servers), where each physical machine is installed with a plurality of virtual machines (VMs) that provide multiple services to users. Each virtual machine occupies some computing resources (e.g., CPU and hard disks) of the physical machine. The computing resources occupied by the virtual machine need to be adjusted (increased or decreased) when the computing resources of the virtual machine are too many (need to decrease) or insufficient (need to increase).
However, the virtual machine is suspended during the adjustment process, and cannot provide services to the users. Therefore, an efficient method for managing virtual machines installed in physical machines is desired.
All of the processes described below may be embodied in, and fully automated via, functional code modules executed by one or more general purpose electronic devices or processors. The code modules may be stored in any type of non-transitory computer-readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory computer-readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive or other suitable storage medium.
In one embodiment, each physical machine 50 is installed with a plurality of virtual machines (VMs) that provide services to users. For example, as shown in
The display device 20 may be a liquid crystal display (LCD) or a cathode ray tube (CRT) display, and the input device 22 may be a mouse, a keyboard, a touch screen, and/or a touchpad used for inputting data.
The VM management system 24 is used to increase or decrease a size of a designated virtual machine which is running without suspending the virtual machine when computing resources (e.g., CPU or hard disk) of the virtual machine are too many (need to decrease) or insufficient (need to increase). For example, the computing resources may include central processing units (CPUs), memory, and hard disks occupied by the virtual machine. In one embodiment, the VM management system 24 may include computerized instructions in the form of one or more programs that are executed by the at least one processor 25 and stored in the storage device 23 (or memory). A detailed description of the VM management system 24 will be given in the following paragraphs.
In step S1, the command receiving module 201 receives a control command for adjusting an initial size of a first virtual machine installed in one of the physical machines 50, and receives a specified size of a second virtual machine used to replace the initial size of the first virtual machine. In one embodiment, the control command includes a first type for increasing the initial size of the first virtual machine and a second type for decreasing the initial size of the first virtual machine. For example, the initial size of the first virtual machine may include a number of the CPU allocated to the first virtual machine, the specified size of the second virtual machine may include a number of the CPU specified by a user.
The specified size of the second virtual machine is greater than the initial size of the first virtual machine if the control command is the first type, and the specified size of the second virtual machine is less than the initial size of the first virtual machine if the control command is the second type. For example, as shown in
For example, if a resource usage rate of the first virtual machine is greater than a first value (e.g., 90%), namely the computing resource is determined to be insufficient, the command receiving module 201 receives the first type of the control command to increase the initial size of the first virtual machine. If the resource usage rate of the first virtual machine is less than a second value (e.g., 20%), namely it is determined too many computing resources are attached, the command receiving module 201 receives the second type of the control command to decrease the initial size of the first virtual machine. The resource usages rate are selected from the group including a CPU usage rate, a hard disk usage rate, and a memory usage rate of the physical machine 50 occupied by the first virtual machine.
In step S2, the searching module 202 searches for a physical machine 50 that has enough computing resources for creating the second virtual machine of the specified size, and determines whether the physical machine 50 having enough computing resources has been found. If the physical machine 50 having enough computing resources has been found, the procedure goes to step S3. If the physical machine 50 having enough computing resources has not been found, the searching module 202 outputs a failure message on the display device 20, then the procedure ends.
In step S3, the creating module 203 creates the second virtual machine of the specified size in a found physical machine 50 (i.e., the physical machine found in step S2). For example, as shown in
In step S4, the synchronizing module 204 copies the computing resources of the first virtual machine “iVM-S” to the second virtual machine “iVM-XL” at a first time (refers to
In step S5, the synchronizing module 204 controls the first virtual machine “iVM-S” and the second virtual machine “iVM-XL” running in a parallel mode until all of the computing resources of the first virtual machine “iVM-S” have been copied to the second virtual machine “iVM-XL” (refers to
In step S6, the synchronizing module 204 stops parallel running of the first virtual machine “iVM-S” and the second virtual machine “iVM-XL” at a second time. In one embodiment, the second time is determined to be a finish time when all of the computing resources of the first virtual machine “iVM-S” have been copied to the second virtual machine “iVM-XL”, or determined to be a total time of the finish time and a second preset delay time (e.g., four seconds).
In step S7, the deleting module 205 deletes the first virtual machine “iVM-S”, and releases the computing resource of the first virtual machine “iVM-S” (refers to
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
201110378751.3 | Nov 2011 | CN | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN12/73122 | 3/27/2012 | WO | 00 | 11/7/2012 |