WO2016078420A1 - 虚拟机处理方法和虚拟计算机系统 - Google Patents
虚拟机处理方法和虚拟计算机系统 Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information 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.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种虚拟机处理方法和虚拟计算机系统,通过虚拟机的虚拟文件系统接收对虚拟机的用户文件进行操作的文件命令(S501),文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径;虚拟文件系统将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层(S502);存储虚拟化层的集群文件系统根据虚拟机的用户文件在虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令(S503)。当用户删除用户文件时,集群文件系统或分布式文件系统能够实时回收用户文件所占用的物理磁盘的数据区域,从而提高虚拟机的存储空间的利用率。
Description
本申请要求于2014年11月19日提交中国专利局、申请号为201410663419.5、发明名称为“虚拟机处理方法和虚拟计算机系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明实施例涉及计算机技术,尤其涉及一种虚拟机处理方法和虚拟计算机系统。
虚拟化技术因具有能够提高资源的利用率,降低系统管理成本等优点,虚拟化技术的应用越来越广泛。
通常,在一个计算机中可运行多个虚拟机,每个虚拟机上都会运行若干个文件系统,例如:窗口(Windows)虚拟机会运行新技术文件系统(New Technology File System,以下简称:NTFS),以NTFS为例,其他文件系统原理相同,NTFS用于接收用户发送的对用户文件进行操作的文件命令,并根据用户文件与虚拟磁盘的IO之间的对应关系,将上述文件命令转化为对虚拟磁盘的IO进行操作的IO命令,这里的用户文件是指虚拟机对用户呈现的文件,存储虚拟化层接收到对虚拟磁盘的IO进行操作的IO命令之后,根据虚拟磁盘与卷文件的对应关系或虚拟磁盘与块设备的对应关系,将IO命令转化为对卷文件或块设备进行操作的文件命令,集群文件系统或分布式文件系统,根据卷文件或块设备与物理磁盘的IO之间的对应关系,将对卷文件或块设备进行操作的文件命令转化为对物理磁盘进行操作的IO命令,从而,实现对用户操作的响应。
然而,在现有技术中,当用户删除或移动某个文件时,无法实现实时回收空间,从而使得虚拟机的存储资源的利用率不高。
发明内容
本发明实施例提供一种虚拟机处理方法和虚拟计算机系统,能够提高虚拟机的存储资源的利用率。
本发明实施例第一方面提供一种虚拟机处理方法,应用于虚拟计算机系统内,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,所述方法包括:
所述虚拟机的虚拟文件系统接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;
所述虚拟文件系统将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;
所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
结合第一方面,在第一种可能的实现方式中,所述方法还包括:
所述虚拟文件系统接收创建所述虚拟机的用户文件的请求;
所述虚拟文件系统转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;
所述存储虚拟化层的集群文件系统为所述虚拟机的用户文件分配对应的物理磁盘空间;
所述存储虚拟化层在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:
所述存储虚拟化层在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,还进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述存储虚拟化层在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;
在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机
的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;
所述存储虚拟化层在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令,包括:
所述集群文件系统根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;
根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;
根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
本发明实施例第二方面提供一种虚拟计算机系统,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,
所述虚拟机的虚拟文件系统,用于接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;
所述存储虚拟化层,用于根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
结合第二方面,在第一种可能的实现方式中,所述虚拟机的虚拟文件系统还用于接收创建所述虚拟机的用户文件的请求,转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;
所述存储虚拟化层还用于为所述虚拟机的用户文件分配对应的物理磁盘空间;在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。
结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述存储虚拟化层还用于在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述存储虚拟化层具体用于在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。
结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述存储虚拟化层具体用于根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
本发明实施例提供的虚拟机处理方法和虚拟计算机系统,通过虚拟机的虚拟文件系统接收对虚拟机的用户文件进行操作的文件命令,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径;虚拟文件系统将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层;存储虚拟化层的集群文件系统根据虚拟机的用户文件在虚拟文件系统中的文件路径,以及每个虚拟机的用户
文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。当用户删除用户文件时,集群文件系统或分布式文件系统能够实时回收用户文件所占用的物理磁盘的数据区域,从而,提高虚拟机的存储空间的利用率。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中虚拟计算机系统结构示意图;
图2为现有技术中虚拟机处理方法流程示意图;
图3为本发明虚拟机计算系统结构示意图;
图4为本发明虚拟机处理方法实施例一的流程示意图;
图5为本发明虚拟机处理方法实施例二的流程示意图;
图6为本发明虚拟机处理方法实施例三的流程示意图;
图7为本发明虚拟机处理方法实施例四的流程示意图;
图8为本发明文件隔离的一种实施例的结构示意图;
图9为本发明文件隔离的另一种实施例的结构示意图;
图10为本发明虚拟计算机系统又一实施例的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为现有技术中虚拟计算机系统结构示意图,如图1所示,图1以虚拟机包含两个虚拟机为例,分别为虚拟机1和虚拟机2,每个虚拟机中包含两个呈现给用户文件,假设虚拟机1中的两个用户文件分别为用户文件A和用户文件B,虚拟机2中的两个文件分别为用户文件C和用户文件D,在现有技术中,当用户删除文件A时,在虚拟机中的处理流程如图2所示,图2为现有技术中
虚拟机处理方法流程示意图:
S201:NTFS接收到用户删除用户文件A的文件命令。
NTFS管理用户文件与虚拟机1的虚拟磁盘的IO的对应关系。
S202:NTFS根据用户文件A与虚拟机1的虚拟磁盘数据区域的对应关系,将删除用户文件A的文件命令转化为修改用户文件A所对应的虚拟磁盘元数据区域的IO命令。
即:将虚拟磁盘的元数据区域中用户文件A所对应的虚拟磁盘数据区域的状态从不可用修改为可用。从本质上讲就是将删除用户文件A的文件命令转化为修改虚拟磁盘的元数据区域的IO命令。
S203:NTFS将修改虚拟磁盘元数据区域的IO命令发送给存储虚拟化层。
S204:存储虚拟化层根据虚拟磁盘的IO与卷文件的对应关系或者虚拟磁盘的IO与块设备的对应关系,将修改虚拟磁盘的元数据区域的IO命令转化为对卷文件或块设备的读写命令。
S205:存储虚拟化层将对卷文件或块设备的读写命令发送给集群文件系统或块文件系统。
S206:集群文件系统或块文件系统,将对卷文件或块设备的读写命令转化为对物理磁盘的IO的操作,从而,实现对用户操作的响应。
然而,在上述过程中,当需要对用户文件A进行删除时,只将虚拟磁盘的元数据区域进行了修改,而在底层的集群文件系统或块文件系统管理的物理磁盘的元数据区域并未进行修改,因此,对于集群文件系统或块文件系统而言,无法感知虚拟机1中的用户文件A已被删除,因而无法及时回收用户文件A对应的物理磁盘,无法将用户文件A对应的物理磁盘给其他虚拟机使用,从而,造成虚拟机的存储资源利用率不高。前述部分仅是以对用户文件A的删除为例进行描述,对用户文件的移动等操作也存在同样问题,此处不再赘述。除此之外,从图1所示的架构中,还可以看出,存储虚拟化层管理的是虚拟磁盘的IO与卷文件的对应关系,或者虚拟磁盘的IO与块设备的对应关系,存储虚拟化层无法获知虚拟机中用户文件与虚拟磁盘数据区域的对应关系,因而,存储虚拟化层无法以用户文件为单位对用户文件进行处理,例如,对指定文件进行快照、加解密、请求重定向、请求分拆以及杀毒等处理。另外,在上述过程中,要经过多层的IO处理,CPU消耗较大,降低文件IO性能。
也可以说,按照上述的工作流程,由于NTFS文件系统向下对用户文件操作的屏蔽,造成如下两个功能问题:一、在虚拟机中的文件视图和存储虚拟化层视
图不能一一对应;二、在虚拟机里对某一文件的操作,在底层的存储虚拟化层无法确切的感知到,例如在虚拟机里删除一个文件,存储虚拟化层无法感知到,也就无法实时释放物理存储上对应的空间。
由于以上两个问题的存在,造成很多以文件为单位的操作无法达到用户预期的目的。例如、删除文件、移动文件后,无法及时释放物理空间;存储虚拟化层无法备份用户指定的某个特定文件;虚拟机之间无法共享某个特定的文件等等。另外,由于中间有多层转换,也消耗了大量不必要的计算资源。为了克服上述问题,本发明对虚拟机的架构进行了修改,如图3所示,图3为本发明虚拟机计算系统结构示意图,图3所示的系统中包括虚拟机、存储虚拟化层、存储设备和计算设备,其中,虚拟机基于计算设备和存储设备生成,虚拟机包括虚拟文件系统,存储虚拟化层包括集群文件系统,用于将存储设备的物理磁盘空间分配到每个虚拟机的每个用于文件,图3所示的系统中以包含两个虚拟机为例,分别为虚拟机1和虚拟机2,每个虚拟机中包含两个用户文件,假设虚拟机1中的两个用户文件分别为用户文件A和用户文件B,虚拟机2中的两个用户文件分别为用户文件C和用户文件D,当用户删除用户文件A时,处理流程如图4所示,图4为本发明虚拟机处理方法实施例一的流程示意图:
S401:虚拟文件系统接收用户发送的对虚拟机的用户文件A进行删除操作的文件命令;
其中,文件命令中携带虚拟机的用户文件A在虚拟文件系统中的文件路径。
S402:虚拟文件系统将删除用户文件A的文件命令直接转发到存储虚拟化层。
S403:存储虚拟化层的集群文件系统根据虚拟机的用户文件A在虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件A进行删除操作的文件命令转换成为对存储设备的物理磁盘进行操作的IO命令。
具体地,对物理磁盘进行操作的IO命令为修改物理磁盘的元数据区域的IO命令。
通过上述S401~S403的步骤,实现对用户操作的响应。
可以看出,在上述过程中,基于存储系统的配置,当用户删除用户文件A时,存储虚拟化层的集群文件系统或分布式文件系统能够实时回收用户文件A所占用的物理磁盘的数据区域,从而,提高虚拟机的存储空间的利用率。上面仅是以删除用户文件为例进行说明,移动用户文件的操作类似,此处不再赘述。
由于虚拟文件系统直接将用户对用户文件进行操作的文件命令转发给存储虚拟化层,存储虚拟化层管理用户文件与物理磁盘空间的对应关系,因此,在虚拟机中的文件视图和存储虚拟化层视图能够一一对应;在虚拟机里对某一文件的操作,在底层的存储虚拟化层可以确切的感知到,因此,存储虚拟化层可以以用户文件为单位,对用户文件进行处理,例如以用户文件为单位进行快照、加解密、请求重定向、请求分拆和杀毒等处理,便于对文件的管理。
除此之外,在上述实施例中,由于IO处理比现有技术少了两层,能够降低CPU消耗,提升文件IO性能。
本发明的虚拟机计算系统结构使得在虚拟机中的文件视图和存储虚拟化层的文件视图保持一致,能够让存储虚拟化层以文件为单位进行相较于现有技术更为精细的存储管理,提升存储虚拟化的灵活性,降低存储操作对于计算资源的占用。
图4所示实施例仅以接收删除用户文件的文件命令为例进行了描述,文件命令还包括:创建用户文件的文件命令、修改用户文件的文件命令、查询用户文件的文件命令、读用户文件的文件命令、写用户文件的文件命令和锁用户文件的文件命令等。无论是哪种文件命令,在本发明中处理方式类似,下面统称为对用户文件进行操作的文件命令,对本发明的虚拟机的处理流程进行描述,图5为本发明虚拟机处理方法实施例二的流程示意图,本实施例所应用的虚拟计算机系统的结构与图3类似,此处不再赘述,本实施例的方法如图5所示:
S501:虚拟机的虚拟文件系统接收对虚拟机的用户文件进行操作的文件命令。
其中,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径。
S502:虚拟文件系统将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层。
S503:存储虚拟化层的集群文件系统根据虚拟机的用户文件在虚拟文件系统中的路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。
通过上述S501~S503的步骤,实现对用户操作的响应。
本实施例的方法,由于虚拟文件系统直接将用户对用户文件进行操作的文件命令转发给存储虚拟化层,存储虚拟化层管理用户文件与物理磁盘空间的对应关系,因此,在虚拟机中的文件视图和存储虚拟化层视图能够一一对应,存
储虚拟化层可以以用户文件为单位,对用户文件进行处理,例如以用户文件为单位进行快照、加解密、请求重定向、请求分拆和杀毒等处理,便于对文件的管理。并且由于IO处理比现有技术少了两层,能够降低CPU消耗,提升文件IO性能。
在上述实施例中,还包括创建虚拟机的用户文件的过程,具体流程如下如图6所示,图6为本发明虚拟机处理方法实施例三的流程示意图:
S601:虚拟文件系统接收创建虚拟机的用户文件的请求。
S602:虚拟文件系统转发创建虚拟机的用户文件的请求到存储虚拟化层。
S603:存储虚拟化层的集群文件系统为虚拟机的用户文件分配对应的物理磁盘空间。
S604:存储虚拟化层在集群文件系统中建立虚拟机的用户文件与物理磁盘空间的第一对应关系,并记录第一对应关系。
通过上述步骤S601~S604,可以实现创建虚拟机的用户文件,并在后续对虚拟机的用户文件进行删除、读、写等操作时,可使用上述第一对应关系。
在上述实施例中,存储虚拟化层在建立虚拟机的用户文件与物理磁盘空间的第一对应关系时,还进行了用户文件隔离处理,用户文件隔离处理用于将虚拟机的用户文件指向唯一的物理磁盘空间,确保不同的虚拟机之间的文件隔离,防止虚拟机访问到权限之外的文件。
具体地,存储虚拟机化层进行用户文件隔离处理的实现方式如图7所示,图7为本发明虚拟机处理方法实施例四的流程示意图,图8为本发明文件隔离的一种实施例的结构示意图:参照图7和图8,本实施例的流程如下:
S701:存储虚拟化层在集群文件系统上创建虚拟机对应的文件夹,并记录虚拟机与虚拟机的文件夹的第二对应关系。
根据第二对应关系,创建虚拟机的用户文件时,全部创建在虚拟机对应的虚拟机的文件夹中。
S702:在虚拟机的文件夹中创建虚拟机的用户文件。
其中,虚拟机的用户文件在集群文件系统中的文件路径包含虚拟机对应的文件夹的路径和虚拟机的用户文件在虚拟文件系统中的文件路径。
例如:虚拟机对应的文件夹的路径为/datastore_1/VM1/(此路径根据产品需要可以改动),虚拟机的用户文件在虚拟文件系统中的文件路径为:c:\windows\test.txt,则虚拟机的用户文件在集群文件系统中的文件路径为:
/datastore_1/VM1/windows/test.txt。
S703:存储虚拟化层在集群文件系统中记录虚拟机的用户文件在集群文件系统中的文件路径与分配的物理磁盘空间的第一对应关系。
本发明还提供一种存储虚拟机化层进行用户文件隔离处理方式,通过自定义元数据文件进行文件隔离处理,结合图9,图9为本发明文件隔离的另一种实施例的结构示意图;由元数据文件记录虚拟机文件与物理磁盘的对应关系、权限、差分数据等,利用元数据可以做到虚拟机共享访问文件;虚拟机运行过程中,根据文件操作,首先创建元数据文件,元数据文件的路径与第一种实现方式的路径保持一致;元数据文件中记录与之对应的虚拟机文件的路径信息。例如:虚拟机中的文件路径为:c:\windows\test.txt;数据文件在集群文件系统上的路径为:/datastore_1/shared/windows/test.txt;元数据文件的路径为:/datastore_1/VM1/windows/test.meta,则元数据文件的路径信息为:/datastore_1/shared/windows/test.txt。
通过上述两种方式可以实现文件隔离,防止虚拟机访问到权限之外的文件。
在上述实施例的基础上,图5所示实施例的S503的具体实现如下:集群文件系统根据虚拟机与所述虚拟机的文件夹的第二对应关系,确定虚拟机的文件夹;根据虚拟机的文件夹的路径和虚拟机的用户文件在虚拟文件系统中的文件路径,生成虚拟机的用户文件在集群文件系统中的文件路径;根据虚拟机的用户文件在集群文件系统中的文件路径,以及虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。
本发明还提供一种虚拟计算机系统实施例,参见图3,上述系统包括虚拟机、存储虚拟化层、存储设备(LUN)和计算设备(未示出),上述虚拟机基于上述计算设备和上述存储设备生成,上述虚拟机包括虚拟文件系统,上述存储虚拟化层包括集群文件系统,用于将上述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,上述虚拟机的虚拟文件系统,用于接收对上述虚拟机的用户文件进行操作的文件命令,上述文件命令携带上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,将上述对上述虚拟机的用户文件进行操作的文件命令转发到上述存储虚拟化层;上述存储虚拟化层,用于根据上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,以及每个虚拟机的用户
文件与物理磁盘空间的第一对应关系,将对上述虚拟机的用户文件进行操作的文件命令转换成对上述存储设备的物理磁盘进行操作的IO命令。
在上述实施例中,上述虚拟机的虚拟文件系统还用于接收创建上述虚拟机的用户文件的请求,转发上述创建虚拟机的用户文件的请求到上述存储虚拟化层;上述存储虚拟化层还用于为上述虚拟机的用户文件分配对应的物理磁盘空间;在上述集群文件系统中建立上述虚拟机的用户文件与上述物理磁盘空间的第一对应关系,并记录上述第一对应关系。
在上述实施例中,上述存储虚拟化层还用于在建立上述虚拟机的用户文件与上述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,上述用户文件隔离处理用于将上述虚拟机的用户文件指向唯一的物理磁盘空间。
在上述实施例中,上述存储虚拟化层具体用于在上述集群文件系统上创建上述虚拟机对应的文件夹,并记录上述虚拟机与上述虚拟机的文件夹的第二对应关系;在上述虚拟机的文件夹中创建上述虚拟机的用户文件,其中,上述虚拟机的用户文件在上述集群文件系统中的文件路径包含上述虚拟机对应的文件夹的路径和上述虚拟机的用户文件在上述虚拟文件系统中的文件路径;在上述集群文件系统中记录上述虚拟机的用户文件在上述集群文件系统中的文件路径与分配的上述物理磁盘空间的第一对应关系。
在上述实施例中,上述存储虚拟化层具体用于根据上述虚拟机与上述虚拟机的文件夹的第二对应关系,确定上述虚拟机的文件夹;根据上述虚拟机的文件夹的路径和上述虚拟机的用户文件在上述虚拟文件系统中的文件路径,生成上述虚拟机的用户文件在上述集群文件系统中的文件路径;根据上述虚拟机的用户文件在上述集群文件系统中的文件路径,以及上述虚拟机的用户文件在上述集群文件系统中的文件路径与分配的上述物理磁盘空间的第一对应关系,将对上述虚拟机的用户文件进行操作的文件命令转换成对上述存储设备的物理磁盘进行操作的IO命令。
上述系统实施例对应地可用于执行方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图10为本发明虚拟计算机系统又一实施例的结构示意图,如图10所示,本实施例的系统包括存储器1010和处理器1020,存储器1010可以包括随机存储器、闪存、只读存储器、可编程只读存储器、非易失性存储器或寄存器等。处理器1020可以是中央处理器(Central Processing Unit,CPU)。存储器1010
用于存储可执行指令。处理器1020可以执行存储器1010中存储的可执行指令,例如,处理器1020用于接收对虚拟机的用户文件进行操作的文件命令,文件命令携带虚拟机的用户文件在虚拟文件系统中的文件路径;将对虚拟机的用户文件进行操作的文件命令转发到存储虚拟化层;根据虚拟机的用户文件在虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对虚拟机的用户文件进行操作的文件命令转换成对存储设备的物理磁盘进行操作的IO命令。
上述系统实施例对应地可用于执行方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。
Claims (10)
- 一种虚拟机处理方法,其特征在于,应用于虚拟计算机系统内,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,所述方法包括:接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;所述虚拟文件系统将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:所述虚拟文件系统接收创建所述虚拟机的用户文件的请求;所述虚拟文件系统转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;所述存储虚拟化层的集群文件系统为所述虚拟机的用户文件分配对应的物理磁盘空间;所述存储虚拟化层在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。
- 根据权利要求2所述的方法,其特征在于,还包括:所述存储虚拟化层在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,还进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。
- 根据权利要求3所述的方法,其特征在于,所述存储虚拟化层进行用户文件隔离处理,包括:所述存储虚拟化层在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机 的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;所述存储虚拟化层在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。
- 根据权利要求4所述的方法,其特征在于,所述存储虚拟化层的集群文件系统根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令,包括:所述集群文件系统根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
- 一种虚拟计算机系统,其特征在于,所述系统包括虚拟机、存储虚拟化层、存储设备和计算设备,所述虚拟机基于所述计算设备和所述存储设备生成,所述虚拟机包括虚拟文件系统,所述存储虚拟化层包括集群文件系统,用于将所述存储设备的物理磁盘空间分配到每个虚拟机的每个用户文件,其中,所述虚拟机的虚拟文件系统,用于接收对所述虚拟机的用户文件进行操作的文件命令,所述文件命令携带所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,将所述对所述虚拟机的用户文件进行操作的文件命令转发到所述存储虚拟化层;所述存储虚拟化层,用于根据所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,以及每个虚拟机的用户文件与物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
- 根据权利要求6所述的系统,其特征在于,所述虚拟机的虚拟文件系统 还用于接收创建所述虚拟机的用户文件的请求,转发所述创建虚拟机的用户文件的请求到所述存储虚拟化层;所述存储虚拟化层还用于为所述虚拟机的用户文件分配对应的物理磁盘空间;在所述集群文件系统中建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系,并记录所述第一对应关系。
- 根据权利要求7所述的系统,其特征在于,所述存储虚拟化层还用于在建立所述虚拟机的用户文件与所述物理磁盘空间的第一对应关系时,进行用户文件隔离处理,所述用户文件隔离处理用于将所述虚拟机的用户文件指向唯一的物理磁盘空间。
- 根据权利要求8所述的系统,其特征在于,所述存储虚拟化层具体用于在所述集群文件系统上创建所述虚拟机对应的文件夹,并记录所述虚拟机与所述虚拟机的文件夹的第二对应关系;在所述虚拟机的文件夹中创建所述虚拟机的用户文件,其中,所述虚拟机的用户文件在所述集群文件系统中的文件路径包含所述虚拟机对应的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径;在所述集群文件系统中记录所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系。
- 根据权利要求9所述的系统,其特征在于,所述存储虚拟化层具体用于根据所述虚拟机与所述虚拟机的文件夹的第二对应关系,确定所述虚拟机的文件夹;根据所述虚拟机的文件夹的路径和所述虚拟机的用户文件在所述虚拟文件系统中的文件路径,生成所述虚拟机的用户文件在所述集群文件系统中的文件路径;根据所述虚拟机的用户文件在所述集群文件系统中的文件路径,以及所述虚拟机的用户文件在所述集群文件系统中的文件路径与分配的所述物理磁盘空间的第一对应关系,将对所述虚拟机的用户文件进行操作的文件命令转换成对所述存储设备的物理磁盘进行操作的IO命令。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410663419.5 | 2014-11-19 | ||
| CN201410663419.5A CN104461685B (zh) | 2014-11-19 | 2014-11-19 | 虚拟机处理方法和虚拟计算机系统 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016078420A1 true WO2016078420A1 (zh) | 2016-05-26 |
Family
ID=52907789
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/083227 WO2016078420A1 (zh) | 2014-11-19 | 2015-07-02 | 虚拟机处理方法和虚拟计算机系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN104461685B (zh) |
| WO (1) | WO2016078420A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108924202A (zh) * | 2018-06-25 | 2018-11-30 | 郑州云海信息技术有限公司 | 一种分布式集群的数据容灾方法以及相关装置 |
| US10817649B2 (en) | 2018-01-09 | 2020-10-27 | Saudi Arabian Oil Comapny | Unicode conversion with minimal downtime |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104461685B (zh) * | 2014-11-19 | 2017-09-29 | 华为技术有限公司 | 虚拟机处理方法和虚拟计算机系统 |
| CN105260323B (zh) * | 2015-10-21 | 2019-02-05 | 华为技术有限公司 | 一种存储虚拟化数据处理方法以及装置 |
| RU2712130C1 (ru) * | 2016-04-27 | 2020-01-24 | Хуавей Текнолоджиз Ко., Лтд. | Способ и устройство обработки файла на основе обновления с патчем, конечное устройство и носитель информации |
| CN105912714A (zh) * | 2016-04-29 | 2016-08-31 | 乐视控股(北京)有限公司 | 一种移动设备文件管理方法及系统 |
| CN109343928B (zh) * | 2018-08-28 | 2022-02-08 | 广东微云科技股份有限公司 | 虚拟化集群中虚拟机的虚拟内存文件重定向方法及其系统 |
| CN111045859B (zh) * | 2018-10-12 | 2023-11-03 | 伊姆西Ip控股有限责任公司 | 用于备份虚拟机的方法、设备和计算机程序产品 |
| CN110196754A (zh) * | 2019-04-24 | 2019-09-03 | 苏州浪潮智能科技有限公司 | 一种GPU设备在Linux KVM下的直通方法及装置 |
| CN110535829B (zh) * | 2019-07-24 | 2022-06-07 | 视联动力信息技术股份有限公司 | 一种数据交互方法及一种视联网系统 |
| US10769167B1 (en) * | 2019-12-20 | 2020-09-08 | Lifebit Biotech Limited | Federated computational analysis over distributed data |
| CN116705171B (zh) * | 2023-05-24 | 2024-04-05 | 西北大学 | 一种批量生物数据处理方法、装置及介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101105737A (zh) * | 2006-07-11 | 2008-01-16 | 任永坚 | 存储介质处理方法、系统及数据读写操作方法、系统 |
| CN102375695A (zh) * | 2010-08-23 | 2012-03-14 | 联想(北京)有限公司 | 一种磁盘的访问方法及计算机系统 |
| US20120167080A1 (en) * | 2010-12-22 | 2012-06-28 | Vmware, Inc. | Guest file system introspection and defragmentable virtual disk format for space efficiency |
| CN102968331A (zh) * | 2012-11-27 | 2013-03-13 | 中标软件有限公司 | 一种虚拟机管理系统及其文件访问方法 |
| 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 (zh) * | 2014-11-19 | 2015-03-25 | 华为技术有限公司 | 虚拟机处理方法和虚拟计算机系统 |
Family Cites Families (4)
| 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 (zh) * | 2008-11-19 | 2010-07-14 | 北京航空航天大学 | 虚拟机的分布式虚拟磁盘系统 |
| CN103020199A (zh) * | 2012-12-05 | 2013-04-03 | 上海创图网络科技发展有限公司 | 适用于不同操作系统平台的虚拟文件系统及其应用 |
| CN103593147B (zh) * | 2013-11-07 | 2016-08-17 | 华为技术有限公司 | 一种数据读取的方法及装置 |
-
2014
- 2014-11-19 CN CN201410663419.5A patent/CN104461685B/zh active Active
-
2015
- 2015-07-02 WO PCT/CN2015/083227 patent/WO2016078420A1/zh active Application Filing
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101105737A (zh) * | 2006-07-11 | 2008-01-16 | 任永坚 | 存储介质处理方法、系统及数据读写操作方法、系统 |
| CN102375695A (zh) * | 2010-08-23 | 2012-03-14 | 联想(北京)有限公司 | 一种磁盘的访问方法及计算机系统 |
| 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 (zh) * | 2012-11-27 | 2013-03-13 | 中标软件有限公司 | 一种虚拟机管理系统及其文件访问方法 |
| CN104461685A (zh) * | 2014-11-19 | 2015-03-25 | 华为技术有限公司 | 虚拟机处理方法和虚拟计算机系统 |
Cited By (2)
| 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 (zh) * | 2018-06-25 | 2018-11-30 | 郑州云海信息技术有限公司 | 一种分布式集群的数据容灾方法以及相关装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104461685B (zh) | 2017-09-29 |
| CN104461685A (zh) | 2015-03-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016078420A1 (zh) | 虚拟机处理方法和虚拟计算机系统 | |
| US11347408B2 (en) | Shared network-available storage that permits concurrent data access | |
| US10359968B1 (en) | Smart data movement among virtual storage domains | |
| US10374792B1 (en) | Layout-independent cryptographic stamp of a distributed dataset | |
| US8966188B1 (en) | RAM utilization in a virtual environment | |
| US10210051B2 (en) | Cross-application database restore | |
| US9729659B2 (en) | Caching content addressable data chunks for storage virtualization | |
| 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 | |
| US10587686B2 (en) | Sustaining backup service level objectives using dynamic resource allocation | |
| US9430492B1 (en) | Efficient scavenging of data and metadata file system blocks | |
| WO2019000949A1 (zh) | 分布式存储系统中元数据存储方法、系统及存储介质 | |
| US10678431B1 (en) | System and method for intelligent data movements between non-deduplicated and deduplicated tiers in a primary storage array | |
| US10705733B1 (en) | System and method of improving deduplicated storage tier management for primary storage arrays by including workload aggregation statistics | |
| US10346077B2 (en) | Region-integrated data deduplication | |
| WO2017054636A1 (zh) | 虚拟快照处理方法及装置 | |
| JP2017531892A (ja) | ブロックレベル記憶デバイスのスナップショットを実行するための改善された装置および方法 | |
| 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 | |
| JPWO2014147794A1 (ja) | ストレージ装置およびデータ管理方法 | |
| WO2021052230A1 (zh) | 一种存储系统、存储节点和数据存储方法 | |
| CN107851062A (zh) | 一种主机集群中缓存管理方法及主机 | |
| US11782619B1 (en) | In-place conversion of virtual disk formats with VM powered on |
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 |