WO2016078420A1 - Virtual machine processing method and virtual computer system - Google Patents

Virtual machine processing method and virtual computer system Download PDF

Info

Publication number
WO2016078420A1
WO2016078420A1 PCT/CN2015/083227 CN2015083227W WO2016078420A1 WO 2016078420 A1 WO2016078420 A1 WO 2016078420A1 CN 2015083227 W CN2015083227 W CN 2015083227W WO 2016078420 A1 WO2016078420 A1 WO 2016078420A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
virtual machine
user
virtual
user file
Prior art date
Application number
PCT/CN2015/083227
Other languages
French (fr)
Chinese (zh)
Inventor
王燊
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016078420A1 publication Critical patent/WO2016078420A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the embodiments of the present invention relate to computer technologies, and in particular, to a virtual machine processing method and a virtual computer system.
  • Virtualization technology has become more and more widely used due to its advantages of improving resource utilization and reducing system management costs.
  • NTFS New Technology File System
  • the IO command for the operation of the disk IO where the user file refers to the file presented by the virtual machine to the user, and after the storage virtualization layer receives the IO command for operating the IO of the virtual disk, according to the correspondence between the virtual disk and the volume file Or the correspondence between the virtual disk and the block device, converting the IO command into a file command for operating the volume file or the block device, the cluster file system or the distributed file system, according to the volume file or the block device and the physical disk IO Correspondence, convert file commands that operate on volume files or block devices into physical disks IO operation command, thus, achieved in response to a user operation.
  • the embodiment of the invention provides a virtual machine processing method and a virtual computer system, which can improve the utilization rate of the storage resources of the virtual machine.
  • a first aspect of the embodiments of the present invention provides a virtual machine processing method, which is applied to a virtual computer system, where the system includes a virtual machine, a storage virtualization layer, a storage device, and a computing device, where the virtual machine is based on the computing device and The storage device generates, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, configured to allocate physical disk space of the storage device to each user file of each virtual machine.
  • the methods include:
  • the virtual file system of the virtual machine receives a file command for operating a user file of the virtual machine, where the file command carries a file path of the user file of the virtual machine in the virtual file system;
  • the virtual file system forwards the file command for operating the user file of the virtual machine to the storage virtualization layer;
  • the cluster file system of the storage virtualization layer is based on a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space.
  • the file command for operating the user file of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
  • the method further includes:
  • the cluster file system of the storage virtualization layer allocates a corresponding physical disk space to a user file of the virtual machine
  • the storage virtualization layer establishes a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and records the first correspondence.
  • the method further includes:
  • the storage virtualization layer further performs user file isolation processing when establishing a first correspondence between the user file of the virtual machine and the physical disk space, and the user file isolation processing is used for the user of the virtual machine.
  • the file points to a unique physical disk space.
  • the storage virtualization layer creates a folder corresponding to the virtual machine on the cluster file system, and records the a second correspondence between the virtual machine and the folder of the virtual machine;
  • the file path of the user file in the cluster file system includes a path of a folder corresponding to the virtual machine and a file path of a user file of the virtual machine in the virtual file system;
  • the storage virtualization layer records, in the cluster file system, a first correspondence between a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space.
  • the cluster file system of the storage virtualization layer is in the virtual file system according to a user file of the virtual machine a path, and a first correspondence between the user file of each virtual machine and the physical disk space, converting a file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device, include:
  • a first file corresponding to a file path of the user file of the virtual machine in the cluster file system, and a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space Converting a file command to operate the user file of the virtual machine into an IO command to operate on a physical disk of the storage device.
  • a second aspect of the embodiments of the present invention provides a virtual computer system, where the system includes a virtual machine, a storage virtualization layer, a storage device, and a computing device, where the virtual machine is generated based on the computing device and the storage device,
  • the virtual machine includes a virtual file system
  • the storage virtualization layer includes a cluster file system for allocating physical disk space of the storage device to each user file of each virtual machine, where
  • a virtual file system of the virtual machine configured to receive a file command for operating a user file of the virtual machine, where the file command carries a file path of a user file of the virtual machine in the virtual file system, And the file command for operating the user file of the virtual machine is forwarded to the storage virtualization layer;
  • the storage virtualization layer is configured to: according to a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space, The file command for the user file operation of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
  • the virtual file system of the virtual machine is further configured to receive a request for creating a user file of the virtual machine, and forward the request for creating a user file of the virtual machine to The storage virtualization layer;
  • the storage virtualization layer is further configured to allocate a corresponding physical disk space to the user file of the virtual machine; and establish a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system And recording the first correspondence.
  • the storage virtualization layer is further configured to establish a user file of the virtual machine and a first space of the physical disk space.
  • user file isolation processing is performed, and the user file isolation processing is used to point the user file of the virtual machine to a unique physical disk space.
  • the storage virtualization layer is specifically configured to create a folder corresponding to the virtual machine on the cluster file system, and Recording a second correspondence between the virtual machine and a folder of the virtual machine; creating a user file of the virtual machine in a folder of the virtual machine, where a user file of the virtual machine is in the cluster
  • a file path in the file system includes a path of a folder corresponding to the virtual machine and a file path of a user file of the virtual machine in the virtual file system; and a user of the virtual machine is recorded in the cluster file system
  • the storage virtualization layer is specifically configured to use a second correspondence between the virtual machine and a folder of the virtual machine Determining a folder of the virtual machine; generating a user file of the virtual machine according to a path of a folder of the virtual machine and a file path of a user file of the virtual machine in the virtual file system a file path in the cluster file system; a file path in the cluster file system according to a user file of the virtual machine, and a file path and allocation of the user file of the virtual machine in the cluster file system
  • the first correspondence of the physical disk space converts the file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device.
  • the virtual machine processing method and the virtual computer system provided by the embodiment of the present invention receive a file command for operating a user file of the virtual machine through the virtual file system of the virtual machine, and the file command carries the file of the virtual machine user file in the virtual file system.
  • Path the virtual file system forwards file commands for operating the user files of the virtual machine to the storage virtualization layer
  • the cluster file system of the storage virtualization layer is based on the file path of the virtual machine's user files in the virtual file system, and each Virtual machine user
  • the first correspondence between the file and the physical disk space converts the file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device.
  • the cluster file system or the distributed file system can reclaim the data area of the physical disk occupied by the user file in real time, thereby improving the utilization of the storage space of the virtual machine.
  • FIG. 1 is a schematic structural diagram of a virtual computer system in the prior art
  • FIG. 2 is a schematic flowchart of a virtual machine processing method in the prior art
  • FIG. 3 is a schematic structural diagram of a virtual machine computing system according to the present invention.
  • Embodiment 4 is a schematic flowchart of Embodiment 1 of a virtual machine processing method according to the present invention.
  • FIG. 5 is a schematic flowchart of Embodiment 2 of a method for processing a virtual machine according to the present invention
  • FIG. 6 is a schematic flowchart of Embodiment 3 of a method for processing a virtual machine according to the present invention.
  • Embodiment 7 is a schematic flowchart of Embodiment 4 of a method for processing a virtual machine according to the present invention.
  • FIG. 8 is a schematic structural diagram of an embodiment of file isolation according to the present invention.
  • FIG. 9 is a schematic structural diagram of another embodiment of file isolation according to the present invention.
  • FIG. 10 is a schematic structural diagram of still another embodiment of a virtual computer system according to the present invention.
  • FIG. 1 is a schematic structural diagram of a virtual computer system in the prior art.
  • FIG. 1 takes virtual machine as two virtual machines as examples, namely virtual machine 1 and virtual machine 2, and each virtual machine includes two.
  • the two user files in the virtual machine 1 are the user file A and the user file B respectively
  • the two files in the virtual machine 2 are the user file C and the user file D, respectively.
  • FIG. 2 is in the prior art.
  • the NTFS receives the file command of the user to delete the user file A.
  • NTFS manages the correspondence between user files and the IO of the virtual disk of virtual machine 1.
  • the NTFS converts the file command for deleting the user file A into an IO command for modifying the virtual disk metadata area corresponding to the user file A according to the correspondence between the user file A and the virtual disk data area of the virtual machine 1.
  • the state of the virtual disk data area corresponding to the user file A in the metadata area of the virtual disk is changed from unavailable to available.
  • the file command to delete user file A is converted to an IO command that modifies the metadata area of the virtual disk.
  • S203 The NTFS sends an IO command for modifying the virtual disk metadata area to the storage virtualization layer.
  • the storage virtualization layer converts the IO command of modifying the metadata area of the virtual disk into reading the volume file or the block device according to the correspondence between the IO of the virtual disk and the volume file or the correspondence between the IO of the virtual disk and the block device. Write a command.
  • the storage virtualization layer sends a read/write command to the volume file or the block device to the cluster file system or the block file system.
  • the cluster file system or the block file system converts the read/write command of the volume file or the block device into an operation of the IO of the physical disk, thereby implementing a response to the user operation.
  • the storage virtualization layer manages the correspondence between the IO and the volume file of the virtual disk, or the correspondence between the IO of the virtual disk and the block device, and stores
  • the virtualization layer cannot know the correspondence between the user files in the virtual machine and the data area of the virtual disk. Therefore, the storage virtualization layer cannot process the user files in units of user files. For example, snapshot, encryption, and decryption of the specified file. Orientation, request splitting, and antivirus processing.
  • CPU consumption is large, and file IO performance is lowered.
  • FIG. 3 is a schematic structural diagram of a virtual machine computing system according to the present invention. The system shown in FIG.
  • FIG. 3 includes a virtual machine, a storage virtualization layer, and a storage device and a computing device, wherein the virtual machine is generated based on the computing device and the storage device, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, and the physical disk space of the storage device is allocated to each virtual machine.
  • the system shown in Figure 3 takes two virtual machines as examples, namely virtual machine 1 and virtual machine 2, each virtual machine contains two user files, assuming two of virtual machines 1
  • the user files are User File A and User File B.
  • the two user files in VM 2 are User File C and User File D.
  • FIG 4 The flow chart of the first embodiment of the virtual machine processing method of the present invention is as follows:
  • the virtual file system receives a file command sent by the user to delete the user file A of the virtual machine.
  • the file command carries the file path of the user file A of the virtual machine in the virtual file system.
  • S402 The virtual file system directly forwards the file command of deleting the user file A to the storage virtualization layer.
  • the cluster file system of the storage virtualization layer is based on the file path of the virtual machine user file A in the virtual file system, and the first correspondence between the user file of each virtual machine and the physical disk space, and the user of the virtual machine
  • the file command for file A to delete is converted into an IO command that operates on the physical disk of the storage device.
  • the IO command that operates on the physical disk is an IO command that modifies the metadata area of the physical disk.
  • the response to the user operation is achieved by the steps S401 to S403 described above.
  • the cluster file system or the distributed file system of the storage virtualization layer can recover the data area of the physical disk occupied by the user file A in real time. , thereby increasing the utilization of the storage space of the virtual machine.
  • the above is only an example of deleting a user file.
  • the operation of moving a user file is similar, and is not described here.
  • the virtual file system directly forwards the file command of the user to the user file to the storage virtualization layer.
  • the storage virtualization layer manages the correspondence between the user file and the physical disk space. Therefore, the file view and storage virtualization in the virtual machine are performed.
  • the layer view can correspond to one-to-one; the operation of a file in the virtual machine can be accurately perceived in the underlying storage virtualization layer. Therefore, the storage virtualization layer can process the user file in units of user files. For example, snapshots, encryption and decryption, request redirection, request splitting, and antivirus are processed in units of user files to facilitate file management.
  • the CPU consumption can be reduced and the file IO performance can be improved.
  • the virtual machine computing system structure of the present invention keeps the file view in the virtual machine and the file view of the storage virtualization layer consistent, and enables the storage virtualization layer to perform finer storage management in a file unit than the prior art. Improve the flexibility of storage virtualization and reduce the occupation of computing resources for storage operations.
  • FIG. 4 is only described by taking the command of receiving a file for deleting a user file.
  • the file command further includes: a file command for creating a user file, a file command for modifying a user file, a file command for querying a user file, and a user file for reading the user file.
  • the processing method is similar in the present invention.
  • the following is a file command for operating the user file.
  • FIG. 5 is a second embodiment of the virtual machine processing method of the present invention.
  • the structure of the virtual computer system in this embodiment is similar to that of FIG. 3, and is not described here again.
  • the method in this embodiment is shown in FIG. 5:
  • S501 The virtual file system of the virtual machine receives a file command for operating a user file of the virtual machine.
  • the file command carries the file path of the virtual machine's user file in the virtual file system.
  • S502 The virtual file system forwards the file command for operating the user file of the virtual machine to the storage virtualization layer.
  • the cluster file system of the storage virtualization layer performs the virtual user file according to the path of the virtual machine user file in the virtual file system and the first correspondence between the user file and the physical disk space of each virtual machine.
  • the file command of the operation is converted into an IO command that operates on the physical disk of the storage device.
  • the response to the user operation is achieved by the steps S501 to S503 described above.
  • the virtual file system directly forwards the file command of the user to the user file to the storage virtualization layer, and the storage virtualization layer manages the correspondence between the user file and the physical disk space, and therefore, in the virtual machine.
  • File view and storage virtualization layer view can be one-to-one correspondence
  • the storage virtualization layer can process user files in units of user files, such as snapshots, encryption and decryption, request redirection, request splitting, and antivirus processing in units of user files, which facilitates management of files. And because IO processing is two layers less than the prior art, it can reduce CPU consumption and improve file IO performance.
  • FIG. 6 is a schematic flowchart of the third embodiment of the virtual machine processing method of the present invention:
  • the virtual file system receives a request to create a user file of the virtual machine.
  • S602 The virtual file system forwards a request for creating a user file of the virtual machine to the storage virtualization layer.
  • S603 The cluster file system of the storage virtualization layer allocates a corresponding physical disk space for the user file of the virtual machine.
  • the storage virtualization layer establishes a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and records the first correspondence.
  • the user file of the virtual machine can be created, and the first correspondence can be used when the user file of the virtual machine is deleted, read, or written.
  • the storage virtualization layer performs user file isolation processing when establishing the first correspondence between the user file of the virtual machine and the physical disk space, and the user file isolation processing is used to point the virtual machine user file to the unique file.
  • the physical disk space ensures file isolation between different virtual machines and prevents virtual machines from accessing files outside of the permissions.
  • FIG. 7 is a schematic flowchart of a fourth embodiment of the method for processing a virtual machine according to the present invention.
  • FIG. 8 is a schematic diagram of a file isolation method according to the present invention. Schematic diagram of the structure: Referring to FIG. 7 and FIG. 8, the flow of this embodiment is as follows:
  • the storage virtualization layer creates a folder corresponding to the virtual machine on the cluster file system, and records a second correspondence between the virtual machine and the virtual machine folder.
  • S702 Create a user file of the virtual machine in a folder of the virtual machine.
  • the file path of the virtual machine user file in the cluster file system includes the path of the folder corresponding to the virtual machine and the file path of the virtual machine user file in the virtual file system.
  • the path of the folder corresponding to the virtual machine is /datastore_1/VM1/ (this path can be changed according to the product requirements), and the file path of the virtual machine user file in the virtual file system is: c: ⁇ windows ⁇ test.txt,
  • the file path of the virtual machine user file in the cluster file system is: /datastore_1/VM1/windows/test.txt.
  • the storage virtualization layer records, in the cluster file system, a first correspondence between a file path of the virtual machine user file in the cluster file system and the allocated physical disk space.
  • the present invention further provides a storage virtual machine layer for user file isolation processing, and a file isolation processing by using a custom metadata file.
  • FIG. 9 is a schematic structural diagram of another embodiment of file isolation according to the present invention.
  • the metadata file records the correspondence between the virtual machine file and the physical disk, permissions, and differential data.
  • the metadata can be used to share the access file by using the metadata.
  • the metadata file is first created according to the file operation.
  • the path of the data file is consistent with the path of the first implementation; the path information of the virtual machine file corresponding to the data file is recorded in the metadata file.
  • the file path in the virtual machine is: c: ⁇ windows ⁇ test.txt; the path of the data file on the cluster file system is: /datastore_1/shared/windows/test.txt; the path of the metadata file is: /datastore_1 /VM1/windows/test.meta, the path information of the metadata file is: /datastore_1/shared/windows/test.txt.
  • File isolation can be achieved through the above two methods to prevent the virtual machine from accessing files other than the permission.
  • the cluster file system determines the folder of the virtual machine according to the second correspondence between the virtual machine and the folder of the virtual machine; The path of the folder of the machine and the file path of the user file of the virtual machine in the virtual file system, the file path of the user file of the virtual machine in the cluster file system; the file path of the user file in the cluster file system according to the virtual machine And a first correspondence between the file path of the virtual machine user file in the cluster file system and the allocated physical disk space, and the file command for operating the user file of the virtual machine is converted into a physical to the storage device The IO command that the disk is operating on.
  • the present invention further provides an embodiment of a virtual computer system.
  • the system includes a virtual machine, a storage virtualization layer, a storage device (LUN), and a computing device (not shown).
  • the virtual machine is based on the computing device and the foregoing
  • the storage device generates, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, configured to allocate a physical disk space of the storage device to each user file of each virtual machine, where the virtual machine is a virtual file system, configured to receive a file command for operating a user file of the virtual machine, where the file command carries a file path of the user file of the virtual machine in the virtual file system, and performs the foregoing user file of the virtual machine
  • the file command of the operation is forwarded to the storage virtualization layer; the storage virtualization layer is used for the file path in the virtual file system according to the user file of the virtual machine, and the user of each virtual machine.
  • the first correspondence between the file and the physical disk space converts the file command for
  • the virtual file system of the virtual machine is further configured to receive a request for creating a user file of the virtual machine, and forward the request for creating a user file of the virtual machine to the storage virtualization layer; the storage virtualization layer further And allocating a corresponding physical disk space for the user file of the virtual machine; establishing a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and recording the first correspondence.
  • the storage virtualization layer is further configured to perform user file isolation processing when establishing a first correspondence between the user file of the virtual machine and the physical disk space, where the user file isolation processing is used to The user file of the machine points to a unique physical disk space.
  • the storage virtualization layer is specifically configured to create a folder corresponding to the virtual machine on the cluster file system, and record a second correspondence between the virtual machine and the folder of the virtual machine; a user file of the virtual machine is created in a folder of the virtual machine, wherein a file path of the user file of the virtual machine in the cluster file system includes a path of a folder corresponding to the virtual machine and a user file of the virtual machine in the virtual a file path in the file system; the first corresponding relationship between the file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space is recorded in the cluster file system.
  • the storage virtualization layer is specifically configured to determine a folder of the virtual machine according to a second correspondence between the virtual machine and a folder of the virtual machine; and according to the path of the folder of the virtual machine and the foregoing a file path of the virtual machine user file in the virtual file system, generating a file path of the user file of the virtual machine in the cluster file system; a file path in the cluster file system according to the user file of the virtual machine, and Converting, by the user file of the virtual machine, a file path of the user file of the virtual machine to a physical disk of the storage device, in a first correspondence between the file path in the cluster file system and the allocated physical disk space.
  • the IO command to operate.
  • the system of this embodiment includes a memory 1010 and a processor 1020.
  • the memory 1010 may include random access memory, flash memory, read only memory, and programmable. Read only memory, nonvolatile memory or registers, etc.
  • the processor 1020 may be a Central Processing Unit (CPU).
  • Memory 1010 Used to store executable instructions.
  • the processor 1020 can execute executable instructions stored in the memory 1010, for example, the processor 1020 is configured to receive a file command to operate a user file of the virtual machine, and the file command carries a file path of the user file of the virtual machine in the virtual file system.
  • the file command that operates the user file of the virtual machine is forwarded to the storage virtualization layer; the file path in the virtual file system according to the virtual machine's user file, and the first user disk and physical disk space of each virtual machine Correspondence, the file command that operates the user file of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

