1. Technical Field
Embodiments of the present disclosure relate to cloud computing technology, and particularly to a control computer and method for accessing data of virtual machines installed in host computers.
2. Description of Related Art
In cloud computing technology, one container includes a plurality of host computers, and a plurality of virtual machines (VMs) are installed in each host computer for providing multiple services to users. A control computer is used to manage the virtual machines of the host computers by detecting attributes/statuses (i.e., memory usage rate) of the virtual machines at a specific time interval (i.e., ten minutes). However, the obtaining of the attributes/statuses data of the virtual machine may be delayed when a network connection between the control computer and the host computers is busy due to a network congestion. Therefore, an efficient method for managing virtual machines installed in host computers 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, the host computers 5 are located in a container of a specific space. Each host computer 5 has a plurality of virtual machines (VMs) installed for providing service to a user of the host computer 5. In one embodiment, the user can divide the host computers 5 into different groups, and create a folder to store attribute data (e.g., computer name and description) of the host computers 5 in each group. For example, the attribute data of the host computers of “Host1”, “Host2”, “Host3”, “Host4”, and “Host5” are stored in a first folder, and the attribute data of the host computers of “Host6”, “Host7”, “Host8”, “Host9”, and “Host10” are stored in a second folder.
The database 3 stores attribute data of the virtual machines which are persistent at normal time (hereinafter referred to as “persistent attribute data”). Thus, the control computer 2 can directly obtain the persistent attribute data from the database 3 when the control computer 2 detects statuses of the virtual machines. For example, the persistent attribute data may include a name and an identifier (ID) of the virtual machine. The persistent attribute data can be updated manually. The attribute data further includes data that are changeable at any moment (hereinafter referred to as “changeable attribute data”), such as a resource usage rate of the virtual machine. For example, the resource usage rate may include a central processing unit (CPU) usage rate, a network bandwidth usage rate, a hard disk usage rate, and a memory usage rate of the host computer 5 occupied by the virtual machines.
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 input.
The management system 24 is used to send a control command to the host computers 5, and obtain the attribute data of the virtual machines from the database 3 directly or from the host computers 5 through the network 4 according to the control command. In one embodiment, the 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 management system 24 will be given in the following paragraphs.
In step S10, the command generating module 201 generates a control command for accessing the virtual machines of one host computer 5. In one embodiment, the control command includes a first type for querying or updating the persistent attribute data of the virtual machines, and a second type for querying the changeable attribute data of the virtual machines. A plurality of host computers 5 may be accessed simultaneously in other embodiments.
In one embodiment, the first type of the control command is generated after a first specific time interval (i.e., ten minutes), the second type of the control command is generated after a second specific time interval (i.e., one minute).
In step S11, the command determining module 202 determines a command type of the control command. As mentioned above, the command type includes the first type and the second type. If the power management command is the first type, steps S21-S25 are executed. If the power management command is the second type, steps S31-S33 are executed.
In step S21, if the command type is the first type, the command determining module 202 determines whether the control command is a data query command or a data update command. If the control command is the data query command, step S22 is executed. If the control command is the data update command, steps S23-S25 are executed.
In step S22, if the command type is the first type and the control command is the data query command, the data obtaining module 203 directly obtains the attribute data of the first type of the virtual machines from the database 3 of the control computer 2, and the procedure goes to step S25. Because the attribute data of the first type (i.e., persistent data) can be directly obtain from the database 3, the acquirement of the attributes/statuses data of the virtual machine cannot be delayed even though a network connection between the control computer 2 and the host computers 5 is busy due to a network congestion, and a quantity of the control commands sent to the host computers 5 is reduced.
In step S23, if the command type is the first type and the control command is the data update command, the command generating module 201 transmits the control command to a virtual machine manager of the host computer 5 to execute the data update command. As shown in
In step S24, the data obtaining module 203 receives the updated attribute data of the one or more virtual machines returned from the virtual machine manager of the host computer 5. Then, the data updating module 204 updates corresponding attribute data of the virtual machines in the database 3 with the updated attribute data, such the name of the virtual machine.
In step S25, the data obtaining module 203 records a process result of the first type of the control command. In one embodiment, the process result includes a success message or a failure message of the first type of the control command. For example, if the data obtaining module 203 does not obtain the attribute data of the first type of the virtual machines from the database 3, the failure message is output on the display device 20 by display in a textbox for example.
In step S31, if the command type is the second type, the command generating module 201 transmits the control command to the virtual machine manager of the host computer 5 to execute the control command. The virtual machine manager of the host computer 5 obtains the attribute data of the second type (e.g., the CPU usage rate) of the virtual machines installed in the host computer 5 according to the control command, and returns the attribute data of the second type of the virtual machines to the control computer 2.
In step S32, the data obtaining module 203 receives the attribute data of the second type of the virtual machines returned from the virtual machine manager of the host computer 5, and displays the received attribute data on the display device 20.
In step S33, the data obtaining module 203 records a process result of the second type of the control command. In one embodiment, the process result includes a success message or a failure message of the first type of the control command. For example, if the data obtaining module 203 does not obtain the CPU usage rate of the virtual machines from the host computer 5, the failure message is output on the display device 20 by display in a textbox for example.
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 |
---|---|---|---|
100125244 | Jul 2011 | TW | national |