Patent Publication Number: US-2013232487-A1

Title: Control computer and method for managing virtual machine

Description:
BACKGROUND 
     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. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a schematic diagram of one embodiment of a control computer electronically connected with a data center. 
         FIG. 2  is a schematic diagram of one embodiment of the control computer including a virtual machine management system. 
         FIG. 3  is a schematic diagram of function modules of the virtual machine management system included in the control computer. 
         FIG. 4  is a flowchart of one embodiment of a method for managing virtual machines installed in physical machines using the control computer. 
         FIGS. 5A-5E  are schematic diagrams of an example of increasing a size of a virtual machine installed in a physical machine. 
     
    
    
     DETAILED DESCRIPTION 
     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. 
       FIG. 1  is a schematic diagram of one embodiment of a control computer  2  electronically connected with a data center  5  through a network  4 . The data center  5  includes a plurality of physical machines (e.g. servers)  50 . For example, the network  4  may be the Internet, an intranet, or any other relevant network. 
     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  FIG. 5A , the virtual machines “iVM-S,” and “iVM-M” are installed in the left physical machine “Host01,” the virtual machine “iVM-M” is installed in the right physical machine “Host02”. In one embodiment, the virtual machine include a small type (e.g., iVM-S), a medium type (e.g., iVM-M), and a big type (e.g., iVM-XL). The type of the virtual machine is determined according to computing resources (e.g., CPU or hard disk) occupied by the virtual machine. For example, the big type of the virtual machine occupies more computing resources than the medium type and the small type. 
       FIG. 2  is a schematic diagram of one embodiment of the control computer  2  including a VM management system  24 . The control computer  2  further includes a display device  20 , an input device  22 , a storage device  23 , and at least one processor  25 . The control computer  2  may be a server or any other computing device.  FIG. 2  illustrates only one example of the control computer  2  that may include more or fewer components than as illustrated, or a different configuration of the various components may exist in other embodiments. 
     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. 
       FIG. 3  is a schematic diagram of function modules of the VM management system  24  included in the control computer  2 . In one embodiment, the VM management system  24  may include one or more modules, for example, a command receiving module  201 , a searching module  202 , a creating module  203 , a synchronizing module  204 , and a deleting module  205 . 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, such as, Java, C, or assembly. 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 medium include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives. 
       FIG. 4  is a flowchart of one embodiment of a method for managing virtual machines installed in the physical machines  50  using the control computer  2 . Depending on the embodiment, additional steps may be added, others removed, and the ordering of the steps may be changed. 
     In step S 1 , 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  FIG. 5A , the first virtual machine may be the virtual machine “iVM-S” (e.g., the left one) in the physical machine “Host01”. 
     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 S 2 , 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 S 3 . 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 S 3 , 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 S 2 ). For example, as shown in  FIG. 5A , the initial size of the first virtual machine “iVM-S” is (CPU:1, RAM:2 GB, HD:200 GB), the specified size of the second virtual machine “iVM-XL” is (CPU:8, RAM:16 GB, HD:1600 GB). If the physical machine “Host02” has enough computing resources for creating the second virtual machine “iVM-XL,” the second virtual machine is created in “Host02” as shown in  FIG. 5B   
     In step S 4 , 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  FIG. 5C ). In one embodiment, the synchronizing module  204  first copies the computing resources of idle applications in the first virtual machine to the second virtual machine, and copies the computing resources of working applications in the first virtual machine to the second virtual machine when the working applications have ended. In one embodiment, the first time is determined to be a creation time of the second virtual machine “iVM-XL”, or determined to be a total time of the creation time and a first preset delay time (i.e., two seconds). 
     In step S 5 , 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  FIG. 5D ). In one embodiment, the first virtual machine and the second virtual machine are running synchronously in the parallel mode, namely, the working application is executed in both the first virtual machine “iVM-S” and the second virtual machine “iVM-XL” at the same time such that the services provided by the first virtual machine “iVM-S” are not interrupted when the initial size of the first virtual machine “iVM-S” is adjusted (e.g., increased or decrease). 
     In step S 6 , 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 S 7 , 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  FIG. 5E ). 
     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.