A virtual machine processing method and a virtual computer system. The method comprises: receiving, by a virtual file system of a virtual machine, a file command for operating a user file of the virtual machine (S501), the file command carrying a file path of the user file of the virtual machine in the virtual file system; forwarding, by the virtual file system, the file command for operating the user file of the virtual machine to a storage virtualization layer (S502); and converting, by a cluster file system of the storage virtualization layer, the file command for operating the user file of the virtual machine into an IO command for operating a physical disk of a storage device according to the file path of the user file of the virtual machine in the virtual file system and a first correlation between the user file of each virtual machine and a physical disk space (S503). When a user deletes a user file, a cluster file system or a distributed file system can recycle a data region of a physical disk occupied by the user file in real time, thereby improving the utilization rate of a storage space of a virtual machine.

Description

虚拟机处理方法和虚拟计算机系统Virtual machine processing method and virtual computer system
本申请要求于2014年11月19日提交中国专利局、申请号为201410663419.5、发明名称为“虚拟机处理方法和虚拟计算机系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201410663419.5, entitled "Virtual Machine Processing Method and Virtual Computer System", filed on November 19, 2014, the entire contents of which is incorporated herein by reference. in.
技术领域Technical field
本发明实施例涉及计算机技术,尤其涉及一种虚拟机处理方法和虚拟计算机系统。The embodiments of the present invention relate to computer technologies, and in particular, to a virtual machine processing method and a virtual computer system.
背景技术Background technique
虚拟化技术因具有能够提高资源的利用率,降低系统管理成本等优点,虚拟化技术的应用越来越广泛。Virtualization technology has become more and more widely used due to its advantages of improving resource utilization and reducing system management costs.
通常,在一个计算机中可运行多个虚拟机,每个虚拟机上都会运行若干个文件系统,例如:窗口(Windows)虚拟机会运行新技术文件系统(New Technology File System,以下简称:NTFS),以NTFS为例,其他文件系统原理相同,NTFS用于接收用户发送的对用户文件进行操作的文件命令,并根据用户文件与虚拟磁盘的IO之间的对应关系,将上述文件命令转化为对虚拟磁盘的IO进行操作的IO命令,这里的用户文件是指虚拟机对用户呈现的文件,存储虚拟化层接收到对虚拟磁盘的IO进行操作的IO命令之后,根据虚拟磁盘与卷文件的对应关系或虚拟磁盘与块设备的对应关系,将IO命令转化为对卷文件或块设备进行操作的文件命令,集群文件系统或分布式文件系统,根据卷文件或块设备与物理磁盘的IO之间的对应关系,将对卷文件或块设备进行操作的文件命令转化为对物理磁盘进行操作的IO命令,从而,实现对用户操作的响应。Usually, multiple virtual machines can be run in one computer, and each file machine runs several file systems. For example, Windows (Windows) virtual machine runs New Technology File System (NTFS). Take NTFS as an example. The other file systems have the same principle. NTFS is used to receive file commands sent by the user to operate the user files, and convert the above file commands into virtual ones according to the correspondence between the user files and the IO of the virtual disk. The IO command for the operation of the disk IO, where the user file refers to the file presented by the virtual machine to the user, and after the storage virtualization layer receives the IO command for operating the IO of the virtual disk, according to the correspondence between the virtual disk and the volume file Or the correspondence between the virtual disk and the block device, converting the IO command into a file command for operating the volume file or the block device, the cluster file system or the distributed file system, according to the volume file or the block device and the physical disk IO Correspondence, convert file commands that operate on volume files or block devices into physical disks IO operation command, thus, achieved in response to a user operation.
然而,在现有技术中,当用户删除或移动某个文件时,无法实现实时回收空间,从而使得虚拟机的存储资源的利用率不高。However, in the prior art, when a user deletes or moves a certain file, real-time reclaim space cannot be realized, so that the utilization rate of the virtual machine's storage resources is not high.
发明内容Summary of the invention
本发明实施例提供一种虚拟机处理方法和虚拟计算机系统,能够提高虚拟机的存储资源的利用率。 The embodiment of the invention provides a virtual machine processing method and a virtual computer system, which can improve the utilization rate of the storage resources of the virtual machine.
本发明实施例第一方面提供一种虚拟机处理方法,应用于虚拟计算机系统内,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,所述方法包括:A first aspect of the embodiments of the present invention provides a virtual machine processing method, which is applied to a virtual computer system, where the system includes a virtual machine, a storage virtualization layer, a storage device, and a computing device, where the virtual machine is based on the computing device and The storage device generates, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, configured to allocate physical disk space of the storage device to each user file of each virtual machine. The methods include:
所述虚拟机的虚拟文件系统接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;The virtual file system of the virtual machine receives a file command for operating a user file of the virtual machine, where the file command carries a file path of the user file of the virtual machine in the virtual file system;
所述虚拟文件系统将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;The virtual file system forwards the file command for operating the user file of the virtual machine to the storage virtualization layer;
所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。The cluster file system of the storage virtualization layer is based on a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space. The file command for operating the user file of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
结合第一方面,在第一种可能的实现方式中,所述方法还包括:In conjunction with the first aspect, in a first possible implementation, the method further includes:
所述虚拟文件系统接收创建所述虚拟机的用户文件的请求;Receiving, by the virtual file system, a request to create a user file of the virtual machine;
所述虚拟文件系统转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;Transmitting, by the virtual file system, the request for creating a user file of the virtual machine to the storage virtualization layer;
所述存储虚拟化层的集群文件系统为所述虚拟机的用户文件分配对应的物理磁盘空间;The cluster file system of the storage virtualization layer allocates a corresponding physical disk space to a user file of the virtual machine;
所述存储虚拟化层在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。The storage virtualization layer establishes a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and records the first correspondence.
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:In conjunction with the first possible implementation of the first aspect, in a second possible implementation, the method further includes:
所述存储虚拟化层在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,还进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。The storage virtualization layer further performs user file isolation processing when establishing a first correspondence between the user file of the virtual machine and the physical disk space, and the user file isolation processing is used for the user of the virtual machine. The file points to a unique physical disk space.
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述存储虚拟化层在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;With reference to the second possible implementation of the first aspect, in a third possible implementation, the storage virtualization layer creates a folder corresponding to the virtual machine on the cluster file system, and records the a second correspondence between the virtual machine and the folder of the virtual machine;
在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机 的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;Creating a user file of the virtual machine in a folder of the virtual machine, where the virtual machine The file path of the user file in the cluster file system includes a path of a folder corresponding to the virtual machine and a file path of a user file of the virtual machine in the virtual file system;
所述存储虚拟化层在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。The storage virtualization layer records, in the cluster file system, a first correspondence between a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space.
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令,包括:With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation, the cluster file system of the storage virtualization layer is in the virtual file system according to a user file of the virtual machine a path, and a first correspondence between the user file of each virtual machine and the physical disk space, converting a file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device, include:
所述集群文件系统根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;Determining, by the cluster file system, a folder of the virtual machine according to a second correspondence between the virtual machine and a folder of the virtual machine;
根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;Generating a file path of the user file of the virtual machine in the cluster file system according to a path of a folder of the virtual machine and a file path of a user file of the virtual machine in the virtual file system;
根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。a first file corresponding to a file path of the user file of the virtual machine in the cluster file system, and a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space Converting a file command to operate the user file of the virtual machine into an IO command to operate on a physical disk of the storage device.
本发明实施例第二方面提供一种虚拟计算机系统,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,A second aspect of the embodiments of the present invention provides a virtual computer system, where the system includes a virtual machine, a storage virtualization layer, a storage device, and a computing device, where the virtual machine is generated based on the computing device and the storage device, The virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system for allocating physical disk space of the storage device to each user file of each virtual machine, where
所述虚拟机的虚拟文件系统,用于接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;a virtual file system of the virtual machine, configured to receive a file command for operating a user file of the virtual machine, where the file command carries a file path of a user file of the virtual machine in the virtual file system, And the file command for operating the user file of the virtual machine is forwarded to the storage virtualization layer;
所述存储虚拟化层,用于根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。 The storage virtualization layer is configured to: according to a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space, The file command for the user file operation of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
结合第二方面,在第一种可能的实现方式中,所述虚拟机的虚拟文件系统还用于接收创建所述虚拟机的用户文件的请求,转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;With reference to the second aspect, in a first possible implementation, the virtual file system of the virtual machine is further configured to receive a request for creating a user file of the virtual machine, and forward the request for creating a user file of the virtual machine to The storage virtualization layer;
所述存储虚拟化层还用于为所述虚拟机的用户文件分配对应的物理磁盘空间;在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。The storage virtualization layer is further configured to allocate a corresponding physical disk space to the user file of the virtual machine; and establish a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system And recording the first correspondence.
结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述存储虚拟化层还用于在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。With reference to the first possible implementation of the second aspect, in a second possible implementation, the storage virtualization layer is further configured to establish a user file of the virtual machine and a first space of the physical disk space. In the corresponding relationship, user file isolation processing is performed, and the user file isolation processing is used to point the user file of the virtual machine to a unique physical disk space.
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述存储虚拟化层具体用于在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。With reference to the second possible implementation of the second aspect, in a third possible implementation, the storage virtualization layer is specifically configured to create a folder corresponding to the virtual machine on the cluster file system, and Recording a second correspondence between the virtual machine and a folder of the virtual machine; creating a user file of the virtual machine in a folder of the virtual machine, where a user file of the virtual machine is in the cluster A file path in the file system includes a path of a folder corresponding to the virtual machine and a file path of a user file of the virtual machine in the virtual file system; and a user of the virtual machine is recorded in the cluster file system The first correspondence between the file path in the cluster file system and the allocated physical disk space.
结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述存储虚拟化层具体用于根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation, the storage virtualization layer is specifically configured to use a second correspondence between the virtual machine and a folder of the virtual machine Determining a folder of the virtual machine; generating a user file of the virtual machine according to a path of a folder of the virtual machine and a file path of a user file of the virtual machine in the virtual file system a file path in the cluster file system; a file path in the cluster file system according to a user file of the virtual machine, and a file path and allocation of the user file of the virtual machine in the cluster file system The first correspondence of the physical disk space converts the file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device.
本发明实施例提供的虚拟机处理方法和虚拟计算机系统,通过虚拟机的虚拟文件系统接收对虚拟机的用户文件进行操作的文件命令,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径;虚拟文件系统将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层;存储虚拟化层的集群文件系统根据虚拟机的用户文件在虚拟文件系统中的文件路径,以及每个虚拟机的用户 文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。当用户删除用户文件时,集群文件系统或分布式文件系统能够实时回收用户文件所占用的物理磁盘的数据区域,从而,提高虚拟机的存储空间的利用率。The virtual machine processing method and the virtual computer system provided by the embodiment of the present invention receive a file command for operating a user file of the virtual machine through the virtual file system of the virtual machine, and the file command carries the file of the virtual machine user file in the virtual file system. Path; the virtual file system forwards file commands for operating the user files of the virtual machine to the storage virtualization layer; the cluster file system of the storage virtualization layer is based on the file path of the virtual machine's user files in the virtual file system, and each Virtual machine user The first correspondence between the file and the physical disk space converts the file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device. When a user deletes a user file, the cluster file system or the distributed file system can reclaim the data area of the physical disk occupied by the user file in real time, thereby improving the utilization of the storage space of the virtual machine.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1为现有技术中虚拟计算机系统结构示意图;1 is a schematic structural diagram of a virtual computer system in the prior art;
图2为现有技术中虚拟机处理方法流程示意图;2 is a schematic flowchart of a virtual machine processing method in the prior art;
图3为本发明虚拟机计算系统结构示意图;3 is a schematic structural diagram of a virtual machine computing system according to the present invention;
图4为本发明虚拟机处理方法实施例一的流程示意图;4 is a schematic flowchart of Embodiment 1 of a virtual machine processing method according to the present invention;
图5为本发明虚拟机处理方法实施例二的流程示意图;FIG. 5 is a schematic flowchart of Embodiment 2 of a method for processing a virtual machine according to the present invention;
图6为本发明虚拟机处理方法实施例三的流程示意图;FIG. 6 is a schematic flowchart of Embodiment 3 of a method for processing a virtual machine according to the present invention;
图7为本发明虚拟机处理方法实施例四的流程示意图;7 is a schematic flowchart of Embodiment 4 of a method for processing a virtual machine according to the present invention;
图8为本发明文件隔离的一种实施例的结构示意图;FIG. 8 is a schematic structural diagram of an embodiment of file isolation according to the present invention; FIG.
图9为本发明文件隔离的另一种实施例的结构示意图;FIG. 9 is a schematic structural diagram of another embodiment of file isolation according to the present invention; FIG.
图10为本发明虚拟计算机系统又一实施例的结构示意图。FIG. 10 is a schematic structural diagram of still another embodiment of a virtual computer system according to the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图1为现有技术中虚拟计算机系统结构示意图,如图1所示,图1以虚拟机包含两个虚拟机为例,分别为虚拟机1和虚拟机2,每个虚拟机中包含两个呈现给用户文件,假设虚拟机1中的两个用户文件分别为用户文件A和用户文件B,虚拟机2中的两个文件分别为用户文件C和用户文件D,在现有技术中,当用户删除文件A时,在虚拟机中的处理流程如图2所示,图2为现有技术中 虚拟机处理方法流程示意图:1 is a schematic structural diagram of a virtual computer system in the prior art. As shown in FIG. 1 , FIG. 1 takes virtual machine as two virtual machines as examples, namely virtual machine 1 and virtual machine 2, and each virtual machine includes two. Presented to the user file, assuming that the two user files in the virtual machine 1 are the user file A and the user file B respectively, and the two files in the virtual machine 2 are the user file C and the user file D, respectively. In the prior art, when When the user deletes the file A, the processing flow in the virtual machine is as shown in FIG. 2, and FIG. 2 is in the prior art. Schematic diagram of the virtual machine processing method:
S201:NTFS接收到用户删除用户文件A的文件命令。S201: The NTFS receives the file command of the user to delete the user file A.
NTFS管理用户文件与虚拟机1的虚拟磁盘的IO的对应关系。NTFS manages the correspondence between user files and the IO of the virtual disk of virtual machine 1.
S202:NTFS根据用户文件A与虚拟机1的虚拟磁盘数据区域的对应关系,将删除用户文件A的文件命令转化为修改用户文件A所对应的虚拟磁盘元数据区域的IO命令。S202: The NTFS converts the file command for deleting the user file A into an IO command for modifying the virtual disk metadata area corresponding to the user file A according to the correspondence between the user file A and the virtual disk data area of the virtual machine 1.
即:将虚拟磁盘的元数据区域中用户文件A所对应的虚拟磁盘数据区域的状态从不可用修改为可用。从本质上讲就是将删除用户文件A的文件命令转化为修改虚拟磁盘的元数据区域的IO命令。That is, the state of the virtual disk data area corresponding to the user file A in the metadata area of the virtual disk is changed from unavailable to available. Essentially, the file command to delete user file A is converted to an IO command that modifies the metadata area of the virtual disk.
S203:NTFS将修改虚拟磁盘元数据区域的IO命令发送给存储虚拟化层。S203: The NTFS sends an IO command for modifying the virtual disk metadata area to the storage virtualization layer.
S204:存储虚拟化层根据虚拟磁盘的IO与卷文件的对应关系或者虚拟磁盘的IO与块设备的对应关系,将修改虚拟磁盘的元数据区域的IO命令转化为对卷文件或块设备的读写命令。S204: The storage virtualization layer converts the IO command of modifying the metadata area of the virtual disk into reading the volume file or the block device according to the correspondence between the IO of the virtual disk and the volume file or the correspondence between the IO of the virtual disk and the block device. Write a command.
S205:存储虚拟化层将对卷文件或块设备的读写命令发送给集群文件系统或块文件系统。S205: The storage virtualization layer sends a read/write command to the volume file or the block device to the cluster file system or the block file system.
S206:集群文件系统或块文件系统,将对卷文件或块设备的读写命令转化为对物理磁盘的IO的操作,从而,实现对用户操作的响应。S206: The cluster file system or the block file system converts the read/write command of the volume file or the block device into an operation of the IO of the physical disk, thereby implementing a response to the user operation.
然而,在上述过程中,当需要对用户文件A进行删除时,只将虚拟磁盘的元数据区域进行了修改,而在底层的集群文件系统或块文件系统管理的物理磁盘的元数据区域并未进行修改,因此,对于集群文件系统或块文件系统而言,无法感知虚拟机1中的用户文件A已被删除,因而无法及时回收用户文件A对应的物理磁盘,无法将用户文件A对应的物理磁盘给其他虚拟机使用,从而,造成虚拟机的存储资源利用率不高。前述部分仅是以对用户文件A的删除为例进行描述,对用户文件的移动等操作也存在同样问题,此处不再赘述。除此之外,从图1所示的架构中,还可以看出,存储虚拟化层管理的是虚拟磁盘的IO与卷文件的对应关系,或者虚拟磁盘的IO与块设备的对应关系,存储虚拟化层无法获知虚拟机中用户文件与虚拟磁盘数据区域的对应关系,因而,存储虚拟化层无法以用户文件为单位对用户文件进行处理,例如,对指定文件进行快照、加解密、请求重定向、请求分拆以及杀毒等处理。另外,在上述过程中,要经过多层的IO处理,CPU消耗较大,降低文件IO性能。However, in the above process, when the user file A needs to be deleted, only the metadata area of the virtual disk is modified, and the metadata area of the physical disk managed by the underlying cluster file system or the block file system is not The modification is performed. Therefore, for the cluster file system or the block file system, the user file A in the virtual machine 1 cannot be deleted. Therefore, the physical disk corresponding to the user file A cannot be recovered in time, and the physical file corresponding to the user file A cannot be obtained. Disks are used by other virtual machines, resulting in low utilization of virtual machine storage resources. The foregoing part is only described by taking the deletion of the user file A as an example, and the same problem exists for the operation of the user file, etc., and details are not described herein again. In addition, from the architecture shown in FIG. 1, it can be seen that the storage virtualization layer manages the correspondence between the IO and the volume file of the virtual disk, or the correspondence between the IO of the virtual disk and the block device, and stores The virtualization layer cannot know the correspondence between the user files in the virtual machine and the data area of the virtual disk. Therefore, the storage virtualization layer cannot process the user files in units of user files. For example, snapshot, encryption, and decryption of the specified file. Orientation, request splitting, and antivirus processing. In addition, in the above process, after multi-layer IO processing, CPU consumption is large, and file IO performance is lowered.
也可以说,按照上述的工作流程,由于NTFS文件系统向下对用户文件操作的屏蔽,造成如下两个功能问题:一、在虚拟机中的文件视图和存储虚拟化层视 图不能一一对应;二、在虚拟机里对某一文件的操作,在底层的存储虚拟化层无法确切的感知到,例如在虚拟机里删除一个文件,存储虚拟化层无法感知到,也就无法实时释放物理存储上对应的空间。It can also be said that according to the above workflow, because the NTFS file system shields the user file operation downward, the following two functional problems are caused: First, the file view and the storage virtualization layer view in the virtual machine. The graphs cannot be one-to-one; second, the operation of a file in a virtual machine cannot be accurately perceived in the underlying storage virtualization layer. For example, deleting a file in a virtual machine cannot be perceived by the storage virtualization layer. It is impossible to release the corresponding space on the physical storage in real time.
由于以上两个问题的存在,造成很多以文件为单位的操作无法达到用户预期的目的。例如、删除文件、移动文件后,无法及时释放物理空间;存储虚拟化层无法备份用户指定的某个特定文件;虚拟机之间无法共享某个特定的文件等等。另外,由于中间有多层转换,也消耗了大量不必要的计算资源。为了克服上述问题,本发明对虚拟机的架构进行了修改,如图3所示,图3为本发明虚拟机计算系统结构示意图,图3所示的系统中包括虚拟机、存储虚拟化层、存储设备和计算设备,其中,虚拟机基于计算设备和存储设备生成,虚拟机包括虚拟文件系统,存储虚拟化层包括集群文件系统,用于将存储设备的物理磁盘空间分配到每个虚拟机的每个用于文件,图3所示的系统中以包含两个虚拟机为例,分别为虚拟机1和虚拟机2,每个虚拟机中包含两个用户文件,假设虚拟机1中的两个用户文件分别为用户文件A和用户文件B,虚拟机2中的两个用户文件分别为用户文件C和用户文件D,当用户删除用户文件A时,处理流程如图4所示,图4为本发明虚拟机处理方法实施例一的流程示意图:Due to the existence of the above two problems, many file-based operations cannot achieve the intended purpose of the user. For example, after deleting a file or moving a file, the physical space cannot be released in time; the storage virtualization layer cannot back up a specific file specified by the user; a specific file cannot be shared between virtual machines, and so on. In addition, because there are multiple layers of conversion in the middle, it also consumes a lot of unnecessary computing resources. In order to overcome the above problems, the present invention modifies the architecture of the virtual machine. As shown in FIG. 3, FIG. 3 is a schematic structural diagram of a virtual machine computing system according to the present invention. The system shown in FIG. 3 includes a virtual machine, a storage virtualization layer, and a storage device and a computing device, wherein the virtual machine is generated based on the computing device and the storage device, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, and the physical disk space of the storage device is allocated to each virtual machine. For each file, the system shown in Figure 3 takes two virtual machines as examples, namely virtual machine 1 and virtual machine 2, each virtual machine contains two user files, assuming two of virtual machines 1 The user files are User File A and User File B. The two user files in VM 2 are User File C and User File D. When the user deletes User File A, the processing flow is shown in Figure 4. Figure 4 The flow chart of the first embodiment of the virtual machine processing method of the present invention is as follows:
S401:虚拟文件系统接收用户发送的对虚拟机的用户文件A进行删除操作的文件命令;S401: The virtual file system receives a file command sent by the user to delete the user file A of the virtual machine.
其中,文件命令中携带虚拟机的用户文件A在虚拟文件系统中的文件路径。The file command carries the file path of the user file A of the virtual machine in the virtual file system.
S402:虚拟文件系统将删除用户文件A的文件命令直接转发到存储虚拟化层。S402: The virtual file system directly forwards the file command of deleting the user file A to the storage virtualization layer.
S403:存储虚拟化层的集群文件系统根据虚拟机的用户文件A在虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件A进行删除操作的文件命令转换成为对存储设备的物理磁盘进行操作的IO命令。S403: The cluster file system of the storage virtualization layer is based on the file path of the virtual machine user file A in the virtual file system, and the first correspondence between the user file of each virtual machine and the physical disk space, and the user of the virtual machine The file command for file A to delete is converted into an IO command that operates on the physical disk of the storage device.
具体地,对物理磁盘进行操作的IO命令为修改物理磁盘的元数据区域的IO命令。Specifically, the IO command that operates on the physical disk is an IO command that modifies the metadata area of the physical disk.
通过上述S401~S403的步骤,实现对用户操作的响应。The response to the user operation is achieved by the steps S401 to S403 described above.
可以看出,在上述过程中,基于存储系统的配置,当用户删除用户文件A时,存储虚拟化层的集群文件系统或分布式文件系统能够实时回收用户文件A所占用的物理磁盘的数据区域,从而,提高虚拟机的存储空间的利用率。上面仅是以删除用户文件为例进行说明,移动用户文件的操作类似,此处不再赘述。 由于虚拟文件系统直接将用户对用户文件进行操作的文件命令转发给存储虚拟化层,存储虚拟化层管理用户文件与物理磁盘空间的对应关系,因此,在虚拟机中的文件视图和存储虚拟化层视图能够一一对应;在虚拟机里对某一文件的操作,在底层的存储虚拟化层可以确切的感知到,因此,存储虚拟化层可以以用户文件为单位,对用户文件进行处理,例如以用户文件为单位进行快照、加解密、请求重定向、请求分拆和杀毒等处理,便于对文件的管理。It can be seen that, in the foregoing process, based on the configuration of the storage system, when the user deletes the user file A, the cluster file system or the distributed file system of the storage virtualization layer can recover the data area of the physical disk occupied by the user file A in real time. , thereby increasing the utilization of the storage space of the virtual machine. The above is only an example of deleting a user file. The operation of moving a user file is similar, and is not described here. The virtual file system directly forwards the file command of the user to the user file to the storage virtualization layer. The storage virtualization layer manages the correspondence between the user file and the physical disk space. Therefore, the file view and storage virtualization in the virtual machine are performed. The layer view can correspond to one-to-one; the operation of a file in the virtual machine can be accurately perceived in the underlying storage virtualization layer. Therefore, the storage virtualization layer can process the user file in units of user files. For example, snapshots, encryption and decryption, request redirection, request splitting, and antivirus are processed in units of user files to facilitate file management.
除此之外,在上述实施例中,由于IO处理比现有技术少了两层,能够降低CPU消耗,提升文件IO性能。In addition, in the above embodiment, since the IO processing is two layers less than the prior art, the CPU consumption can be reduced and the file IO performance can be improved.
本发明的虚拟机计算系统结构使得在虚拟机中的文件视图和存储虚拟化层的文件视图保持一致,能够让存储虚拟化层以文件为单位进行相较于现有技术更为精细的存储管理,提升存储虚拟化的灵活性,降低存储操作对于计算资源的占用。The virtual machine computing system structure of the present invention keeps the file view in the virtual machine and the file view of the storage virtualization layer consistent, and enables the storage virtualization layer to perform finer storage management in a file unit than the prior art. Improve the flexibility of storage virtualization and reduce the occupation of computing resources for storage operations.
图4所示实施例仅以接收删除用户文件的文件命令为例进行了描述,文件命令还包括:创建用户文件的文件命令、修改用户文件的文件命令、查询用户文件的文件命令、读用户文件的文件命令、写用户文件的文件命令和锁用户文件的文件命令等。无论是哪种文件命令,在本发明中处理方式类似,下面统称为对用户文件进行操作的文件命令,对本发明的虚拟机的处理流程进行描述,图5为本发明虚拟机处理方法实施例二的流程示意图,本实施例所应用的虚拟计算机系统的结构与图3类似,此处不再赘述,本实施例的方法如图5所示:The embodiment shown in FIG. 4 is only described by taking the command of receiving a file for deleting a user file. The file command further includes: a file command for creating a user file, a file command for modifying a user file, a file command for querying a user file, and a user file for reading the user file. File commands, file commands for writing user files, file commands for locking user files, and so on. Regardless of the file command, the processing method is similar in the present invention. The following is a file command for operating the user file. The process flow of the virtual machine of the present invention is described. FIG. 5 is a second embodiment of the virtual machine processing method of the present invention. The structure of the virtual computer system in this embodiment is similar to that of FIG. 3, and is not described here again. The method in this embodiment is shown in FIG. 5:
S501:虚拟机的虚拟文件系统接收对虚拟机的用户文件进行操作的文件命令。S501: The virtual file system of the virtual machine receives a file command for operating a user file of the virtual machine.
其中,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径。The file command carries the file path of the virtual machine's user file in the virtual file system.
S502:虚拟文件系统将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层。S502: The virtual file system forwards the file command for operating the user file of the virtual machine to the storage virtualization layer.
S503:存储虚拟化层的集群文件系统根据虚拟机的用户文件在虚拟文件系统中的路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。S503: The cluster file system of the storage virtualization layer performs the virtual user file according to the path of the virtual machine user file in the virtual file system and the first correspondence between the user file and the physical disk space of each virtual machine. The file command of the operation is converted into an IO command that operates on the physical disk of the storage device.
通过上述S501~S503的步骤,实现对用户操作的响应。The response to the user operation is achieved by the steps S501 to S503 described above.
本实施例的方法,由于虚拟文件系统直接将用户对用户文件进行操作的文件命令转发给存储虚拟化层,存储虚拟化层管理用户文件与物理磁盘空间的对应关系,因此,在虚拟机中的文件视图和存储虚拟化层视图能够一一对应,存 储虚拟化层可以以用户文件为单位,对用户文件进行处理,例如以用户文件为单位进行快照、加解密、请求重定向、请求分拆和杀毒等处理,便于对文件的管理。并且由于IO处理比现有技术少了两层,能够降低CPU消耗,提升文件IO性能。In the method of the embodiment, the virtual file system directly forwards the file command of the user to the user file to the storage virtualization layer, and the storage virtualization layer manages the correspondence between the user file and the physical disk space, and therefore, in the virtual machine. File view and storage virtualization layer view can be one-to-one correspondence The storage virtualization layer can process user files in units of user files, such as snapshots, encryption and decryption, request redirection, request splitting, and antivirus processing in units of user files, which facilitates management of files. And because IO processing is two layers less than the prior art, it can reduce CPU consumption and improve file IO performance.
在上述实施例中,还包括创建虚拟机的用户文件的过程,具体流程如下如图6所示,图6为本发明虚拟机处理方法实施例三的流程示意图:In the above embodiment, the process of creating a user file of the virtual machine is as follows. The specific process is as follows: FIG. 6 is a schematic flowchart of the third embodiment of the virtual machine processing method of the present invention:
S601:虚拟文件系统接收创建虚拟机的用户文件的请求。S601: The virtual file system receives a request to create a user file of the virtual machine.
S602:虚拟文件系统转发创建虚拟机的用户文件的请求到存储虚拟化层。S602: The virtual file system forwards a request for creating a user file of the virtual machine to the storage virtualization layer.
S603:存储虚拟化层的集群文件系统为虚拟机的用户文件分配对应的物理磁盘空间。S603: The cluster file system of the storage virtualization layer allocates a corresponding physical disk space for the user file of the virtual machine.
S604:存储虚拟化层在集群文件系统中建立虚拟机的用户文件与物理磁盘空间的第一对应关系,并记录第一对应关系。S604: The storage virtualization layer establishes a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and records the first correspondence.
通过上述步骤S601~S604,可以实现创建虚拟机的用户文件,并在后续对虚拟机的用户文件进行删除、读、写等操作时,可使用上述第一对应关系。Through the above steps S601 to S604, the user file of the virtual machine can be created, and the first correspondence can be used when the user file of the virtual machine is deleted, read, or written.
在上述实施例中,存储虚拟化层在建立虚拟机的用户文件与物理磁盘空间的第一对应关系时,还进行了用户文件隔离处理,用户文件隔离处理用于将虚拟机的用户文件指向唯一的物理磁盘空间,确保不同的虚拟机之间的文件隔离,防止虚拟机访问到权限之外的文件。In the foregoing embodiment, the storage virtualization layer performs user file isolation processing when establishing the first correspondence between the user file of the virtual machine and the physical disk space, and the user file isolation processing is used to point the virtual machine user file to the unique file. The physical disk space ensures file isolation between different virtual machines and prevents virtual machines from accessing files outside of the permissions.
具体地,存储虚拟机化层进行用户文件隔离处理的实现方式如图7所示,图7为本发明虚拟机处理方法实施例四的流程示意图,图8为本发明文件隔离的一种实施例的结构示意图:参照图7和图8,本实施例的流程如下:For example, FIG. 7 is a schematic flowchart of a fourth embodiment of the method for processing a virtual machine according to the present invention. FIG. 8 is a schematic diagram of a file isolation method according to the present invention. Schematic diagram of the structure: Referring to FIG. 7 and FIG. 8, the flow of this embodiment is as follows:
S701:存储虚拟化层在集群文件系统上创建虚拟机对应的文件夹,并记录虚拟机与虚拟机的文件夹的第二对应关系。S701: The storage virtualization layer creates a folder corresponding to the virtual machine on the cluster file system, and records a second correspondence between the virtual machine and the virtual machine folder.
根据第二对应关系,创建虚拟机的用户文件时,全部创建在虚拟机对应的虚拟机的文件夹中。According to the second correspondence, when the user files of the virtual machine are created, all of them are created in the folder of the virtual machine corresponding to the virtual machine.
S702:在虚拟机的文件夹中创建虚拟机的用户文件。S702: Create a user file of the virtual machine in a folder of the virtual machine.
其中,虚拟机的用户文件在集群文件系统中的文件路径包含虚拟机对应的文件夹的路径和虚拟机的用户文件在虚拟文件系统中的文件路径。The file path of the virtual machine user file in the cluster file system includes the path of the folder corresponding to the virtual machine and the file path of the virtual machine user file in the virtual file system.
例如:虚拟机对应的文件夹的路径为/datastore_1/VM1/(此路径根据产品需要可以改动),虚拟机的用户文件在虚拟文件系统中的文件路径为:c:\windows\test.txt,则虚拟机的用户文件在集群文件系统中的文件路径为: /datastore_1/VM1/windows/test.txt。For example, the path of the folder corresponding to the virtual machine is /datastore_1/VM1/ (this path can be changed according to the product requirements), and the file path of the virtual machine user file in the virtual file system is: c:\windows\test.txt, The file path of the virtual machine user file in the cluster file system is: /datastore_1/VM1/windows/test.txt.
S703:存储虚拟化层在集群文件系统中记录虚拟机的用户文件在集群文件系统中的文件路径与分配的物理磁盘空间的第一对应关系。S703: The storage virtualization layer records, in the cluster file system, a first correspondence between a file path of the virtual machine user file in the cluster file system and the allocated physical disk space.
本发明还提供一种存储虚拟机化层进行用户文件隔离处理方式,通过自定义元数据文件进行文件隔离处理,结合图9,图9为本发明文件隔离的另一种实施例的结构示意图;由元数据文件记录虚拟机文件与物理磁盘的对应关系、权限、差分数据等,利用元数据可以做到虚拟机共享访问文件;虚拟机运行过程中,根据文件操作,首先创建元数据文件,元数据文件的路径与第一种实现方式的路径保持一致;元数据文件中记录与之对应的虚拟机文件的路径信息。例如:虚拟机中的文件路径为:c:\windows\test.txt;数据文件在集群文件系统上的路径为:/datastore_1/shared/windows/test.txt;元数据文件的路径为:/datastore_1/VM1/windows/test.meta,则元数据文件的路径信息为:/datastore_1/shared/windows/test.txt。The present invention further provides a storage virtual machine layer for user file isolation processing, and a file isolation processing by using a custom metadata file. Referring to FIG. 9, FIG. 9 is a schematic structural diagram of another embodiment of file isolation according to the present invention; The metadata file records the correspondence between the virtual machine file and the physical disk, permissions, and differential data. The metadata can be used to share the access file by using the metadata. During the running of the virtual machine, the metadata file is first created according to the file operation. The path of the data file is consistent with the path of the first implementation; the path information of the virtual machine file corresponding to the data file is recorded in the metadata file. For example, the file path in the virtual machine is: c:\windows\test.txt; the path of the data file on the cluster file system is: /datastore_1/shared/windows/test.txt; the path of the metadata file is: /datastore_1 /VM1/windows/test.meta, the path information of the metadata file is: /datastore_1/shared/windows/test.txt.
通过上述两种方式可以实现文件隔离,防止虚拟机访问到权限之外的文件。File isolation can be achieved through the above two methods to prevent the virtual machine from accessing files other than the permission.
在上述实施例的基础上,图5所示实施例的S503的具体实现如下:集群文件系统根据虚拟机与所述虚拟机的文件夹的第二对应关系,确定虚拟机的文件夹;根据虚拟机的文件夹的路径和虚拟机的用户文件在虚拟文件系统中的文件路径,生成虚拟机的用户文件在集群文件系统中的文件路径;根据虚拟机的用户文件在集群文件系统中的文件路径,以及虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。On the basis of the foregoing embodiment, the specific implementation of S503 in the embodiment shown in FIG. 5 is as follows: the cluster file system determines the folder of the virtual machine according to the second correspondence between the virtual machine and the folder of the virtual machine; The path of the folder of the machine and the file path of the user file of the virtual machine in the virtual file system, the file path of the user file of the virtual machine in the cluster file system; the file path of the user file in the cluster file system according to the virtual machine And a first correspondence between the file path of the virtual machine user file in the cluster file system and the allocated physical disk space, and the file command for operating the user file of the virtual machine is converted into a physical to the storage device The IO command that the disk is operating on.
本发明还提供一种虚拟计算机系统实施例,参见图3,上述系统包括虚拟机、存储虚拟化层、存储设备(LUN)和计算设备(未示出),上述虚拟机基于上述计算设备和上述存储设备生成,上述虚拟机包括虚拟文件系统,上述存储虚拟化层包括集群文件系统,用于将上述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,上述虚拟机的虚拟文件系统,用于接收对上述虚拟机的用户文件进行操作的文件命令,上述文件命令携带上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,将上述对上述虚拟机的用户文件进行操作的文件命令转发到上述存储虚拟化层;上述存储虚拟化层,用于根据上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,以及每个虚拟机的用户 文件与物理磁盘空间的第一对应关系,将对上述虚拟机的用户文件进行操作的文件命令转换成对上述存储设备的物理磁盘进行操作的IO命令。The present invention further provides an embodiment of a virtual computer system. Referring to FIG. 3, the system includes a virtual machine, a storage virtualization layer, a storage device (LUN), and a computing device (not shown). The virtual machine is based on the computing device and the foregoing The storage device generates, the virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, configured to allocate a physical disk space of the storage device to each user file of each virtual machine, where the virtual machine is a virtual file system, configured to receive a file command for operating a user file of the virtual machine, where the file command carries a file path of the user file of the virtual machine in the virtual file system, and performs the foregoing user file of the virtual machine The file command of the operation is forwarded to the storage virtualization layer; the storage virtualization layer is used for the file path in the virtual file system according to the user file of the virtual machine, and the user of each virtual machine. The first correspondence between the file and the physical disk space converts the file command for operating the user file of the virtual machine into an IO command for operating the physical disk of the storage device.
在上述实施例中,上述虚拟机的虚拟文件系统还用于接收创建上述虚拟机的用户文件的请求,转发上述创建虚拟机的用户文件的请求到上述存储虚拟化层;上述存储虚拟化层还用于为上述虚拟机的用户文件分配对应的物理磁盘空间;在上述集群文件系统中建立上述虚拟机的用户文件与上述物理磁盘空间的第一对应关系,并记录上述第一对应关系。In the above embodiment, the virtual file system of the virtual machine is further configured to receive a request for creating a user file of the virtual machine, and forward the request for creating a user file of the virtual machine to the storage virtualization layer; the storage virtualization layer further And allocating a corresponding physical disk space for the user file of the virtual machine; establishing a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and recording the first correspondence.
在上述实施例中,上述存储虚拟化层还用于在建立上述虚拟机的用户文件与上述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,上述用户文件隔离处理用于将上述虚拟机的用户文件指向唯一的物理磁盘空间。In the above embodiment, the storage virtualization layer is further configured to perform user file isolation processing when establishing a first correspondence between the user file of the virtual machine and the physical disk space, where the user file isolation processing is used to The user file of the machine points to a unique physical disk space.
在上述实施例中,上述存储虚拟化层具体用于在上述集群文件系统上创建上述虚拟机对应的文件夹,并记录上述虚拟机与上述虚拟机的文件夹的第二对应关系;在上述虚拟机的文件夹中创建上述虚拟机的用户文件,其中,上述虚拟机的用户文件在上述集群文件系统中的文件路径包含上述虚拟机对应的文件夹的路径和上述虚拟机的用户文件在上述虚拟文件系统中的文件路径;在上述集群文件系统中记录上述虚拟机的用户文件在上述集群文件系统中的文件路径与分配的上述物理磁盘空间的第一对应关系。In the above embodiment, the storage virtualization layer is specifically configured to create a folder corresponding to the virtual machine on the cluster file system, and record a second correspondence between the virtual machine and the folder of the virtual machine; a user file of the virtual machine is created in a folder of the virtual machine, wherein a file path of the user file of the virtual machine in the cluster file system includes a path of a folder corresponding to the virtual machine and a user file of the virtual machine in the virtual a file path in the file system; the first corresponding relationship between the file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space is recorded in the cluster file system.
在上述实施例中,上述存储虚拟化层具体用于根据上述虚拟机与上述虚拟机的文件夹的第二对应关系,确定上述虚拟机的文件夹;根据上述虚拟机的文件夹的路径和上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,生成上述虚拟机的用户文件在上述集群文件系统中的文件路径;根据上述虚拟机的用户文件在上述集群文件系统中的文件路径,以及上述虚拟机的用户文件在上述集群文件系统中的文件路径与分配的上述物理磁盘空间的第一对应关系,将对上述虚拟机的用户文件进行操作的文件命令转换成对上述存储设备的物理磁盘进行操作的IO命令。In the above embodiment, the storage virtualization layer is specifically configured to determine a folder of the virtual machine according to a second correspondence between the virtual machine and a folder of the virtual machine; and according to the path of the folder of the virtual machine and the foregoing a file path of the virtual machine user file in the virtual file system, generating a file path of the user file of the virtual machine in the cluster file system; a file path in the cluster file system according to the user file of the virtual machine, and Converting, by the user file of the virtual machine, a file path of the user file of the virtual machine to a physical disk of the storage device, in a first correspondence between the file path in the cluster file system and the allocated physical disk space. The IO command to operate.
上述系统实施例对应地可用于执行方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The foregoing system embodiment is correspondingly used to implement the technical solution of the method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
图10为本发明虚拟计算机系统又一实施例的结构示意图,如图10所示,本实施例的系统包括存储器1010和处理器1020,存储器1010可以包括随机存储器、闪存、只读存储器、可编程只读存储器、非易失性存储器或寄存器等。处理器1020可以是中央处理器(Central Processing Unit,CPU)。存储器1010 用于存储可执行指令。处理器1020可以执行存储器1010中存储的可执行指令,例如,处理器1020用于接收对虚拟机的用户文件进行操作的文件命令,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径;将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层;根据虚拟机的用户文件在虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。10 is a schematic structural diagram of still another embodiment of a virtual computer system according to the present invention. As shown in FIG. 10, the system of this embodiment includes a memory 1010 and a processor 1020. The memory 1010 may include random access memory, flash memory, read only memory, and programmable. Read only memory, nonvolatile memory or registers, etc. The processor 1020 may be a Central Processing Unit (CPU). Memory 1010 Used to store executable instructions. The processor 1020 can execute executable instructions stored in the memory 1010, for example, the processor 1020 is configured to receive a file command to operate a user file of the virtual machine, and the file command carries a file path of the user file of the virtual machine in the virtual file system. The file command that operates the user file of the virtual machine is forwarded to the storage virtualization layer; the file path in the virtual file system according to the virtual machine's user file, and the first user disk and physical disk space of each virtual machine Correspondence, the file command that operates the user file of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
上述系统实施例对应地可用于执行方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The foregoing system embodiment is correspondingly used to implement the technical solution of the method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.

Claims (10)

  1. 一种虚拟机处理方法,其特征在于,应用于虚拟计算机系统内,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,所述方法包括:A virtual machine processing method, characterized by being applied to a virtual computer system, the system comprising a virtual machine, a storage virtualization layer, a storage device, and a computing device, the virtual machine being based on the computing device and the storage device The virtual machine includes a virtual file system, and the storage virtualization layer includes a cluster file system, configured to allocate a physical disk space of the storage device to each user file of each virtual machine, where the method includes:
    接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;Receiving a file command for operating a user file of the virtual machine, where the file command carries a file path of a user file of the virtual machine in the virtual file system;
    所述虚拟文件系统将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;The virtual file system forwards the file command for operating the user file of the virtual machine to the storage virtualization layer;
    所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。The cluster file system of the storage virtualization layer is based on a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space. The file command for operating the user file of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述虚拟文件系统接收创建所述虚拟机的用户文件的请求;Receiving, by the virtual file system, a request to create a user file of the virtual machine;
    所述虚拟文件系统转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;Transmitting, by the virtual file system, the request for creating a user file of the virtual machine to the storage virtualization layer;
    所述存储虚拟化层的集群文件系统为所述虚拟机的用户文件分配对应的物理磁盘空间;The cluster file system of the storage virtualization layer allocates a corresponding physical disk space to a user file of the virtual machine;
    所述存储虚拟化层在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。The storage virtualization layer establishes a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system, and records the first correspondence.
  3. 根据权利要求2所述的方法,其特征在于,还包括:The method of claim 2, further comprising:
    所述存储虚拟化层在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,还进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。The storage virtualization layer further performs user file isolation processing when establishing a first correspondence between the user file of the virtual machine and the physical disk space, and the user file isolation processing is used for the user of the virtual machine. The file points to a unique physical disk space.
  4. 根据权利要求3所述的方法,其特征在于,所述存储虚拟化层进行用户文件隔离处理,包括:The method according to claim 3, wherein the storage virtualization layer performs user file isolation processing, including:
    所述存储虚拟化层在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;The storage virtualization layer creates a folder corresponding to the virtual machine on the cluster file system, and records a second correspondence between the virtual machine and a folder of the virtual machine;
    在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机 的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;Creating a user file of the virtual machine in a folder of the virtual machine, where the virtual machine The file path of the user file in the cluster file system includes a path of a folder corresponding to the virtual machine and a file path of a user file of the virtual machine in the virtual file system;
    所述存储虚拟化层在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。The storage virtualization layer records, in the cluster file system, a first correspondence between a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space.
  5. 根据权利要求4所述的方法,其特征在于,所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令,包括:The method according to claim 4, wherein the cluster file system of the storage virtualization layer is based on a file path of a user file of the virtual machine in the virtual file system, and a user file of each virtual machine. And the first command of the physical disk space, the file command for operating the user file of the virtual machine is converted into an IO command for operating the physical disk of the storage device, including:
    所述集群文件系统根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;Determining, by the cluster file system, a folder of the virtual machine according to a second correspondence between the virtual machine and a folder of the virtual machine;
    根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;Generating a file path of the user file of the virtual machine in the cluster file system according to a path of a folder of the virtual machine and a file path of a user file of the virtual machine in the virtual file system;
    根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。a first file corresponding to a file path of the user file of the virtual machine in the cluster file system, and a file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space Converting a file command to operate the user file of the virtual machine into an IO command to operate on a physical disk of the storage device.
  6. 一种虚拟计算机系统,其特征在于,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,A virtual computer system, the system comprising a virtual machine, a storage virtualization layer, a storage device, and a computing device, the virtual machine being generated based on the computing device and the storage device, the virtual machine including a virtual machine a file system, the storage virtualization layer includes a cluster file system, configured to allocate a physical disk space of the storage device to each user file of each virtual machine, where
    所述虚拟机的虚拟文件系统,用于接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;a virtual file system of the virtual machine, configured to receive a file command for operating a user file of the virtual machine, where the file command carries a file path of a user file of the virtual machine in the virtual file system, And the file command for operating the user file of the virtual machine is forwarded to the storage virtualization layer;
    所述存储虚拟化层,用于根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。The storage virtualization layer is configured to: according to a file path of the user file of the virtual machine in the virtual file system, and a first correspondence between a user file of each virtual machine and a physical disk space, The file command for the user file operation of the virtual machine is converted into an IO command that operates on the physical disk of the storage device.
  7. 根据权利要求6所述的系统,其特征在于,所述虚拟机的虚拟文件系统 还用于接收创建所述虚拟机的用户文件的请求,转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;The system of claim 6 wherein said virtual machine's virtual file system And a method for receiving a request for creating a user file of the virtual machine, and forwarding the request for creating a user file of the virtual machine to the storage virtualization layer;
    所述存储虚拟化层还用于为所述虚拟机的用户文件分配对应的物理磁盘空间;在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。The storage virtualization layer is further configured to allocate a corresponding physical disk space to the user file of the virtual machine; and establish a first correspondence between the user file of the virtual machine and the physical disk space in the cluster file system And recording the first correspondence.
  8. 根据权利要求7所述的系统,其特征在于,所述存储虚拟化层还用于在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。The system according to claim 7, wherein the storage virtualization layer is further configured to perform user file isolation processing when establishing a first correspondence between a user file of the virtual machine and the physical disk space. The user file isolation process is used to point the user file of the virtual machine to a unique physical disk space.
  9. 根据权利要求8所述的系统,其特征在于,所述存储虚拟化层具体用于在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。The system according to claim 8, wherein the storage virtualization layer is specifically configured to create a folder corresponding to the virtual machine on the cluster file system, and record the virtual machine and the virtual machine. a second correspondence of the folder; creating a user file of the virtual machine in a folder of the virtual machine, wherein a file path of the user file of the virtual machine in the cluster file system includes the virtual a path of a folder corresponding to the machine and a file path of the user file of the virtual machine in the virtual file system; recording, in the cluster file system, a file of the user file of the virtual machine in the cluster file system The first correspondence between the path and the allocated physical disk space.
  10. 根据权利要求9所述的系统,其特征在于,所述存储虚拟化层具体用于根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。 The system according to claim 9, wherein the storage virtualization layer is specifically configured to determine a folder of the virtual machine according to a second correspondence between the virtual machine and a folder of the virtual machine; Generating, according to the path of the folder of the virtual machine and the file path of the user file of the virtual machine in the virtual file system, a file path of the user file of the virtual machine in the cluster file system; The file path of the user file of the virtual machine in the cluster file system, and the first correspondence between the file path of the user file of the virtual machine in the cluster file system and the allocated physical disk space, A file command that operates on a user file of the virtual machine is converted into an IO command that operates on a physical disk of the storage device.
