Summary of the invention
For overcoming defects, the invention provides a kind of method that in cloud computing system, creates virtual machine, in cloud computing system, create in the process of virtual machine saving resource how, alleviate the technical matters of workload.
The cloud computing operating system that the present invention relates to has related to virtual machine altogether according to actual scene, virtual data center, three kinds of business objects of Physical Extents.Business object can be divided into: essential information, configuration parameter information, incidence relation information.Essential information is described the predicable of business object, such as title, type etc.; Configuration parameter information is described the particular attribute of business object, such as the number of CPU, and available number, alarm red line number etc.; Incidence relation information is described the incidence relation that exists between business object and type thereof etc.
The cloud computing operating system that the present invention relates to distributes two kinds of allocation strategies commonly used of virtual data center and Physical Extents: performance is preferential, energy conservation priority.The virtual machine that performance preferentially refers to establishment preferentially selects to provide virtual data center and the Physical Extents of maximum performance.Energy conservation priority refers to when creating virtual machine in the situation that satisfy preferential minimum virtual data center and the Physical Extents of energy consumption of selecting of user's request.
The present invention is by pre-establishing allocation strategy, operation management person's assignment of allocation strategy, the then virtual data center and the Physical Extents that satisfy condition according to policy selection of system.
The invention provides a kind of method that in cloud computing system, creates virtual machine, it is characterized in that, comprising: the particular attribute that described virtual machine is set; Obtain the Physical Extents information of described cloud computing system; And according to described Physical Extents information and described particular attribute, in described cloud computing system, select Physical Extents to create described virtual machine.
Preferably, the particular attribute that described virtual machine is set comprises: the business object of described virtual machine is set, and wherein, described business object comprises total attribute, particular attribute and incidence relation attribute.
Preferably, the Physical Extents information of obtaining described cloud computing system comprises: virtual data center information and the Physical Extents information of obtaining described cloud computing system, and according to described Physical Extents information and described particular attribute, selecting Physical Extents to create described virtual machine in described cloud computing system further comprises: according to described virtual data center information, described Physical Extents information and described particular attribute, the Physical Extents of selecting to meet described particular attribute requirement in described cloud computing system creates described virtual machine.
Preferably, described method also comprises: resource allocation policy is set, and according to described Physical Extents information and described particular attribute, selecting Physical Extents to create described virtual machine in described cloud computing system further comprises: according to described Physical Extents information, described particular attribute and described resource allocation policy, select Physical Extents to create described virtual machine in described cloud computing system.
Preferably, according to described Physical Extents information and described particular attribute, selecting Physical Extents to create described virtual machine in described cloud computing system further comprises: according to described Physical Extents information and described particular attribute, select to meet the Physical Extents of described particular attribute requirement in described cloud computing system; In the Physical Extents that meets described particular attribute requirement, select the Physical Extents that meets described resource allocation policy according to described resource allocation policy; And utilize the Physical Extents that meets described resource allocation policy to create described virtual machine.
Preferably, described resource allocation policy is the performance preference strategy, and the Physical Extents that meets described resource allocation policy is the Physical Extents that meets in the server that surplus resources is maximum in the Physical Extents that described particular attribute requires.
Preferably, described resource allocation policy is the power consumption preference strategy, and the Physical Extents that meets described resource allocation policy is to meet in the Physical Extents that described particular attribute requires so that the minimum Physical Extents of occupied server in the described cloud computing system.
Preferably, according to described Physical Extents information and described particular attribute, selecting Physical Extents to create described virtual machine in described cloud computing system comprises: all the physics partition informations in the described cloud computing system of searching loop, the Physical Extents of selecting wherein to meet described particular attribute creates described virtual machine.
Preferably, meet resource that the Physical Extents of described particular attribute requirement provides more than or equal the desired resource of described particular attribute.
The present embodiment has been introduced the concept of resource allocation policy, pass through the present embodiment, not only can be by directly inquiring about the information of Physical Extents, search out the Physical Extents that is fit to virtual machine, thereby improved efficient, saved resource, can also be according to the resource allocation policy that presets, search out the Physical Extents that meets system requirements and create virtual machine, so that constructive process is more flexible, more meet system's needs.
Embodiment
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for description and interpretation the present invention, is not intended to limit the present invention.
Cloud computing operating system involved in the present invention has related to virtual machine according to actual scene, virtual data center, three kinds of business objects of Physical Extents.Business object can be divided into essential information (i.e. total attribute), configuration parameter information (being particular attribute) and incidence relation information (incidence relation attribute).Essential information is described the total attribute of business object, such as title, type etc.; Configuration parameter information is described the particular attribute of business object, such as the number of CPU, available number and alarm red line number etc.; Incidence relation information is described the incidence relation that exists between business object and type thereof etc.
In the present invention, virtual machine refer to by software simulation have the complete hardware system function, operate in a complete computer in the complete isolation environment.Virtual data center is for making things convenient for the resource in the management system, is different groups with various resource division, and a group is a virtual data center.Physical Extents is divided into physical resource subregion with resource according to the actual deployment situation for the keeper.Operation management person is the keeper of calculation services door, the user of facing cloud computing center, the functions such as management of realization virtual resource.
Fig. 1 is the overview flow chart according to the embodiment of the method that creates virtual machine in cloud computing system of the present invention.In Fig. 1:
Step S100: the particular attribute that virtual machine is set.The user can realize this setting steps by browser.Wherein, the user can not only arrange the peculiar information of virtual machine, and total attribute and the incidence relation attribute of virtual machine also is set.
Step S102: the Physical Extents information of obtaining cloud computing system.Wherein, the user can obtain the virtual data center information of cloud computing system, the Physical Extents information in this virtual data center information of reentrying.In other words, on Physical Extents, first level logical layer-virtual data center can be arranged.For example, the first level logical layer is arranged below the cloud computing system, comprise a plurality of virtual data centers in this logical layer, and be Physical Extents below virtual data center, each virtual data center includes a plurality of Physical Extents.
Step S104: according to Physical Extents information and particular attribute, in cloud computing system, select Physical Extents to create virtual machine.In a preferred embodiment, all the physics partition informations in can the searching loop cloud computing system, the Physical Extents of selecting wherein to meet particular attribute creates virtual machine.
By the described method of the present embodiment, can search out the Physical Extents that is fit to virtual machine, thereby improve efficient by directly inquiring about the information of Physical Extents, saved resource.
Fig. 2 is the particular flow sheet according to the embodiment of the method that creates virtual machine in cloud computing system of the present invention.In Fig. 2:
Step S200: the business object of virtual machine is set, and wherein, business object comprises total attribute, particular attribute and incidence relation attribute.
Step S202: virtual data center information and the Physical Extents information of obtaining cloud computing system.Wherein, virtual data center information can directly be faced the user, and the user can obtain first virtual data center information, in the Physical Extents information of obtaining wherein.
Step S204: resource allocation policy is set.Wherein, resource allocation policy can comprise performance preference strategy and power consumption preference strategy.
When selecting the performance preference strategy, the Physical Extents that will meet resource allocation policy is chosen as the Physical Extents that meets in the server that surplus resources is maximum in the Physical Extents that particular attribute requires.Specifically, since meet resource that the Physical Extents of particular attribute requirement provides more than or equal the desired resource of particular attribute, therefore, if a certain amount of resource of customer requirements, cloud computing system can be distributed to it more than the resource of its request, like this, if selectivity is preferential, just the maximum server of last resource can be in a plurality of servers, selected, thereby more resource the virtual machine that the user will create can be distributed to.
When selecting the power consumption preference strategy, the Physical Extents that will meet resource allocation policy is chosen as and meets in the Physical Extents that particular attribute requires so that the minimum Physical Extents of occupied server in the cloud computing system.In other words, minimum for the number that guarantees to start shooting if a plurality of requests are arranged simultaneously, can the desired resource of a plurality of requests be arranged in the same server as far as possible, like this, so that the shared server of a plurality of request is minimum, thereby reduced power consumption.
Step S206: according to Physical Extents information, particular attribute and resource allocation policy, in cloud computing system, select Physical Extents to create virtual machine.This step can specifically comprise following step: first according to Physical Extents information and particular attribute, in cloud computing system, select to meet the Physical Extents of particular attribute requirement, then select the Physical Extents that meets resource allocation policy according to resource allocation policy in the Physical Extents that meets the particular attribute requirement, last resulting Physical Extents creates virtual machine.
The present embodiment has been introduced the concept of resource allocation policy, pass through the present embodiment, not only can be by directly inquiring about the information of Physical Extents, search out the Physical Extents that is fit to virtual machine, thereby improved efficient, saved resource, can also be according to the resource allocation policy that presets, search out the Physical Extents that meets system requirements and create virtual machine, so that constructive process is more flexible, more meet system's needs.
Fig. 3 is the particular flow sheet according to the example of the method that creates virtual machine in cloud computing system of the present invention.Wherein:
The defining virtual machine, virtual data center, three kinds of business objects of Physical Extents, the definition allocation performance is preferential, two kinds of strategies of energy conservation priority.After getting access to user's request, parse virtual machine object.The system queries current available resource chooses allocation strategy to call this method according to operation management person, choose suitable virtual data center and Physical Extents after, be recorded in the database.
The business object that relates to and allocation strategy:
1) business object of virtual machine
public?VmApplicationDetail?extends?VmTypeDetail;
2) business object of virtual data center
public?VirtualDataCenter?implements?java.io.Serializable;
3) business object of Physical Extents
public?PhyPartition?implements?java.io.Serializable;
4) business object of the preferential strategy of performance
public?HighPerformancePolicy?implements?PolicyType;
5) business object of the preferential strategy of power consumption
Public?EfficientGreenPolicy?implements?PolicyType;
The performing step of this example:
1) from user's request, parses the business object VmApplicationDetail of virtual machine;
2) obtain allocation strategy HighPerformancePolicy or the EfficientGreenPolicy that operation management person chooses;
3) obtain the current available resource List<VirtualDataCenter of system 〉, List<PhyPartition 〉
4) available resources of searching loop system according to the configuration parameter of user's request and operation management person's preset dispense strategy, are selected virtual data center and Physical Extents that configuration satisfies condition.
This example has been introduced the concept of resource allocation policy, pass through the present embodiment, not only can be by directly inquiring about the information of Physical Extents, search out the Physical Extents that is fit to virtual machine, thereby improved efficient, saved resource, can also be according to the resource allocation policy that presets, search out the Physical Extents that meets system requirements and create virtual machine, so that constructive process is more flexible, more meet system's needs.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.