CN109343928B - Virtual memory file redirection method and system for virtual machine in virtualization cluster - Google Patents

Virtual memory file redirection method and system for virtual machine in virtualization cluster Download PDF

Info

Publication number
CN109343928B
CN109343928B CN201810989250.0A CN201810989250A CN109343928B CN 109343928 B CN109343928 B CN 109343928B CN 201810989250 A CN201810989250 A CN 201810989250A CN 109343928 B CN109343928 B CN 109343928B
Authority
CN
China
Prior art keywords
virtual machine
computing node
file
virtual
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810989250.0A
Other languages
Chinese (zh)
Other versions
CN109343928A (en
Inventor
廖振岚
张天虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Microcloud Technology Inc
Original Assignee
Guangdong Microcloud Technology Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Microcloud Technology Inc filed Critical Guangdong Microcloud Technology Inc
Priority to CN201810989250.0A priority Critical patent/CN109343928B/en
Publication of CN109343928A publication Critical patent/CN109343928A/en
Application granted granted Critical
Publication of CN109343928B publication Critical patent/CN109343928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a virtual memory file redirection method of a virtual machine in a virtualization cluster, wherein a terminal sends a virtual machine starting request to a scheduling server, the scheduling server divides a computing node and a virtual machine server to the terminal, the computing node redirects the virtual memory file of the virtual machine in the virtual machine server to a local storage space, and the terminal communicates with the computing node through a remote desktop protocol to acquire a virtual machine picture; the invention redirects the reading and writing of the virtual memory file to the local storage space of the computing node, accelerates the reading and writing speed of the virtual memory file, makes large-scale software run more smoothly, reduces the reading and writing operation of cluster storage, reduces the space occupation of cluster storage, and reduces the network resource occupation of the computing node.

Description

Virtual memory file redirection method and system for virtual machine in virtualization cluster
Technical Field
The invention belongs to the field of computers, and particularly relates to a method and a system for redirecting a virtual memory file of a virtual machine in a virtualized cluster.
Background
Virtual memory is a common technique for memory management in modern operating systems. Taking a windows operating system as an example, when a physical memory is insufficient, the windows can move a part of unusual memory data to a virtual memory file of a hard disk, namely, a hard disk space is used as the memory, so that the problem of insufficient memory is solved, and the file name of the virtual memory file is pagefile.sys which is also called a paging file; the virtual memory file is only effective when the windows runs, the paging file is still reserved in the hard disk after the windows is powered off, but the file content has no meaning, and the paging file can be reinitialized when the windows is powered on next time.
Because the virtual memory file is used as a memory, the read-write speed of the file has a great influence on the performance of a windows system, the existing cluster scheme generally uses shared storage or distributed storage for high availability and dynamic migration of virtual machines, the virtual memory file is read and written through a network, the speed is limited, and the jam condition is easy to occur when large-scale software is operated.
Disclosure of Invention
In view of the above, the present invention is directed to a method and a system for redirecting a virtual memory file of a virtual machine in a virtualized cluster.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a method for redirecting a virtual memory file of a virtual machine in a virtualized cluster, which comprises the following steps: the method comprises the steps that a terminal sends a virtual machine starting request to a scheduling server, the scheduling server divides a computing node and a virtual machine server to the terminal, the computing node redirects a virtual memory file of a virtual machine in the virtual machine server to a local storage space, and the terminal communicates with the computing node through a remote desktop protocol to obtain a virtual machine picture.
In the foregoing solution, the redirecting the virtual memory file of the virtual machine in the virtual machine server to the local storage space by the computing node specifically includes: the computing node searches and copies relevant metadata of a virtual memory file of a virtual machine in the virtual machine server in a file system to a memory of the computing node, the computing node locally generates a temporary file in a sparse format, and the file size of the temporary file is consistent with the size of a hard disk image of the virtual machine in the virtual machine server.
In the above scheme, the method further comprises: and after the terminal stops using the virtual machine of the virtual machine server, the computing node deletes the virtual memory file in the local storage space.
In the above scheme, the method further comprises: and the computing node redirects the real-time read-write data to the local storage space in the process of reading and writing the virtual machine of the virtual machine server.
In the above scheme, the redirecting the real-time read-write data to the local storage space specifically includes: and if the data read and written by the computing node is the virtual memory file data, redirecting the read and write operation to the local temporary file, or if the data read and written by the computing node is the metadata of the virtual memory file, updating the metadata stored in the memory of the computing node.
The embodiment of the invention also provides a virtual memory file redirection system of the virtual machine in the virtualization cluster, which comprises a terminal, a computing node, a scheduling server and a virtual machine server;
the terminal is used for sending a virtual machine starting request to the scheduling server; and the method is also used for communicating with the computing node through a remote desktop protocol to obtain a virtual machine picture.
The dispatching server is used for managing a plurality of virtual machine servers in the cluster storage, distributing the computing nodes and the virtual machine servers according to the virtual machine starting request of the terminal,
the computing node is used for connecting with the distributed virtual machine server and redirecting the virtual memory file of the virtual machine in the distributed virtual machine server to the local storage space;
and the virtual machine server is used for providing data reading and writing for the computing node.
In the foregoing solution, the computing node is specifically configured to search and copy metadata related to a virtual memory file of a virtual machine in the virtual machine server in a file system to a memory, and locally generate a temporary file in a sparse format, where a file size of the temporary file is consistent with a size of a hard disk image of the virtual machine in the virtual machine server.
In the above scheme, the computing node is further configured to delete the virtual memory file in the local storage space after the terminal stops using the virtual machine of the virtual machine server.
In the above scheme, the computing node is further configured to redirect real-time read-write data to a local storage space during the process of reading and writing the virtual machine of the virtual machine server.
In the foregoing solution, the computing node is specifically configured to redirect the read-write operation to the local temporary file if the read-write data is the virtual memory file data, or update the metadata stored in the memory of the computing node if the read-write data is the metadata of the virtual memory file.
Compared with the prior art, the method redirects the reading and writing of the virtual memory file to the local storage space of the computing node, accelerates the reading and writing speed of the virtual memory file, ensures that large-scale software runs more smoothly, reduces the reading and writing operation of cluster storage, reduces the occupied space of the cluster storage, and reduces the occupied network resources of the computing node.
Drawings
Fig. 1 is a flowchart of a method for redirecting a virtual memory file of a virtual machine in a virtualized cluster according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
An embodiment of the present invention provides a method for redirecting a virtual memory file of a virtual machine in a virtualized cluster, where as shown in fig. 1, the method is implemented by the following steps:
step 1: a terminal sends a virtual machine starting request to a scheduling server, and the scheduling server divides a computing node and a virtual machine server to the terminal;
specifically, the computing node needs to support the vt technology, and the terminal can also take the role of the computing node; when the terminal role and the computing node role are on the same physical machine, the terminal can be connected with the virtual machine through a remote desktop protocol, and the virtual machine picture can be directly output to a local display.
And the dispatching server distributes the computing nodes and the virtual machine servers according to a load balancing principle.
After the allocation, the computing node is connected with the virtual server, and the computing node is also connected with a terminal sending a request.
Step 2: the computing node redirects the virtual memory file of the virtual machine in the virtual machine server to a local storage space;
specifically, the computing node searches and copies relevant metadata of a virtual memory file of a virtual machine in the virtual machine server in a file system to a memory of the computing node, the computing node locally generates a temporary file in a sparse format, and the file size of the temporary file is consistent with the size of a hard disk image of the virtual machine in the virtual machine server.
And the computing node redirects the real-time read-write data to the local storage space in the process of reading and writing the virtual machine of the virtual machine server.
If the data read and written by the computing node is the virtual memory file data, the read and write operation is redirected to the local temporary file, so that after the data is redirected to the local temporary file, the read and write speed is only influenced by the speed of the local storage equipment, and the speed is obviously improved; the read-write IO pressure is transferred to local storage, so that the read-write performance of cluster storage is indirectly improved, the main task of the computing node is to provide computing capacity, the local storage IO pressure is light, and the transfer of the read-write IO pressure to the local storage is reasonable; the virtual machine disk is generally a differential mirror image, has a copy-on-write mechanism, and occupies space only when actually writing data. The virtual memory file of the virtual machine redirects the write operation to the local storage, and only occupies the space of the local storage but not the cluster storage space.
Or if the data read and written by the computing node is the metadata of the virtual memory file, the metadata stored in the memory of the computing node is updated, and since the size of the virtual memory file may dynamically increase, the metadata is updated to obtain the data block distribution information of the virtual memory file, so that the correctness of the data read and written by the virtual memory file is ensured.
The metadata is used for acquiring the position of the virtual memory file in the virtual hard disk mirror image.
The metadata refers to data describing file characteristics, such as file name, file access authority, file owner, file size and file data block distribution information; metadata is typically placed in front of the disk partitions, and there may be backups of metadata in the middle or at the end of the partitions.
And step 3: the terminal communicates with the computing node through a remote desktop protocol to obtain a virtual machine picture;
specifically, the virtual machine picture is an implementation process such as a software interface which the terminal needs to run by the virtual machine.
The terminal also remotely controls the computing node through a remote desktop protocol to realize various operations.
And 4, step 4: and after the terminal stops using the virtual machine of the virtual machine server, the computing node deletes the virtual memory file in the local storage space.
Specifically, after the terminal stops using, the computing node deletes the temporary file in the locally generated sparse format and the data stored in the memory.
The embodiment of the invention also provides a virtual memory file redirection system of the virtual machine in the virtual cluster, which comprises a computing node, a scheduling server and a virtual machine server;
the computing node is used for sending a virtual machine starting request to the scheduling server and redirecting a virtual memory file of a virtual machine in the distributed virtual machine server to a local storage space;
the scheduling server is used for managing a plurality of virtual machine servers in the cluster storage, allocating one virtual machine server to the computing node according to the starting request of the computing node,
the virtual machine server is used for providing data reading and writing for the computing nodes.
The computing node is specifically configured to search and copy metadata related to a virtual memory file of a virtual machine in the virtual machine server in a file system to a memory, and locally generate a temporary file in a sparse format, where the file size of the temporary file is consistent with the size of a hard disk image of the virtual machine in the virtual machine server.
And the computing node is also used for deleting the virtual memory file in the local storage space after stopping using the virtual machine of the virtual machine server.
And the computing node is also used for redirecting the real-time read-write data to the local storage space in the process of reading and writing the virtual machine of the virtual machine server.
The computing node is specifically configured to redirect the read-write operation to the local temporary file if the read-write data is virtual memory file data, or update the metadata stored in the memory of the computing node if the read-write data is metadata of the virtual memory file.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (8)

1. A virtual memory file redirection method of a virtual machine in a virtualization cluster is characterized by comprising the following steps: a terminal sends a virtual machine starting request to a scheduling server, the scheduling server distributes a computing node and a virtual machine server to the terminal, the computing node redirects a virtual memory file of a virtual machine in the virtual machine server to a local storage space, and the terminal communicates with the computing node through a remote desktop protocol to acquire a virtual machine picture;
the computing node redirects a virtual memory file of a virtual machine in the virtual machine server to a local storage space, specifically: the computing node searches and copies relevant metadata of a virtual memory file of a virtual machine in the virtual machine server in a file system to a memory of the computing node, the computing node locally generates a temporary file in a sparse format, and the file size of the temporary file is consistent with the size of a hard disk image of the virtual machine in the virtual machine server.
2. The method of claim 1, further comprising: and after the terminal stops using the virtual machine of the virtual machine server, the computing node deletes the virtual memory file in the local storage space.
3. The method of claim 2, further comprising: and the computing node redirects the real-time read-write data to the local storage space in the process of reading and writing the virtual machine of the virtual machine server.
4. The method according to claim 3, wherein the redirecting of the real-time read and write data to the local storage space comprises: and if the data read and written by the computing node is the virtual memory file data, redirecting the read and write operation to the local temporary file, or if the data read and written by the computing node is the metadata of the virtual memory file, updating the metadata stored in the memory of the computing node.
5. A virtual memory file redirection system of a virtual machine in a virtualization cluster is characterized by comprising a terminal, a computing node, a scheduling server and a virtual machine server;
the terminal is used for sending a virtual machine starting request to the scheduling server; the system is also used for communicating with the computing node through a remote desktop protocol to obtain a virtual machine picture;
the dispatching server is used for managing a plurality of virtual machine servers in the cluster storage, distributing the computing nodes and the virtual machine servers according to the virtual machine starting request of the terminal,
the computing node is used for connecting with the distributed virtual machine server and redirecting the virtual memory file of the virtual machine in the distributed virtual machine server to the local storage space; the file system is specifically used for searching and copying relevant metadata of a virtual memory file of a virtual machine in the virtual machine server in a file system into a memory, and locally generating a temporary file in a sparse format, wherein the file size of the temporary file is consistent with the size of a hard disk image of the virtual machine in the virtual machine server;
and the virtual machine server is used for providing data reading and writing for the computing node.
6. The system according to claim 5, wherein the computing node is further configured to delete the virtual memory file in the local storage space after the terminal stops using the virtual machine of the virtual machine server.
7. The system according to claim 6, wherein the computing node is further configured to redirect the real-time read and write data to the local storage space during the process of reading and writing the virtual machine of the virtual machine server.
8. The system according to claim 7, wherein the compute node is specifically configured to redirect the read/write operations to the local temporary file if the read/write data is the virtual memory file data, or update the metadata stored in the memory of the compute node if the read/write data is the metadata of the virtual memory file.
CN201810989250.0A 2018-08-28 2018-08-28 Virtual memory file redirection method and system for virtual machine in virtualization cluster Active CN109343928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810989250.0A CN109343928B (en) 2018-08-28 2018-08-28 Virtual memory file redirection method and system for virtual machine in virtualization cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810989250.0A CN109343928B (en) 2018-08-28 2018-08-28 Virtual memory file redirection method and system for virtual machine in virtualization cluster

Publications (2)

Publication Number Publication Date
CN109343928A CN109343928A (en) 2019-02-15
CN109343928B true CN109343928B (en) 2022-02-08

Family

ID=65291946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810989250.0A Active CN109343928B (en) 2018-08-28 2018-08-28 Virtual memory file redirection method and system for virtual machine in virtualization cluster

Country Status (1)

Country Link
CN (1) CN109343928B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857949B (en) * 2020-06-30 2023-01-10 苏州浪潮智能科技有限公司 Model publishing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110196A (en) * 2009-12-25 2011-06-29 中国长城计算机深圳股份有限公司 Method and system for safely transmitting data among parallel-running multiple user operating systems
CN103823638A (en) * 2014-02-08 2014-05-28 华为技术有限公司 Virtual equipment access method and device
CN104461685A (en) * 2014-11-19 2015-03-25 华为技术有限公司 Virtual machine processing method and virtual computer system
CN106201349A (en) * 2015-12-31 2016-12-07 华为技术有限公司 A kind of method and apparatus processing read/write requests in physical host
CN107707622A (en) * 2017-08-30 2018-02-16 华为技术有限公司 A kind of method, apparatus and desktop cloud controller for accessing desktop cloud virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7069412B2 (en) * 1999-02-17 2006-06-27 Elbrus International Method of using a plurality of virtual memory spaces for providing efficient binary compatibility between a plurality of source architectures and a single target architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110196A (en) * 2009-12-25 2011-06-29 中国长城计算机深圳股份有限公司 Method and system for safely transmitting data among parallel-running multiple user operating systems
CN103823638A (en) * 2014-02-08 2014-05-28 华为技术有限公司 Virtual equipment access method and device
CN104461685A (en) * 2014-11-19 2015-03-25 华为技术有限公司 Virtual machine processing method and virtual computer system
CN106201349A (en) * 2015-12-31 2016-12-07 华为技术有限公司 A kind of method and apparatus processing read/write requests in physical host
CN107707622A (en) * 2017-08-30 2018-02-16 华为技术有限公司 A kind of method, apparatus and desktop cloud controller for accessing desktop cloud virtual machine

Also Published As

Publication number Publication date
CN109343928A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
US10747673B2 (en) System and method for facilitating cluster-level cache and memory space
WO2017107414A1 (en) File operation method and device
US20210216210A1 (en) Optimized migration of data between file systems of a storage array
CN110247984B (en) Service processing method, device and storage medium
US11809901B2 (en) Migrating the runtime state of a container between two nodes
KR20110035949A (en) Method and system for running virtual machine image
CN102938784A (en) Method and system used for data storage and used in distributed storage system
WO2015051641A1 (en) Method and apparatus for reclaiming space of magnetic disk image
CN106777394B (en) Cluster file system
CN105446794A (en) Disc operation method, apparatus and system based on virtual machine
US20140082275A1 (en) Server, host and method for reading base image through storage area network
CN106873902B (en) File storage system, data scheduling method and data node
CN110968417A (en) Method, apparatus, system and computer program product for managing storage units
CN107528871B (en) Data analysis in storage systems
CN111225003B (en) NFS node configuration method and device
CN109165078B (en) Virtual distributed server and access method thereof
US10346077B2 (en) Region-integrated data deduplication
CN109343928B (en) Virtual memory file redirection method and system for virtual machine in virtualization cluster
CN107577733B (en) Data replication acceleration method and system
EP4087212A1 (en) Method and apparatus for cloning file system
CN115562871A (en) Memory allocation management method and device
CN112131145B (en) Caching method and device applied to ceph
CN116594551A (en) Data storage method and device
CN114490540A (en) Data storage method, medium, device and computing equipment
CN108848136B (en) Shared storage method of cloud service cluster

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant