The virtual memory file redirection method and its system of virtual machine in virtual clusterTechnical field
The invention belongs to computers to belong to field, and in particular to the virtual memory file weight of virtual machine in a kind of virtual clusterOrientation method and its system.
Background technique
Virtual memory is a kind of common technology of modern operating system memory management.By taking windows operating system as an example, whenWhen physical memory deficiency, windows can be moved to the internal storage data that a part is of little use on the virtual memory file of hard disk, i.e.,Hard drive space is used as memory, to solve the problems, such as low memory, the file of virtual memory file is entitledPagefile.sys, also known as paging file;Virtual memory file effective, paging file after shutdown in windows operationAlthough also retaining in a hard disk, file content is nonsensical, and next windows booting can reinitialize paging textPart.
Since virtual memory file is used as memory, the read or write speed of this file influences the performance of windows systemVery big, existing group scheme is for High Availabitity and dynamic migration of virtual machine, generally using shared storage or distributed storage, virtuallyMemory file is also all by net reading and writing, and speed is limited, when running large software, is easy to appear Caton situation.
Summary of the invention
In view of this, the main purpose of the present invention is to provide a kind of virtual memory files of virtual machine in virtual clusterReorientation method and its system.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
The embodiment of the present invention provides a kind of virtual memory file redirection method of virtual machine in virtual cluster, this methodAre as follows: terminal sends virtual machine starting request to dispatch server, and the dispatch server divides calculate node and virtual to the terminalThe virtual memory file of virtual machine in the virtual machine server is re-introduced into and is locally stored by machine server, the calculate nodeIn space, the terminal obtains virtual machine picture by Remote Desktop Protocol and calculate node communication.
In above scheme, the calculate node redirects the virtual memory file of virtual machine in the virtual machine serverInto local storage space, specifically: the calculate node search for and copy virtual machine in the virtual machine server it is virtual inAssociated metadata of the file in file system is deposited into the memory of calculate node, the calculate node is locally generated sparse latticeThe hard disk mirror-image size one of virtual machine in the temporary file of formula, the file size of the temporary file and the virtual machine serverIt causes.
In above scheme, this method further include: described after the terminal stops using the virtual machine of the virtual machine serverCalculate node deletes the virtual memory file in local storage space.
In above scheme, this method further include: the calculate node is written and read the virtual machine of the virtual machine serverIn the process, the data read and write in real time are re-introduced into local storage space.
In above scheme, the data that will be read and write in real time are re-introduced into local storage space, specifically: if instituteThe data for stating calculate node read-write are virtual memory file datas, then redirect read-write operation in local temporary files, alternatively,If the data of the calculate node read-write are the metadata of virtual memory file, the memory for being saved in the calculate node is updatedMetadata.
The embodiment of the present invention also provides a kind of virtual memory file redirection system of virtual machine in virtual cluster, this isSystem includes terminal, calculate node, dispatch server, virtual machine server;
The terminal, for sending virtual machine starting request to dispatch server;Be also used to by Remote Desktop Protocol withCalculate node communication obtains virtual machine picture.
The dispatch server, for managing several virtual machine servers in cluster-based storage, according to the terminalVirtual machine starting request distribution calculate node and virtual machine server,
The calculate node is connect for the virtual machine server with distribution, will be virtual in the virtual machine server of distributionThe virtual memory file of machine is re-introduced into local storage space;
The virtual machine server, for providing reading and writing data to the calculate node.
In above scheme, the calculate node, specifically for searching for and copying the void of virtual machine in the virtual machine serverQuasi- associated metadata of the memory file in file system is locally generated the temporary file of sparse format into memory, describedThe file size of temporary file and the hard disk mirror-image of virtual machine in the virtual machine server are in the same size.
In above scheme, the calculate node is also used to the virtual machine that the terminal stops using the virtual machine serverAfterwards, the virtual memory file in local storage space is deleted.
In above scheme, the calculate node, during being also used to be written and read the virtual machine of the virtual machine server,The data read and write in real time are re-introduced into local storage space.
In above scheme, the calculate node will if being virtual memory file data specifically for the data read and writeRead-write operation redirects in local temporary files, alternatively, updating if the data of read-write are the metadata of virtual memory fileIt is saved in the metadata of the memory of calculate node.
Compared with prior art, sky is locally stored to what the read-write of virtual memory file was redirected to calculate node in the present inventionBetween in, accelerate virtual memory file read or write speed, make large software operation it is more smooth, reduce cluster-based storage read-write behaviourMake, reduces the space hold of cluster-based storage, reduce the resource occupying of calculate node.
Detailed description of the invention
Fig. 1 provides a kind of virtual memory file redirection method of virtual machine in virtual cluster for the embodiment of the present inventionFlow chart.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, rightThe present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, andIt is not used in the restriction present invention.
The embodiment of the present invention provides a kind of virtual memory file redirection method of virtual machine in virtual cluster, such as Fig. 1Shown, this method is realized by following steps:
Step 1: terminal sends virtual machine starting request to dispatch server, and the dispatch server is calculated to the terminal pointNode and virtual machine server;
Specifically, calculate node needs support vt technology, and terminal can also hold a concurrent post calculate node role;As terminal role andFor calculate node role when on same physical machine, terminal can also allow void by Remote Desktop Protocol connecting virtual machineQuasi- machine picture is directly output to board display.
The dispatch server distributes calculate node and virtual machine server according to load balancing principle.
After distribution, the calculate node is connect with virtual server, and the computer node will also be with the end of transmission requestEnd connection.
Step 2: the virtual memory file of virtual machine in the virtual machine server is re-introduced into this by the calculate nodeIn ground memory space;
Specifically, the calculate node searches for and copies the virtual memory file of virtual machine in the virtual machine server in textFor associated metadata in part system into the memory of calculate node, the calculate node is locally generated the interim text of sparse formatPart, the file size of the temporary file and the hard disk mirror-image of virtual machine in the virtual machine server are in the same size.
During the calculate node is written and read the virtual machine of the virtual machine server, the data weight that will read and write in real timeNewly it is directed in local storage space.
If the data of the calculate node read-write are virtual memory file datas, read-write operation is redirected into local faceWhen file in, in this way, after being redirected to local temporary files, read or write speed is only influenced by local memory device speed, speedIt significantly improves;Read-write IO pressure, which is transferred to, to be locally stored, to promote the readwrite performance of cluster-based storage, the master of calculate node indirectlyTask is wanted to be to provide computing capability, it is lighter to be locally stored IO pressure, read-write IO pressure is transferred to be locally stored be reasonable;It is emptyQuasi- machine disk is usually difference mirror image, has Copy on write mechanism, only actually writes data ability occupied space.Virtual machine is virtually interiorFile redirection write operation is deposited to being locally stored, only accounts for the space being locally stored, does not account for cluster-based storage space.
Alternatively, update is saved in this if the data of calculate node read-write are the metadata of virtual memory fileThe metadata of the memory of calculate node, since the size of virtual memory file may dynamically increase, more new metadata can just be obtainedThe data block distributed intelligence for taking virtual memory file guarantees that the data of read-write are the correctness of virtual memory file data.
The metadata is for obtaining virtual memory file in the position of virtual hard disk mirror image.
The metadata refer to description file characteristic data, such as filename, file access permission, file owner,File size and file data blocks distributed intelligence;Metadata is generally put into before disk partition, and among subregion or tail portion canThe backup of metadata can be had.
Step 3: the terminal obtains virtual machine picture by Remote Desktop Protocol and calculate node communication;
Specifically, the virtual machine picture is the implementation processes such as the software interface that terminal needs virtual machine to run.
The terminal also passes through Remote Desktop Protocol and remotely controls calculate node, realizes various operations.
Step 4: after the terminal stops using the virtual machine of the virtual machine server, the calculate node deletes local depositStore up the virtual memory file in space.
Specifically, after terminal is stopped using, the calculate node delete the local temporary file for generating sparse format andData stored in memory.
The embodiment of the present invention also provides a kind of virtual memory file redirection system of virtual machine in virtual cluster, this isSystem includes calculate node, dispatch server, virtual machine server;
The calculate node is used to send virtual machine starting request to dispatch server, the virtual machine clothes for being also used to distributeThe virtual memory file of virtual machine is re-introduced into local storage space in business device;
The dispatch server is used to manage several virtual machine servers in cluster-based storage, according to the calculate nodeStarting request to calculate node distribute a virtual machine server,
The virtual machine server is used to provide reading and writing data to the calculate node.
The virtual memory file that the calculate node is specifically used for searching for and copying virtual machine in the virtual machine server existsAssociated metadata in file system is locally generated the temporary file of sparse format, the text of the temporary file into memoryPart size and the hard disk mirror-image of virtual machine in the virtual machine server are in the same size.
After the calculate node is also used to stop using the virtual machine of the virtual machine server, delete in local storage spaceVirtual memory file.
The calculate node will be read and write in real time during being also used to be written and read the virtual machine of the virtual machine serverData be re-introduced into local storage space.
If the data that the calculate node is specifically used for read-write are virtual memory file datas, read-write operation is resetInto local temporary files, alternatively, update is saved in calculating section if the data of read-write are the metadata of virtual memory fileThe metadata of the memory of point.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.