PCT/CN2015/083227 2014-11-19 2015-07-02 Virtual machine processing method and virtual computer system WO2016078420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410663419.5A CN104461685B (en) 2014-11-19 2014-11-19 Virtual machine processing method and virtual computer system
CN201410663419.5 2014-11-19

Publications (1)

Publication Number Publication Date
WO2016078420A1 true WO2016078420A1 (en) 2016-05-26

Family

ID=52907789

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083227 WO2016078420A1 (en) 2014-11-19 2015-07-02 Virtual machine processing method and virtual computer system

Country Status (2)

Country Link
CN (1) CN104461685B (en)
WO (1) WO2016078420A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924202A (en) * 2018-06-25 2018-11-30 郑州云海信息技术有限公司 A kind of the data disaster tolerance method and relevant apparatus of distributed type assemblies
US10817649B2 (en) 2018-01-09 2020-10-27 Saudi Arabian Oil Comapny Unicode conversion with minimal downtime

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461685B (en) * 2014-11-19 2017-09-29 华为技术有限公司 Virtual machine processing method and virtual computer system
CN105260323B (en) * 2015-10-21 2019-02-05 华为技术有限公司 A kind of Storage Virtualization data processing method and device
AU2016404863B2 (en) * 2016-04-27 2020-01-23 Honor Device Co., Ltd. Patch-upgrade-based file processing method and apparatus, terminal, and storage medium
CN105912714A (en) * 2016-04-29 2016-08-31 乐视控股(北京)有限公司 File management method and system of mobile equipment
CN109343928B (en) * 2018-08-28 2022-02-08 广东微云科技股份有限公司 Virtual memory file redirection method and system for virtual machine in virtualization cluster
CN111045859B (en) * 2018-10-12 2023-11-03 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for backing up virtual machines
CN110196754A (en) * 2019-04-24 2019-09-03 苏州浪潮智能科技有限公司 The direction connection method and device of a kind of GPU equipment at Linux KVM
CN110535829B (en) * 2019-07-24 2022-06-07 视联动力信息技术股份有限公司 Data interaction method and video networking system
US10769167B1 (en) * 2019-12-20 2020-09-08 Lifebit Biotech Limited Federated computational analysis over distributed data
CN116705171B (en) * 2023-05-24 2024-04-05 西北大学 Batch biological data processing method, device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105737A (en) * 2006-07-11 2008-01-16 任永坚 Storage medium processing method, system and data read-write operation method and system
CN102375695A (en) * 2010-08-23 2012-03-14 联想(北京)有限公司 Disc accessing method and computer system
US20120167080A1 (en) * 2010-12-22 2012-06-28 Vmware, Inc. Guest file system introspection and defragmentable virtual disk format for space efficiency
CN102968331A (en) * 2012-11-27 2013-03-13 中标软件有限公司 Virtual machine management system and file access method
US20140047208A1 (en) * 2012-08-07 2014-02-13 Xyratex Technology Limited Method of controlling the capacity of a virtual storage system, and a virtual storage system
CN104461685A (en) * 2014-11-19 2015-03-25 华为技术有限公司 Virtual machine processing method and virtual computer system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI307026B (en) * 2005-12-30 2009-03-01 Ind Tech Res Inst System and method for storage management
CN101419535B (en) * 2008-11-19 2010-07-14 北京航空航天大学 Distributed virtual magnetic disc system of virtual machine
CN103020199A (en) * 2012-12-05 2013-04-03 上海创图网络科技发展有限公司 Virtual file system suitable for different operating system platforms and application thereof
CN103593147B (en) * 2013-11-07 2016-08-17 华为技术有限公司 A kind of method and device of digital independent

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105737A (en) * 2006-07-11 2008-01-16 任永坚 Storage medium processing method, system and data read-write operation method and system
CN102375695A (en) * 2010-08-23 2012-03-14 联想(北京)有限公司 Disc accessing method and computer system
US20120167080A1 (en) * 2010-12-22 2012-06-28 Vmware, Inc. Guest file system introspection and defragmentable virtual disk format for space efficiency
US20140047208A1 (en) * 2012-08-07 2014-02-13 Xyratex Technology Limited Method of controlling the capacity of a virtual storage system, and a virtual storage system
CN102968331A (en) * 2012-11-27 2013-03-13 中标软件有限公司 Virtual machine management system and file access method
CN104461685A (en) * 2014-11-19 2015-03-25 华为技术有限公司 Virtual machine processing method and virtual computer system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10817649B2 (en) 2018-01-09 2020-10-27 Saudi Arabian Oil Comapny Unicode conversion with minimal downtime
CN108924202A (en) * 2018-06-25 2018-11-30 郑州云海信息技术有限公司 A kind of the data disaster tolerance method and relevant apparatus of distributed type assemblies

