Based on the resource of cloud computing platform from moving method and system
Technical field
The invention belongs to field of cloud computer technology, be specifically related to a kind of resource based on cloud computing platform from moving method and system.
Background technology
The resources balance mechanism of CloudStack (cloud computing): when creating on cloud computing platform, start or restart virtual machine, need to distribute corresponding computational resource and storage resources to virtual machine, because cloud computing can monitor the service condition of resource in real time, and according to the result monitored, suitable physical machine is selected to dispose computational resource and the storage resources of virtual machine respectively, so the computational resource of virtual machine and storage resources are often deployed in different physical machine.
Virtual machine live migration technology: thermophoresis, is called again dynamic migration or real-time migration, makes IT operation maintenance personnel operating virtual machine can be moved to another physical machine from a physical machine, does not need time out.It is by the running status of whole virtual machine from a physical machine thermophoresis to another physical machine, and after migration, virtual machine is smoothness run still, and user can not perceive any difference.
AutoCS (cloud management platform): this is based on CloudStackAPI (ApplicationProgrammingInterface, application programming interface) secondary development carrying out, with the addition of more management function, and shield some concrete operations of bottom, the environment for use that the friendly interface provided for final user is powerful.
Inventor finds that in prior art, at least there are the following problems: the resources balance of cloud computing mechanism can not ensure that the computational resource that distributes and storage resources are in same physical machine, if computational resource and storage resources can not bring the operation of physical machine slow on Same Physical machine, cause the efficiency of IO lower simultaneously.
Summary of the invention
Technical matters to be solved by this invention comprises, for the above-mentioned problem that the resources balance mechanism of existing cloud computing exists, there is provided a kind of ensure to apply for the computational resource of virtual machine and storage resources in same physical machine, maximize the efficiency of IO, do not destroy again the resource based on cloud computing platform of the original function of shared storage from moving method and system simultaneously.
Solve technical scheme that the technology of the present invention problem adopts be a kind of resource based on cloud computing platform from moving method, it is characterized in that, comprising:
The computational resource of the configuration for virtual machine and storage resources are mirrored in corresponding physical machine;
Whether the computational resource that inquiry is virtual machine configuration and management resource are mirrored on Same Physical machine, and if not, the physical machine at storage resources place, location, by computational resource in the physical machine moving to storage resources place.
Preferably, the described computational resource of the configuration for virtual machine and storage resources being mirrored in corresponding physical machine also comprises before:
Create cluster virtual machine, and be each virtual machine configuration computational resource and storage resources.
Preferably, for each virtual machine configuration computational resource and storage resources specifically comprise:
Be each virtual machine configuration computational resource and storage resources by cloud computing application programming interfaces.
Preferably, described when the computational resource of virtual machine and storage resources are mirrored in corresponding physical machine, also comprise:
The address of the physical machine that the record address of virtual machine and computational resource and storage resources are mirrored to respectively, to locate the physical machine at storage resources place.
Preferably, the described computational resource of virtual machine and storage resources being mirrored in corresponding physical machine also comprises before:
The loading condition of each physical machine is detected, mirror image virtual machine from the lightest physical machine of load by cloud management platform.
Further preferably, computational resource is from the physical machine that load is the lightest in the physical machine moving to storage resources place, carries out from migration the computational resource of virtual machine institute mirror image.
Preferably, the computational resource of described inquiry virtual machine and management resource whether on Same Physical machine, if virtual machine normally works, if not computational resource in the physical machine moving to storage resources place after also comprise:
Periodically the computational resource of each virtual machine and the mirror image situation of storage resources is detected by cloud management platform.
Solve technical scheme that the technology of the present invention problem adopts be a kind of resource based on cloud computing platform from migratory system, it comprises:
Resource management module, for configuring corresponding computational resource and storage resources for each virtual machine;
Whether resources detection module, be mirrored to the physical machine corresponding with it for the computational resource and storage resources detecting each virtual machine;
Resource migration module, moves for the computational resource that detected by resources detection module and the carrying out of storage resources not on Same Physical machine, computational resource is migrated in the physical machine at storage resources place.
Preferably, resource record module, for recording the address of each virtual machine, and the computational resource of each virtual machine and management resource are being mirrored to the address in physical machine.
Beneficial effect of the present invention:
Resource based on cloud computing platform of the present invention from moving method and system according to the actual requirements, the resources balance mechanism solving cloud computing can not ensure computational resource and the problem of storage resources in same physical machine of distribution, the computational resource of the virtual machine of guarantee application and storage resources are in same physical machine, maximize the efficiency of IO, do not destroy again to share storing original function simultaneously.
Accompanying drawing explanation
Fig. 1 is the process schematic from migration of embodiments of the invention 1;
Fig. 2 is that the resource based on cloud computing platform of embodiments of the invention 1 is from the process flow diagram of moving method.
Embodiment
For making those skilled in the art understand technical scheme of the present invention better, below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.
The scene of the present embodiment application mainly comprises following four kinds:
The first, when user creates virtual machine time, the resources balance mechanism of cloud computing can make computational resource and storage resources be assigned in different physical machine (HOST).
The second, when user restarts virtual machine time, cloud computing will the computational resource of balanced virtual machine and storage resources again, and now computational resource and storage resources are assigned in different physical machine.
3rd, under some abnormal conditions, such as fissure, the computational resource of virtual machine may occur from migration.
4th, when the physical machine of storage virtual machine mirror image delays machine, the storage resources of virtual machine also may occur from migration.
Wherein, the position fixing process of storage resources is in the present embodiment: according to the existing mechanism of Glusterfs, it is by a hash algorithm by the UUID of stochastic generation (general unique identifier), then obtain a physical machine list, thus determine the physical machine position at storage resources place.And in the present embodiment, be by before being called by hash algorithm at the UUID generated, its value is intercepted and captured, is saved in database.Call the API that Glusterfs provides again, with the UUID intercepted and captured for parameter, go to obtain the physical machine list at storage resources place thus complete the location of storage resources, after having located, by thermophoresis, computational resource having been moved on storage resources.Based on the interface exploitation API that the file system (as GFS, GoogleFileSystem, Google's file system) of other types provides, the location of storage resources also can be carried out.
Moving method and the system of concrete resource are as described below.
Embodiment 1:
Shown in Fig. 1 and 2, the present embodiment provides a kind of resource based on cloud computing platform from moving method, and it comprises the steps:
Step one, establishment cluster virtual machine, and be each virtual machine configuration computational resource and storage resources.
What this step was concrete can be: cloud computing platform detects computational resource and the storage resources of virtual machine image, analyze each physical machine loading condition, from the physical machine that load is the lightest, start virtual machine, user calls cloud computing API (application programming interfaces) by cloud management platform configures corresponding computational resource and storage resources for each virtual machine.
Step 2, the computational resource of virtual machine and storage resources to be mirrored in corresponding physical machine.
While this step is carried out, cloud management platform will record the address of the physical machine that the address of virtual machine and computational resource and storage resources are mirrored to respectively automatically, middlely judges computational resource and storage resources whether by through expecting in same physical machine so that follow-up.
Step 3, by the cloud management platform inquiry computational resource of virtual machine and management resource whether on Same Physical machine, if then perform next step, then after computational resource is in the physical machine moving to storage resources place, perform next step more if not.
Wherein, when occurring in time moving, be from the virtual machine corresponding to the lightest physical machine of load from migration, computational resource and storage resources are moved on Same Physical.
Step 4, virtual machine normally work.
Step 5, cloud computing platform will periodic queries mechanism, periodically detect the computational resource of virtual machine and the position of storage resources, if both are not in same physical machine, immediately trigger computational resource from migration.
The method of the present embodiment, according to the actual requirements, the resources balance mechanism solving cloud computing can not ensure computational resource and the problem of storage resources in same physical machine of distribution, the computational resource of the virtual machine of guarantee application and storage resources are in same physical machine, maximize the efficiency of IO, do not destroy again to share storing original function simultaneously.Simultaneously, based on cloud computing RESTAPI, and Glusterfs (a kind of file system of Gluster company research and development, it is the combination on various different storage server, these servers are merged mutually by Ethernet or infinite bandwidth technology Infiniband and remote direct memory access RDMA, the parallel file system network that final of being formed is large) the monitoring API that provides, utilize the distribution situation of cloud management platform monitors computational resource and storage resources in the whole life cycle of virtual machine, real-time Adjustable calculation distribution of resource, to reach the object that computational resource and storage resources coexist in same physical machine.
Embodiment 2:
The present embodiment provides a kind of resource of cloud computing platform from migratory system, and it comprises:
Resource management module, for configuring corresponding computational resource and storage resources for each virtual machine; Whether resources detection module, be mirrored to the physical machine corresponding with it for the computational resource and storage resources detecting each virtual machine; Resource migration module, moves for the computational resource that detected by resources detection module and the carrying out of storage resources not on Same Physical machine, computational resource is migrated in the physical machine at storage resources place.
When the resource based on cloud computing platform of the present embodiment also comprises from migratory system: resource record module, for recording the address of each virtual machine, and the computational resource of each virtual machine and management resource are being mirrored to the address in physical machine.
The system of the present embodiment can carry out work according to the method described in embodiment 1, be not described in detail at this.
Be understandable that, the illustrative embodiments that above embodiment is only used to principle of the present invention is described and adopts, but the present invention is not limited thereto.For those skilled in the art, without departing from the spirit and substance in the present invention, can make various modification and improvement, these modification and improvement are also considered as protection scope of the present invention.