A kind of in virtualized environment the method and system of I/O equipment reconstruction
Technical field
The present invention relates to virtualized environment, relate in particular to a kind of in virtualized environment the method and system of I/O equipment reconstruction.
Background technology
Intel Virtualization Technology results from the sixties in last century, and IBM has proposed virtualized notion, and this technology is applied to the System/370 system of IBM.Up to the present, Intel Virtualization Technology has been applied to a lot of industries and field, and in future use widely will be arranged.By Intel Virtualization Technology, can improve the utilization factor of server, improve the stability of service and the portability of robustness and software.
Computer I/O (I/O) technology is a crucial gordian technique all the time in development of computer.Its technical characteristic has determined the processing power of Computer I/O, and then has determined the overall performance and the applied environment of computing machine.Fundamentally, no matter still in the future now, the I/O technology all will restrict the application and the development of computer technology, especially in high-end calculating field.
To carry out virtually to I/O equipment, just need the behavior of monitoring user virtual machine, intercept and capture the I/O operation of user virtual machine,, send to device driver then, finish operation equipment by device driver to its analysis interpretation in addition.Wherein, according to whether revising Guest OS (client operating system), can be the virtual two big classes that are divided into of local device: the I/O device virtualization of the I/O device virtualization in fully virtualized and half in virtual.
Partly virtual is the notion that Cambridge University proposes, and what accompany with it is the research and development of Xen project.The same with VmWare, Xen also is system-level virtual software.Since Xen was born, it had just obtained paying close attention to widely and using with the performance performance of excellence rapidly, and half virtualized notion also is rooted in the hearts of the people.Its appearance is a result of study how to improve the fully virtualized bigger performance loss that brings.
Fig. 1 is the virtualized architecture of I/O among the Xen.The bottom is a hardware resource among the figure, and Xen VMM runs on the hardware resource, hardware resource is managed, and virtual several virtual hardware environments that dissolves.At Xen VMM (Virtual Machine Monitor), operation a plurality of Guest OS (is example with the XenLinux system) above the monitor of virtual machine.There is not the application layer that the user application of revising runs on Guest OS.Inner nuclear layer operation at Guest OS has front-end equipment driver (Front-End), and user application is operated equipment by the front-end equipment driver.And the front-end equipment driver is not really operated equipment, and it is realized real operation of equipment by rear end equipment driver (Back-End).Front-end equipment driver (Front-End) lays respectively among VMI, VM2, the VM3, and VM1, VM2, VM3 are respectively user virtual machine.Rear end equipment driver (Back-End) is arranged in VM0, and VM0 is franchise virtual machine.(the VM0 here is meant a special virtual machine in the xen virtualized environment to VM0, it must exist, and the keeper manages virtual machine by the connection interface that this virtual machine provides) be a special Guest OS, also be referred to as privileged Guest OS.Why be referred to as privileged Guest OS, be because:
1.VMM hypervisor interfaces interface program, part resource manager, Guest OS supervisor control program in the application layer operation of VM0, also are that VM0 is the Guest OS that has administration authority all;
2.VM0 can directly conduct interviews, also be the authority that it has management and operates all peripherals to peripherals.
In the kernel of VM0, moved the service of a rear end equipment driver.Its responsibility is exactly the I/O operation requests that acceptance is sent from other Guest OS, hand to the real device driver among the VM0, finish operation by real device driver, and an operating result that returns from real device driver is returned to the front-end equipment driver equipment.
In virtualized use, an outstanding feature is arranged: the I/O storage resources of user applies many times major part is wasted.This be because, the user is in using the process of virtual machine, its demand to the I/O storage resources changes.Such as, the user has found a good movie download website in certain period, want to download a lot of films, at this moment, the storage space that just needs to reach tens G even tens G up to a hundred is used for depositing film.And the user has deleted them after finishing watching these films, and at this moment, the I/O storage resources of these One's name is legions is just of no use.And the user has enough spaces to deposit when can guarantee that oneself downloads movies, and must apply for according to the amount of space of own maximum possible use during application I/O storage resources.And these spaces except some the time be used, in the time of most of all by idle waste.
In order to address this problem, the Xen virtual platform provides the mechanism of virtual i/o equipment hot swap.Its core concept is exactly to feel own memory space inadequate as the user, during the more storage space of needs, files an application to the system manager; After the system manager receives user's application, check whether also have enough idle storage space,, then manually move the hot plug instruction, in user virtual machine, add new I/O storage resources, notify the user then if having; The user carries out initialization to new I/O storage resources in virtual machine, the deployment file system is installed to new storage space in the root file system of virtual machine then.Like this, the user just can use new storage space.Do not need the storage space of these new interpolations the user after, just from the root file system of own virtual machine, unload new I/O equipment, reporting system keeper then; The system manager is after having notice, and the new virtual i/o equipment unloading distributing to user virtual machine joins its spatial information in the hollow storage space then.
Though above method provides by the mechanism that is required to be user's memory allocated space, there is following problem:
(1) not to user transparent.The user needs manual reporting system keeper, and will carry out initialization and installment work to initiate virtual i/o equipment.
(2) user there is very high requirement.After new virtual i/o equipment added into user virtual machine, the user needed and can carry out initialization to new I/O equipment, the deployment file system, and it is installed in the root file system of user virtual machine.And when the user no longer needs new storage space, need initiate storage space be unloaded from the root file system of user virtual machine, then this new I/O equipment is uninstalled from user virtual machine.These all have very high requirement to the user, need the user that the management and the operation technique of operating system and I/O equipment are had very deep understanding.And most of users often do not reach so high requirement, thereby have seriously limited the extensive use of this method.
(3) make the system manager increase very big work load.In the interpolation and uninstall process of virtual i/o equipment, all need system manager's participation, for the system manager has increased very big workload.If system scale is huger, number of users is numerous, and the work load of Zeng Jiaing is that the system manager is difficult to stand therefrom.If increase considerably system manager's quantity, relate to the cost of human resources that increases day by day, cost of system maintenance will have increase by a relatively large margin.
(4) because the increase of system manager's work load, the system manager may can not carry out instant corresponding to the request that the user proposes, thereby makes the user can not be served faster the demand of new storage space.This can reduce system to quality of services for users, thereby it is discontented that the user is produced.Simultaneously, the user also can reduce the request to this service because service can not satisfy rapidly, thereby has also limited the use of this kind method.
Summary of the invention
In order to solve above-mentioned technical matters, provide a kind of in virtualized environment the method and system of I/O equipment reconstruction, its purpose is, overcomes the shortcoming of the existing I/O equipment hot swap of Xen virtual platform set forth above mechanism.
The invention provides a kind of in virtualized environment the method for I/O equipment reconstruction, described virtualized environment is the Xen virtualized environment, comprising:
Step 1, user virtual machine detect user's the idle storage resources of I/O less than critical value, then send the request of application I/O storage resources to franchise virtual machine, wherein comprise the quantity of application I/O storage resources;
Step 2, franchise virtual machine are taken out the corresponding number of I/O storage resources of user virtual machine application and are distributed to user virtual machine from the I/O storage resources of free time;
Step 3, user virtual machine is carried out initialization to corresponding number of I/O storage resources, and the deployment file system is installed to then in the root file system of user virtual machine and uses for the user.
In the step 1, user virtual machine is according to the quantity of the spending rate of its idle I/O storage resources decision to franchise virtual machine application I/O storage resources.
In the step 1, storage resources behaviour in service Monitoring Service program is installed in user virtual machine, be used to detect the quantity of user's the idle storage resources of I/O, and send the request of application I/O storage resources to franchise virtual machine during less than critical value at the idle storage resources of the I/O that detects the user;
In the step 3, storage resources behaviour in service Monitoring Service program also is used for corresponding number of I/O storage resources is carried out initialization, and the deployment file system is installed to then in the root file system of user virtual machine and uses for the user.
In the step 2, franchise virtual machine inserts corresponding number of I/O storage resources heat in the user virtual machine, and the notice user virtual machine.
In the step 2, the Storage Resource Management (SRM) service routine is installed in franchise virtual machine, the corresponding number of I/O storage resources that is used for taking out from the I/O storage resources of free time the user virtual machine application is distributed to user virtual machine.
In the step 2, the Storage Resource Management (SRM) service routine also is used for this resource hot plug to user virtual machine, and the notice user virtual machine.
The invention provides a kind of in the Xen virtualized environment method of I/O equipment reconstruction, comprising:
Step 1, user virtual machine detects user's the idle storage resources of I/O greater than critical value, then user virtual machine unloads the idle storage resources of I/O of specific quantity, and sends the request of unloading I/O storage resources to franchise virtual machine, wherein comprises the specific quantity of the I/O storage resources of needs unloading;
Step 2, franchise virtual machine reclaims the idle storage resources of the I/O of specific quantity.
In the step 1, user virtual machine is revised the root file system of user virtual machine and the corresponding information of I/O equipment behind the idle storage resources of the I/O of unloading specific quantity.
In the step 2, the hot drawing from user virtual machine of franchise virtual machine goes out the idle storage resources of I/O of specific quantity, and it is added in the idle I/O storage resources again.
In the step 1, storage resources behaviour in service Monitoring Service program is installed in user virtual machine, be used to detect the quantity of user's the idle storage resources of I/O, and at the idle storage resources of the I/O that detects the user during greater than critical value, the idle storage resources of the I/O of unloading specific quantity also sends the request of unloading I/O storage resources to franchise virtual machine.
In the step 1, storage resources behaviour in service Monitoring Service program also is used for revising the root file system of user virtual machine and the corresponding information of I/O equipment behind the idle storage resources of the I/O of unloading specific quantity.
In the step 2, the Storage Resource Management (SRM) service routine is installed in franchise virtual machine, is used for the idle storage resources of the I/O of specific quantity is reclaimed.
In the step 2, the Storage Resource Management (SRM) service routine also is used for going out from the user virtual machine hot drawing the idle storage resources of I/O of specific quantity, and it is added in the idle I/O storage resources again.
The invention provides a kind of in the Xen virtualized environment system of I/O equipment reconstruction, comprise user virtual machine and franchise virtual machine,
User virtual machine, the idle storage resources of I/O that is used to detect the user are sent the request of application I/O storage resources to franchise virtual machine during less than critical value, wherein comprise the quantity of application I/O storage resources;
The privilege virtual machine, the corresponding number of I/O storage resources that is used for taking out from the I/O storage resources of free time the user virtual machine application is distributed to user virtual machine;
User virtual machine also is used for corresponding number of I/O storage resources is carried out initialization, and the deployment file system is installed to then in the root file system of user virtual machine and uses for the user.
User virtual machine also is used for according to the quantity of the spending rate of its idle I/O storage resources decision to franchise virtual machine application I/O storage resources.
Comprise storage resources behaviour in service Monitoring Service program in the user virtual machine;
Storage resources behaviour in service Monitoring Service program is used to detect the quantity of user's the idle storage resources of I/O, and sends application I/O storage resources request to franchise virtual machine at the idle storage resources of the I/O that detects the user during less than critical value;
Storage resources behaviour in service Monitoring Service program also is used for corresponding number of I/O storage resources is carried out initialization, and the deployment file system is installed to then in the root file system of user virtual machine and uses for the user.
The privilege virtual machine also is used for corresponding number of I/O storage resources heat is inserted user virtual machine, and the notice user virtual machine.
Comprise the Storage Resource Management (SRM) service routine in the privilege virtual machine;
The Storage Resource Management (SRM) service routine, the corresponding number of I/O storage resources that is used for taking out from the I/O storage resources of free time the user virtual machine application is distributed to user virtual machine.
The Storage Resource Management (SRM) service routine also is used for this resource hot plug to user virtual machine, and the notice user virtual machine.
The invention provides a kind of in virtualized environment the system of I/O equipment reconstruction, described virtualized environment is the Xen virtualized environment, comprises user virtual machine and franchise virtual machine,
User virtual machine, the idle storage resources of I/O that is used to detect the user is during greater than critical value, then user virtual machine unloads the idle storage resources of I/O of specific quantity, and sends the request of unloading I/O storage resources to franchise virtual machine, wherein comprises the specific quantity of the I/O storage resources of needs unloading;
The privilege virtual machine is used for the idle storage resources of the I/O of specific quantity is reclaimed.
User virtual machine also is used for revising the root file system of user virtual machine and the corresponding information of I/O equipment behind the idle storage resources of the I/O of unloading specific quantity.
The privilege virtual machine also is used for going out from the user virtual machine hot drawing the idle storage resources of I/O of specific quantity, and it is added in the idle I/O storage resources again.
Comprise storage resources behaviour in service Monitoring Service program in the user virtual machine;
Storage resources behaviour in service Monitoring Service program, be used to detect the quantity of user's the idle storage resources of I/O, and at the idle storage resources of the I/O that detects the user during greater than critical value, the idle storage resources of the I/O of unloading specific quantity also sends the request of unloading I/O storage resources to franchise virtual machine.
Storage resources behaviour in service Monitoring Service program also is used for revising the root file system of user virtual machine and the corresponding information of I/O equipment behind the idle storage resources of the I/O of unloading specific quantity.
Comprise the Storage Resource Management (SRM) service routine in the privilege virtual machine;
The Storage Resource Management (SRM) service routine is used for the idle storage resources of the I/O of specific quantity is reclaimed.
The Storage Resource Management (SRM) service routine also is used for going out from the user virtual machine hot drawing the idle storage resources of I/O of specific quantity, and it is added in the idle I/O storage resources again.
The invention enables under the situation to user transparent, the distribution that reaches storage resources changes along with user's demand, can satisfy user's demand, can not cause the appearance of the waste situation of storage resources again.Simultaneously, because to user transparent, the user need not to have the computer literacy of specialty; And the restructuring procedure of whole virtual i/o equipment is finished automatically, and reaction velocity is fast, need not the system manager, has reduced system manager's workload, has improved service quality, has reduced the system service cost.
Description of drawings
Fig. 1 is the virtualized architecture of I/O among the existing Xen;
Fig. 2 is the structural representation of virtual i/o equipment reconstruction of the present invention system;
Fig. 3 is the embodiment of virtual i/o equipment reconstruction method of the present invention.
Embodiment
The present invention proposes a kind of method of virtual i/o equipment reconstruction, comprising:
(user virtual machine is exactly the virtual machine that operates on the VMM for step 1), user virtual machine, such as VM1 is a user virtual machine, the front-end equipment driver operates in the user virtual machine, user application is operated equipment by the front-end equipment driver) in storage resources behaviour in service Monitoring Service sequential monitoring to user's idle storage resources less than certain critical value (such as 1G), at this moment it can send resource bid by the Storage Resource Management (SRM) service routine in trend VM0;
Step 2), after the Storage Resource Management (SRM) service routine among the VM0 is received the resource bid that user virtual machine sends, from the storage resources of free time, take out the resource of the quantity of user virtual machine request, then its heat is inserted and given in the user virtual machine, and the transmission notice, the insertion of the I/O storage resources that the storage resources behaviour in service Monitoring Service program in the announcement user virtual machine is new;
After storage resources behaviour in service Monitoring Service program in step 3), the user virtual machine has notice, the I/O storage resources of new insertion is carried out initialization, the deployment file system is installed in the root file system of user virtual machine then, uses for the user.
In above-mentioned step 1), the fixed value of user's idle I/O storage resources can be according to the different modifications of system's characteristics and demand, to reach the efficient use of I/O resource.
Simultaneously, storage resources behaviour in service Monitoring Service program can decide the quantity of the new storage resources of application according to the idle I/O storage resource consumption speed in the user virtual machine.If the spending rate of idle I/O resource is very fast, downloading movies in a large number such as the user, its I/O resource can consume very fast so, at this moment according to the spending rate of I/O resource, storage resources behaviour in service Monitoring Service program just can be reached a conclusion: the user is in the burst consumes peak of I/O storage resources, it has very big may also need a large amount of storage spaces at short notice, at this moment will once be newly assigned to the more storage resources of user, such as 5G.
And if the spending rate of idle storage resources is slow, writing the word document such as the user, and at this moment idle storage resources is in certain preservation operation back subcritical value of user, at this moment storage resources behaviour in service Monitoring Service program can monitor the generation of this situation, it can be found simultaneously, the spending rate of user storage resource is very slow, therefore storage resources behaviour in service Monitoring Service program can reach a conclusion: the user is not in the consumption peak period of storage resources, it has very big may not need a large amount of storage resources at short notice, at this moment will once be newly assigned to the less storage resources of user, such as 1G.By this mechanism, both can guarantee that user's demand was met, reduced the number of times of resources allocation again, reduced the operation burden of system.
Similar process, when the idle storage resources in the user virtual machine is too much:
Storage resources behaviour in service Monitoring Service sequential monitoring in step 1), the user virtual machine arrives user's idle storage resources greater than certain critical value, at this moment it can unload the part storage resources automatically, and the Storage Resource Management (SRM) service routine in VM0 sends resource unloading application then;
Step 2), after the Storage Resource Management (SRM) service routine among the VM0 receives the resource bid that user virtual machine sends, will be reclaimed by the storage resources that user virtual machine unloads.
Automatic insertion and recovery by storage resources can be implemented under the prerequisite of meeting consumers' demand, and have avoided a large amount of wastes of storage resources.
In typical X en virtualized environment, operation Storage Resource Management (SRM) service routine among the privilege virtual machine VM0, be used to manage idle I/O storage resources, and the resource bid and the unload request of reception and the transmission of process user virtual machine, below it is abbreviated as the server program.Operation storage resources behaviour in service Monitoring Service program in the user virtual machine, the I/O storage resources operating position that is used for the monitor user ' virtual machine, and make the decision of resource bid or unloading in view of the above, and send application to the server program of moving among the VM0, below it is abbreviated as the monitor program.
It is provided by the invention that I/O equipment reconstruction system is as shown in Figure 2 in virtualized environment, comprise franchise virtual machine VM0 and user virtual machine VM1, communicate between the moniter (watchdog routine) among server among the VM0 (server) program and the VM1, can realize the application request of I/O resource and reply, I/O resource unload request and replying, and the hot plug of I/O resource.
Fig. 3 has provided an embodiment.Suppose that this moment, user virtual machine VM1 moved, its idle storage resources is 1.5G, and the idling-resource critical value of system's setting is not more than 5G simultaneously for being not less than 1G.The restructuring procedure of virtual i/o equipment is as follows:
Step 201, the user is finding a good movie download website sometime, and wherein a plurality of films all are that the user wants to download, and its total size is about 9G.The user begins to download movies subsequently, and idle storage resources reduces rapidly thereupon.
Step 202, when idle storage resources during less than 1G, the monitor program of moving among the VM1 has been found the deficiency of idling-resource, simultaneously because idle storage resources reduces rapidly at short notice, judges that subsequent user needs the possibility of a large amount of storage resources very big.Therefore, to have sent capacity be the distribution application of the storage resources of 10G to the server program moved in VM0 of monitor program.
Step 203, the server program of moving among the VM0 are checked idle storage resources after receiving the storage resources application that the monitor program moved among the VM1 sends, and the capacity of finding idling-resource can satisfy the demand of user virtual machine VM1 greater than 10G.
Step 204, Server program are taken out the resource of 10G capacity from idle storage resources, heat is inserted among the user virtual machine VM1.Then, the monitor program of moving in VM1 is sent replying that resource distributed.
After step 205, the monitor program of moving among the user virtual machine VM1 receive replying that resource distributed, check the information of the new I/O resource of inserting.
Step 206, subsequently, the monitor program is carried out initialization to the I/O storage resources of new insertion, and disposes file system thereon.
Step 207, then, the I/O storage resources that the monitor program will newly be inserted is installed in the root file system of user virtual machine, and the user just can use new storage resources.At this moment, Kong Xian storage resources becomes 10G and adds the remaining storage space of present user virtual machine.It should be noted that in equipment reconstruction user virtual machine VM1 is still downloading movies, do not need to suspend user's operation.Suppose when reconstruct is finished that original idle storage resources also has 800M in the user virtual machine, total idle storage resources just becomes 10.8G in the user virtual machine so now, can satisfy the movie download demand of user 9G fully.
Step 208, after the intact size of user's download was the film of 9G, storage resources idle among the user virtual machine VM1 was 2.5G.
Step 209, appreciated the power supply of downloading as the user after, he is the film deletion of downloading, the idle storage resources among this moment user virtual machine VM1 increases to 11.5G.
Step 210, the monitor sequential monitoring that moves among the VM1 start the resource uninstall process to this variation.
Step 211 at first unloads in the root file system of 10G storage resources from user virtual machine VM1 that the monitor program will newly be inserted.At this moment the idle storage resources among the VM1 becomes 1.5G.
Step 212, then, the monitor program is storage resources the peeling off from user virtual machine VM1 of unloading, and (corresponding information herein is meant: that part of information relevant with the storage resources that will unload in the file system neutralizing device attribute) to revise the file system of VM1 and the corresponding information of I/O equipment.
Step 213, last, the server program that the monitor program is moved in VM0 is sent virtual i/o device resource unloading notice.
Step 214, after the server program of moving among the VM0 receives the virtual i/o resource unloading notice and its relevant information that the monitor program moved among the user virtual machine VM1 sends, hot drawing goes out corresponding virtual I/O storage resources from VM1, and it is added in the idle storage resources again.
In whole process, the monitor program of moving in the user virtual machine is made the application and the unloading decision of resource according to the variation of idle I/O storage resources in the user virtual machine, and with VM0 in the server program moved cooperate jointly, by hot plug to virtual i/o equipment, dynamically change the capacity of virtual i/o equipment, thereby accomplish to satisfy in real time user's demand, simultaneously can make that again the I/O storage resources is efficiently used, not increase system manager's workload and system operation cost simultaneously again.
The present invention is to user transparent, and the user does not need to participate in the process of the application and the distribution of resource; The user can find that when storage resources was not enough, system can be his overabsorption storage resources automatically; And when the idle storage resources of user virtual machine was too much, system is unloading part storage resources automatically; And the user does not need the knowledge of advanced computer major in this service of enjoyment; According to the user behaviour in service of storage resources is made the adjustment of storage resources automatically, can satisfy user's demand like this, avoided the appearance of situation of a large amount of wastes of storage resources again; The insertion and the removal process of whole storage resources are finished automatically, and user's changes in demand is swift in response, and give the user with high quality services; Can finish automatically, reduce system manager's work load, reduce the cost of serving of system.
Those skilled in the art can also carry out various modifications to above content under the condition that does not break away from the definite the spirit and scope of the present invention of claims.Therefore scope of the present invention is not limited in above explanation, but determine by the scope of claims.