Also Published As

Publication number Publication date
CN104461685A (en) 2015-03-25
CN104461685B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
WO2016078420A1 (en) Virtual machine processing method and virtual computer system
US11347408B2 (en) Shared network-available storage that permits concurrent data access
US20210165719A1 (en) Object-level database restore
US10359968B1 (en) Smart data movement among virtual storage domains
US10374792B1 (en) Layout-independent cryptographic stamp of a distributed dataset
JP5955870B2 (en) Method, computer readable storage medium and system for optimal compression of a virtual disk
US9729659B2 (en) Caching content addressable data chunks for storage virtualization
US8966188B1 (en) RAM utilization in a virtual environment
US10437487B2 (en) Prioritized backup operations for virtual machines
US20150154227A1 (en) Method for processing input/output request, host, server, and virtual machine
US20210064486A1 (en) Access arbitration to a shared cache storage area in a data storage management system for live browse, file indexing, backup and/or restore operations
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
US9430492B1 (en) Efficient scavenging of data and metadata file system blocks
US10587686B2 (en) Sustaining backup service level objectives using dynamic resource allocation
CN106777394B (en) Cluster file system
WO2019000949A1 (en) Metadata storage method and system in distributed storage system, and storage medium
US10678431B1 (en) System and method for intelligent data movements between non-deduplicated and deduplicated tiers in a primary storage array
WO2017113861A1 (en) Data access method and device
US10346077B2 (en) Region-integrated data deduplication
US10705733B1 (en) System and method of improving deduplicated storage tier management for primary storage arrays by including workload aggregation statistics
JP2017531892A (en) Improved apparatus and method for performing a snapshot of a block level storage device
WO2017054636A1 (en) Method and apparatus for processing virtual machine snapshots
US11513902B1 (en) System and method of dynamic system resource allocation for primary storage systems with virtualized embedded data protection
US11726885B2 (en) Efficient method and system of intelligent deploying file level restore agent in multicloud
US20180011661A1 (en) Data locality in a hyperconverged computing system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15861844

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15861844

Country of ref document: EP

Kind code of ref document: A1