Nothing Special   »   [go: up one dir, main page]

CN103491193B - A kind of method and apparatus of file-sharing - Google Patents

A kind of method and apparatus of file-sharing Download PDF

Info

Publication number
CN103491193B
CN103491193B CN201310464197.XA CN201310464197A CN103491193B CN 103491193 B CN103491193 B CN 103491193B CN 201310464197 A CN201310464197 A CN 201310464197A CN 103491193 B CN103491193 B CN 103491193B
Authority
CN
China
Prior art keywords
storage
virtual machine
file
shared
storage region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310464197.XA
Other languages
Chinese (zh)
Other versions
CN103491193A (en
Inventor
葛小宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310464197.XA priority Critical patent/CN103491193B/en
Publication of CN103491193A publication Critical patent/CN103491193A/en
Application granted granted Critical
Publication of CN103491193B publication Critical patent/CN103491193B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the present invention provides a kind of method and apparatus of file-sharing.It is related to file-sharing field, the computing resource of shared file occupancy can be reduced, and improve the access speed to shared file.This method includes:File sharing devices are after determining to provide the shared file in the first virtual machine of shared service, obtain the storage region information in the shared file, and the storage region information is sent to storage resource management device, so that the storage resource management device determines target storage domain according to the storage region information, the second virtual machine for receiving the shared file is distributed in the target storage domain by the storage resource management device, so that second virtual machine accesses to the shared file.The embodiment of the present invention is used to share file.

Description

A kind of method and apparatus of file-sharing
Technical field
The present invention relates to file-sharing field more particularly to a kind of methods and apparatus of file-sharing.
Background technology
It virtualizes under scene, existing file-sharing schemes include:The first virtual machine of shared service is provided from corresponding Selection needs file to be sharing in disk, and Share Permissions of the shared file and allowing is set to access the of the shared file Two virtual machines, then the shared file is accessed from corresponding disk by first virtual machine, second virtual machine is by virtually handing over It changes planes and accesses the shared file from first virtual machine.
During stating file-sharing in realization, shared since first virtual machine needs to access from corresponding disk File so as to occupy the larger computing resource of first virtual machine in file sharing process, affects first virtual machine Normal use, in addition, when the shared file is excessive, due to the limitation of network bandwidth so that second virtual machine is common to this It is slower to enjoy the access speed of file, so as to reduce user experience.
The content of the invention
The embodiment of the present invention provides a kind of method and apparatus of file-sharing, is provided with the calculating for reducing shared file occupancy Source, and improve the access speed to shared file.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that:
In a first aspect, a kind of method of file-sharing is provided, including:
File sharing devices determine to provide the shared file in the first virtual machine of shared service;
Obtain the storage region information of the shared file;
The storage region information is sent to storage resource management device, so that the storage resource management device is according to Storage region information determines target storage domain, and the target storage domain is distributed to the second virtual machine, wherein, the mesh Mark storage region is stored with the shared file, and second virtual machine is the virtual machine for receiving the shared file.
In first aspect in the first possible realization method, the storage region packet for obtaining the shared file It includes:
Obtain the directory entry of the shared file and the corresponding index node information of the directory entry;
The storage region information is determined according to the directory entry and the corresponding index node information of the directory entry.
With reference to first aspect or the first possible realization method, in second of possible realization method, deposited described After storage explorer determines target storage domain according to the storage region information, the method further includes:
The identification information of second virtual machine is obtained, wherein, the identification information, which is used to indicate, cancels second void Plan machine accesses the shared file;
The identification information is sent to storage resource management device, so that the storage resource management device is believed according to the mark Breath deletes the target storage domain of second virtual machine.
Second aspect provides a kind of method of file-sharing, including:
Storage resource management device receives the storage region information for the shared file that file sharing devices are sent, the shared text Part is provided by the first virtual machine;
Target storage domain is determined according to the storage region information, and the second void is distributed into the target storage domain Plan machine, so that second virtual machine accesses to the shared file;Wherein, the target storage domain stores State shared file.
In second aspect in the first possible realization method, the target storage domain is logical unit number LUN;Its In, the LUN stores the shared file.
It is described that mesh is determined according to the storage region information in second of possible realization method with reference to second aspect Mark storage region includes:
LUN is determined according to the storage region information, and the target storage domain is determined according to the LUN, wherein, institute It states LUN and stores the shared file and unshared file;The target storage domain stores the shared file.
It, can at the third with reference to any one of second aspect to second possible realization method possible realization method In the realization method of energy, after distributing to second virtual machine in the target storage domain, the method further includes:
The identification information for second virtual machine that the file sharing devices are sent is received, wherein, the identification information It is used to indicate and cancels the second virtual machine access shared file;
The target storage domain of second virtual machine is deleted according to the identification information.
The third aspect provides a kind of file sharing devices, including:
Processing unit, for determining to provide the shared file in the first virtual machine of shared service;
Acquiring unit, for obtaining the storage region information of the shared file determined in the processing unit;
Transmitting element, the storage region information for the acquiring unit to be got are sent to storage resource management device, So that the storage resource management device determines target storage domain according to the storage region information, and by the target storage The second virtual machine is distributed in domain, wherein, the target storage domain is stored with the shared file, and second virtual machine is to connect Receive the virtual machine of the shared file.
In the third aspect in the first possible realization method, the acquiring unit is specifically used for:
The directory entry of the shared file and the corresponding index node information of the directory entry are obtained, and according to the catalogue Item index node information corresponding with the directory entry determines the storage region information.
With reference to the third aspect or the first possible realization method, in second of possible realization method, the transmission Unit is specifically used for:
The acquiring unit is additionally operable to, and obtains the identification information of second virtual machine, wherein, the identification information is used for Instruction cancels second virtual machine and accesses the shared file;
The transmitting element is additionally operable to, and the identification information is sent to storage resource management device, so as to the storage money Source manager deletes the target storage domain of second virtual machine according to the identification information.
Fourth aspect provides a kind of storage resource management device, including:
Receiving unit, for receiving the storage region information of the shared file of file sharing devices transmission, the shared text Part is provided by the first virtual machine;
Processing unit, the storage region information for being received according to the receiving unit determine target storage domain, and The second virtual machine is distributed into the target storage domain, so that second virtual machine visits the shared file It asks;Wherein, the target storage domain is stored with the shared file.
In fourth aspect in the first possible realization method, the processing unit is specifically used for:
LUN is determined according to the storage region information;Wherein, the LUN stores the shared file.
With reference to fourth aspect, in second of possible realization method, the processing unit is specifically used for:
LUN is determined according to the storage region information, and the target storage domain is determined according to the LUN, wherein, institute It states LUN and stores the shared file and unshared file;The target storage domain stores the shared file.
With reference in any one of fourth aspect to second possible realization method possible realization method, at the third In possible realization method,
The receiving unit is additionally operable to, and receives the mark letter for second virtual machine that the file sharing devices are sent Breath, wherein, the identification information, which is used to indicate, cancels the second virtual machine access shared file;
The processing unit is additionally operable to, and the target storage of second virtual machine is deleted according to the identification information Domain.
By using said program, file sharing devices by got in the storage region of first virtual machine this share The storage region information of file is sent to storage resource management device, which determines according to the storage region information Target storage domain, and the target storage domain is distributed to second virtual machine, so that second virtual machine accesses the mesh The shared file in storage region is marked, in this way, since the target storage domain is to distribute to this by the storage resource management device Second virtual machine, so the target storage domain is equivalent to the storage region of second virtual machine, which can The shared file in the target storage domain is directly accessed, without accessing the shared file from the first virtual machine, so as to Reduce the occupancy to the first virtual machine computing resource, and improve access speed of second virtual machine to shared file.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for this For the those of ordinary skill of field, without creative efforts, others are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is a kind of flow diagram of file sharing method provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of another file sharing method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another file sharing method provided in an embodiment of the present invention;
Fig. 4 is a kind of structure diagram of file sharing devices provided in an embodiment of the present invention;
Fig. 5 is a kind of structure diagram of storage resource management device provided in an embodiment of the present invention;
Fig. 6 is the structure diagram of another file sharing devices provided in an embodiment of the present invention;
Fig. 7 is the structure diagram of another storage resource management device provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is clearly retouched It states, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Based on the present invention In embodiment, the every other implementation that those of ordinary skill in the art are obtained without making creative work Example, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of method of file-sharing, is total to as shown in Figure 1, the executive agent of this method is file Equipment is enjoyed, including:
S101, file sharing devices determine to provide the shared file in the first virtual machine of shared service.
Specifically, user needs text to be sharing by the way that file sharing devices are definite in the storage region of first virtual machine After part, then equipment is shared by this document and the access rights of the shared file are set and allow receive the shared file second Virtual machine, second virtual machine can access to the shared file according to access rights.When shared file is usually set, meeting In units of file, i.e., the file in this document folder is shared file, and shared file in the embodiment of the present invention is also comprising setting Put the scene of Shared Folders.
S102, this document share the storage region information that equipment obtains the shared file.
Specifically, this document shares equipment and obtains the directory entry of the shared file and the corresponding index node of the directory entry Information, and the storage region information is determined according to directory entry index node information corresponding with the directory entry.
Wherein, which is included in the storage that the shared file is stored in the storage region of first virtual machine The identification information of subregion.
In a kind of possible realization method of the present invention, which realizes text by being shared to file Part is shared, i.e., to share a certain file, then the file where this document is set to Shared Folders, wherein, the shared file Include shared file in folder, shared at least one of sub-folder and shared subfile can also be included, then this document is shared Equipment determines after needing file to be sharing that this document shares the mesh that equipment obtains the Shared Folders in first virtual machine Record item(Such as title of the shared sub-folder and/or the shared subfile), corresponding index node is determined according to the directory entry Information, and determine according to the index node information to store the storage sub-district of the shared file in the storage region of the first virtual machine Domain in the case of shared at least one of sub-folder and shared subfile is included, such as includes shared sub-folder, also wraps Include the storage subregion that the shared sub-folder stored in the storage region of the first virtual machine is determined according to index node information. Wherein, by taking the situation that Shared Folders includes shared file as an example, which is included in depositing for first virtual machine The identification information of the storage subregion of the shared file is stored in storage area domain, in this way, this document, which shares equipment, obtains the shared text The storage region information of part folder(The mark of the storage subregion of the shared file is such as stored in the storage region of the first virtual machine Information).
Illustratively, this document shares equipment and determines Shared Folders in the first virtual machine storage region, wherein, this is common Enjoying includes shared file X in file, the directory entry of the Shared Folders is denoted as directory entry A, the index node of shared file X Information is denoted as index node information b, then this document shares equipment and obtains the catalogue by the file system of first virtual machine Item A, and determine index node information b with directory entry A, so as to which the identification information in index node information b determines The storage subregion of shared file X is stored in the storage region of first virtual machine, in this way, this document shares equipment acquisition The storage region information of the Shared Folders.
It should be noted that the storage region division of the first virtual machine has multiple storage subregions, the plurality of storage sub-district Domain is corresponding with identification information, and the corresponding index node information of above-mentioned directory entry, which is included in the storage region of the first virtual machine, to be stored The corresponding identification information of storage subregion of the corresponding shared file of the directory entry, then this document share equipment according to the mark believe Breath determines to store the storage subregion of the shared file in the storage region of the first virtual machine.
In the alternatively possible realization method of the present invention, which shares file, then first void Plan machine can be shared, specific implementation side by being shared to the file where this document so as to fulfill to this document Formula may be referred to first virtual machine in a kind of realization method and shared corresponding description carried out to file, and details are not described herein again .
If it should be noted that when further including unshared file in file where this document, this document, which is shared, to be set It is standby that the unshared file is arranged to hidden state, and the access rights of the unshared file are limited, in this way, the unshared file It is sightless to user, so as to prevent sharing unshared file, improves user experience.
In addition, first virtual machine can also directly share file, then this document shares equipment in first void It is determined in the storage region of plan machine after needing to carry out shared file, this document shares the index section that equipment obtains the shared file Point information, and determine that the shared file stores this in the storage region of first virtual machine and shares according to the index node information The storage subregion of file, in this way, this document shares the storage region information that equipment gets the shared file.
S103, this document share equipment and the storage region information are sent to storage resource management device, so that the storage provides Source manager determines target storage domain according to the storage region information, and the target storage domain is distributed to second virtually Machine.
Wherein, which is stored with the shared file.
It should be noted that this document shares equipment can also send idle memory region letter to storage resource management device Breath, wherein, which includes not having the storage sub-district for storing data in the storage region of first virtual machine The identification information in domain, that is to say, that above-mentioned storage region information can also include the free storage domain information, the storage resource Manager then determines target storage domain according to the storage region information, and it is second virtual that the target storage domain is distributed to this Machine, if in this way, the permission that file sharing devices are set allows second virtual machine to write shared file progress write operation The data of the shared file can be stored in the corresponding idle memory region of free storage domain information, to improve user's body It tests.
Specifically, above-mentioned steps S103 can include following two realization methods:
Mode one, this document shares equipment and the storage region information is sent to storage resource management device, so as to the storage Explorer determines to store the LUN of the shared file according to the storage region information(Logic Unite Number, logic list Member number), and the LUN is distributed to second virtual machine, so that second virtual machine carries out the shared file in the LUN It accesses.
Wherein, which is stored with the shared file.
When the LUN also stores unshared file, it is necessary to which explanation, this document share equipment and set the unshared file Hidden state is set to, and limits the access rights of the unshared file(The second virtual machine is such as forbidden to carry out the unshared file Read operation and write operation), in this way, the unshared file is sightless to user, meanwhile, it is non-that the second virtual machine can not access this Shared file so as to prevent sharing unshared file, improves user experience.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes depositing The storage region A of shared file and idle memory region B is stored up, it, should if the LUN includes the storage region C of unshared file The unshared file is arranged to hidden state by file sharing devices, and limits the access limit of the unshared file, so that Second virtual machine can not access the unshared file in the storage region C for storing unshared file, the storage resource management device The LUN is distributed to second virtual machine, so that second virtual machine visits the shared file stored in the LUN It asks.
It should be noted that because the LUN is to distribute to the second virtual machine by the storage resource management device, the LUN The storage region of second virtual machine is equivalent to, in this way, after first virtual machine shutdown, which still can be right The shared file stored in the LUN accesses, so as to improve user experience.
Mode two, this document shares equipment and the storage region information is sent to storage resource management device, so as to the storage Explorer determines to store the LUN of the shared file according to the storage region information, and determines target storage according to the LUN Domain, and second virtual machine is distributed into the target storage domain, so that second virtual machine visits the shared file It asks.
Wherein, which stores the shared file and unshared file;The target storage domain stores the shared file.
Specifically, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, it is common which stores this File and unshared file are enjoyed, and the storage resource management device determines that storage should according to the storage region information in the LUN The storage region of shared file, which is encapsulated as target storage domain by storage region, and the target is deposited Storage area domain is distributed to the second virtual machine, for example, the storage region can store the disk storage region of the shared file, the mesh It can be virtual volume to mark storage region, then the storage resource management device will store the disk storage area of the shared file in the LUN Domain is encapsulated as virtual volume, and the virtual volume is distributed to the second virtual machine, in this way, the second virtual machine is after the power-up, can identify The virtual volume, and can access to the shared file stored in the virtual volume.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes storage The storage region B and idle memory region C of the storage region A of the shared file, the unshared file of storage, the then storage resource Storage region A and idle memory region C are encapsulated as target storage domain by manager according to the storage region information, the target Storage region includes storage region A and idle memory region C, and the target storage domain is distributed second virtual to this Machine, so that second virtual machine accesses to the shared file stored in the target storage domain, because the target is deposited Storage area domain is to distribute to the second virtual machine by the storage resource management device, so to be equivalent to this second virtual in the target storage domain The storage region of machine, in this way, after first virtual machine shutdown, which still can be in the target storage domain The shared file of storage accesses, so as to improve user experience.
Can be institute in the LUN it should be noted that in the idle memory region C that above-mentioned target storage domain includes Part idle memory region in some idle memory regions or LUN, the present invention do not limit this.
In addition, aforesaid way one and mode two difference lies in:Mode one, being directly will be in the memory block of the first virtual machine In domain determine LUN distribute to the second virtual machine, due to the LUN include storage shared file storage region and including store it is non- The storage region of shared file therefore, it is also desirable to which unshared file is arranged to hidden state, and limits the unshared file Access rights;And mode two, it is by the memory block of the LUN determined in the storage region of the first virtual machine the shared files included Domain is encapsulated as a new storage region, and the new storage region is distributed to the second virtual machine, and the embodiment of the present invention is to upper Two kinds of realization methods are stated to be not construed as limiting.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file The LUN is distributed to the second virtual machine by LUN, wherein, the access right that the second virtual machine accesses the shared file is included in the LUN Limit or Share Permissions.I.e. target storage domain is above-mentioned LUN.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file Either the virtual disk or volume are distributed to the second virtual machine to virtual disk by a volume.Target storage domain is above-mentioned virtual Disk or volume.
Further, when user cancels to the file-sharing of the second virtual machine, this document share equipment obtain this second The identification information of virtual machine, and the identification information is sent to storage resource management device, so as to the storage resource management device according to The identification information deletes the target storage domain of second virtual machine.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
Specifically, when user determines to need to cancel the file-sharing to second virtual machine, this document is shared equipment and is obtained Take the identification information of second virtual machine(Such as the title or IP address of the second virtual machine), and the identification information is sent to and is deposited Explorer is stored up, which deletes the target storage domain of second virtual machine according to the identification information, from And cancel the file-sharing of first virtual machine to second virtual machine.
By using the scheme that above-mentioned executive agent is file sharing devices, this document shares equipment will be in the first virtual machine Storage region in the storage region information of the shared file that gets be sent to storage resource management device, the storage resource pipe Reason device determines target storage domain according to the storage region information, and the target storage domain is distributed to second virtual machine, So that second virtual machine accesses to the shared file, in this way, since the target storage domain is by the storage resource Manager distributes to second virtual machine, so the target storage domain is equivalent to the storage region of second virtual machine, this Two virtual machines can directly access the shared file in the target storage domain, without being accessed again from first virtual machine The shared file, so as to reduce the occupancy to the first virtual machine computing resource, and it is common to this to improve second virtual machine Enjoy the access speed of file.
The embodiment of the present invention provides a kind of method of file-sharing, as shown in Fig. 2, the executive agent of this method is storage money Source manager, including:
S201, storage resource management device receive the storage region information for the shared file that file sharing devices are sent, this is common Enjoying file is provided by the first virtual machine.
Specifically, user needs text to be sharing by the way that file sharing devices are definite in the storage region of first virtual machine After part, then equipment is shared by this document and the access rights of the shared file are set and allow receive the shared file second Virtual machine, second virtual machine can access to the shared file according to access rights.When shared file is usually set, meeting In units of file, i.e., the file in this document folder is shared file, and shared file in the embodiment of the present invention is also comprising setting Put the scene of Shared Folders.
Further, this document shares the directory entry and the directory entry that equipment obtains the shared file in file system Corresponding index node information, and determine that the storage region is believed according to directory entry index node information corresponding with the directory entry Breath, and the storage region information is sent to storage resource management device.
Wherein, which is included in the storage that the shared file is stored in the storage region of first virtual machine The identification information of subregion.
In a kind of possible realization method of the present invention, which realizes text by being shared to file Part is shared, i.e., to share a certain file, then the file where this document is set to Shared Folders, wherein, the shared file Include shared file in folder, shared at least one of sub-folder and shared subfile can also be included, then this document is shared Equipment determines after needing file to be sharing that this document shares the mesh that equipment obtains the Shared Folders in first virtual machine Record item(Such as title of the shared sub-folder and/or the shared subfile), corresponding index node is determined according to the directory entry Information, and determine according to the index node information to store the storage sub-district of the shared file in the storage region of the first virtual machine Domain in the case of shared at least one of sub-folder and shared subfile is included, such as includes shared sub-folder, also wraps Include the storage subregion that the shared sub-folder stored in the storage region of the first virtual machine is determined according to index node information. Wherein, by taking the situation that Shared Folders includes shared file as an example, which is included in depositing for first virtual machine The identification information of the storage subregion of the shared file is stored in storage area domain, in this way, this document, which shares equipment, obtains the shared text The storage region information of part folder(The mark of the storage subregion of the shared file is such as stored in the storage region of the first virtual machine Information), and the storage region information of the Shared Folders is sent to storage resource management device.
Illustratively, this document shares equipment and determines Shared Folders in the first virtual machine storage region, wherein, this is common Enjoying includes shared file X in file, the directory entry of the Shared Folders is denoted as directory entry A, the index node of shared file X Information is denoted as index node information b, then this document shares equipment the catalogue is obtained from the file system of first virtual machine Item A, and determine index node information b with directory entry A, so as to which the identification information in index node information b determines The storage subregion of shared file X is stored in the storage region of first virtual machine, in this way, this document shares equipment acquisition The storage region information of the Shared Folders, and the storage region information is sent to the storage resource management device.
It should be noted that the storage region division of the first virtual machine has multiple storage subregions, the plurality of storage sub-district Domain is corresponding with identification information, and the corresponding index node information of above-mentioned directory entry, which is included in the storage region of the first virtual machine, to be stored The corresponding identification information of storage subregion of the corresponding shared file of the directory entry, then this document share equipment according to the mark believe Breath determines to store the storage subregion of the shared file in the storage region of the first virtual machine.
In the alternatively possible realization method of the present invention, which shares file, then first void Plan machine can be shared, specific implementation side by being shared to the file where this document so as to fulfill to this document Formula may be referred to first virtual machine in a kind of realization method and shared corresponding description carried out to file, and details are not described herein again .
If it should be noted that when further including unshared file in file where the shared file, this document is common It enjoys equipment and the unshared file is arranged to hidden state, and limit the access rights of the unshared file, in this way, this is unshared File is sightless to user, so as to prevent sharing unshared file, improves user experience.
In addition, first virtual machine can also directly share file, then this document shares equipment in first void It is determined in the storage region of plan machine after needing to carry out shared file, this document shares the index section that equipment obtains the shared file Point information, and determine that the shared file stores this in the storage region of first virtual machine and shares according to the index node information The storage subregion of file, in this way, this document shares the storage region information that equipment obtains the shared file, and this is shared literary The storage region information of part is sent to the storage resource management device.
S202, the storage resource management device determine target storage domain according to the storage region information, and the target is deposited The second virtual machine is distributed in storage area domain, so that second virtual machine accesses to the shared file.
Wherein, which is stored with the shared file.
It should be noted that this document shares equipment can also send idle memory region letter to storage resource management device Breath, wherein, which includes not having the storage sub-district for storing data in the storage region of first virtual machine The identification information in domain, that is to say, that above-mentioned storage region information can also include the free storage domain information, the storage resource Manager then determines target storage domain according to the storage region information, and it is second virtual that the target storage domain is distributed to this Machine, if in this way, the permission that file sharing devices are set allows second virtual machine to write shared file progress write operation The data of the shared file can be stored in the corresponding idle memory region of free storage domain information, to improve user's body It tests.
Specifically, above-mentioned steps S202 can include following two realization methods:
Mode one, the target storage domain are logical unit number LUN.
Wherein, which is stored with the shared file.
Specifically, which determines to store the LUN of the shared file according to the storage region information, and will The LUN is distributed to second virtual machine, so that second virtual machine accesses to the shared file in the LUN.
When the LUN also stores unshared file, it is necessary to which explanation, this document share equipment and set the unshared file Hidden state is set to, and limits the access rights of the unshared file(The second virtual machine is such as forbidden to carry out the unshared file Read operation and write operation), in this way, the unshared file is sightless to user, meanwhile, it is non-that the second virtual machine can not access this Shared file so as to prevent sharing unshared file, improves user experience.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes depositing The storage region A of shared file and idle memory region B is stored up, if the LUN includes the storage region C for storing unshared file, Then this document shares equipment the unshared file is arranged to hidden state, and limits the access rights of the unshared file, with So that the second virtual machine can not access the unshared file, the storage resource in the storage region C for storing the unshared file Manager distributes the LUN to second virtual machine, so that second virtual machine accesses the shared file in the LUN.
It should be noted that because the LUN is to distribute to the second virtual machine by the storage resource management device, the LUN The storage region of second virtual machine is equivalent to, in this way, after first virtual machine shutdown, which still can be right The shared file stored in the LUN accesses, so as to improve user experience.
Mode two, which determines LUN according to the storage region information, and determines the mesh according to the LUN Mark storage region.
Wherein, which stores the shared file and unshared file;The target storage domain stores the shared file.
Specifically, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, it is common which stores this File and unshared file are enjoyed, and the storage resource management device determines that storage should according to the storage region information in the LUN The storage region is encapsulated as target storage domain by the storage region of shared file, the storage resource management device, and by the target Storage region is distributed to the second virtual machine, for example, the storage region can store the disk storage region of the shared file, it should Target storage domain can be virtual volume, then the storage resource management device will store the disk storage of the shared file in the LUN Region is encapsulated as virtual volume, and the virtual volume is distributed to the second virtual machine, in this way, the second virtual machine is after the power-up, Neng Goushi The not virtual volume, and can access to the shared file stored in the virtual volume.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes storage The storage region B and idle memory region C of the storage region A of shared file, the unshared file of storage, then the storage resource pipe Storage region A and idle memory region C are encapsulated as target storage domain by reason device according to the storage region information, which deposits Storage area domain includes storage region A and idle memory region C, and the target storage domain is distributed second virtual to this Machine so that second virtual machine accesses the shared file in the target storage domain because the target storage domain be by The storage resource management device distributes to the second virtual machine, so the target storage domain is equivalent to the memory block of second virtual machine Domain, in this way, after first virtual machine shutdown, second virtual machine still can to stored in the target storage domain this is common It enjoys file to access, so as to improve user experience.
Can be institute in the LUN it should be noted that in the idle memory region C that above-mentioned target storage domain includes Part idle memory region in some idle memory regions or LUN, the present invention do not limit this.
In addition, aforesaid way one and mode two difference lies in:Mode one, being directly will be in the memory block of the first virtual machine In domain determine LUN distribute to the second virtual machine, due to the LUN include storage shared file storage region and including store it is non- The storage region of shared file therefore, it is also desirable to which unshared file is arranged to hidden state, and limits the unshared file Access rights;And mode two, it is by the memory block of the LUN determined in the storage region of the first virtual machine the shared files included Domain is encapsulated as a new storage region, and the new storage region is distributed to the second virtual machine, and the embodiment of the present invention is to upper Two kinds of realization methods are stated to be not construed as limiting.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file The LUN is distributed to the second virtual machine by LUN, wherein, the access right that the second virtual machine accesses the shared file is included in the LUN Limit or Share Permissions.I.e. target storage domain is above-mentioned LUN.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file Either the virtual disk or volume are distributed to the second virtual machine to virtual disk by a volume.Target storage domain is above-mentioned virtual Disk or volume.
Further, when user cancels the file-sharing to the virtual machine for receiving the shared file, the storage resource pipe Reason device receive this document share equipment transmission second virtual machine identification information, and according to the identification information delete this second The target storage domain of virtual machine.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
Specifically, when user determines to need to cancel the file-sharing to second virtual machine, this document is shared equipment and is obtained Take the identification information of second virtual machine(Such as the title or IP address of the second virtual machine), and the identification information is sent to and is deposited Explorer is stored up, which deletes the target storage domain of second virtual machine according to the identification information, from And cancel the file-sharing of first virtual machine to second virtual machine.
By using the scheme that above-mentioned executive agent is storage resource management device, first void is determined in file sharing devices Shared file in plan machine and after obtaining the storage region information of the shared file, which receives this document and is total to The storage region information of equipment transmission is enjoyed, and target storage domain is determined according to the storage region information, the storage resource pipe Second virtual machine is distributed in the target storage domain by reason device, so that second virtual machine is in the target storage domain The shared file accesses, in this way, since the target storage domain is to distribute to second void by the storage resource management device Plan machine, so the target storage domain is equivalent to the storage region of second virtual machine, which can directly visit The shared file in the target storage domain is asked, without accessing the shared file from first virtual machine, so as to subtract Lack the occupancy to the first virtual machine computing resource, and improve access speed of second virtual machine to shared file.
The embodiment of the present invention provides a kind of method of file-sharing, as shown in figure 3, being with to file in this method embodiment Folder carries out what is illustrated exemplified by sharing, and this method includes:
S301, file sharing devices determine to provide the Shared Folders in the first virtual machine of shared service.
Specifically, user needs text to be sharing by the way that file sharing devices are definite in the storage region of first virtual machine After part, then equipment is shared by this document and the access rights of the shared file are set and allow receive the shared file second Virtual machine, second virtual machine can access to the shared file according to access rights.When shared file is usually set, meeting In units of file, i.e., the file in this document folder is shared file, and shared file in the embodiment of the present invention is also comprising setting Put the scene of Shared Folders.
S302, this document share equipment and obtain the directory entry of the Shared Folders and the corresponding index node of the directory entry Information, and the storage region information is determined according to directory entry index node information corresponding with the directory entry.
Wherein, which, which is included in the storage region of first virtual machine, stores depositing for the Shared Folders Store up the identification information of subregion.
In a kind of possible realization method of the present invention, which realizes text by being shared to file Part is shared, then the file where this document is set to Shared Folders, wherein, shared file is included in the Shared Folders, It can also include shared at least one of sub-folder and shared subfile, then this document shares equipment in first virtual machine In determine after needing file to be sharing, this document shares the directory entry that equipment obtains the Shared Folders(Such as shared Ziwen Part presss from both sides and/or the title of the shared subfile), corresponding index node information is determined according to the directory entry, and according to the index Nodal information determines to store the storage subregion of the shared text folder in the storage region of the first virtual machine, for including shared son The situation of at least one of file and shared subfile such as includes shared sub-folder, further includes and believed according to index node Breath determines the storage subregion of the shared sub-folder stored in the storage region of the first virtual machine.Wherein, with shared file Exemplified by folder includes the situation of shared file, which, which is included in the storage region of first virtual machine, stores this and is total to The identification information of the storage subregion of file is enjoyed, in this way, this document shares the storage region letter that equipment obtains the Shared Folders Breath(The identification information of the storage subregion of the shared file is such as stored in the storage region of the first virtual machine), and this is shared The storage region information of file is sent to storage resource management device.
Illustratively, this document shares equipment and determines Shared Folders in first virtual machine, bag in the Shared Folders Shared sub-folder and shared subfile X are included, includes shared subfile Y, the mesh of the Shared Folders in the shared sub-folder Record item is denoted as directory entry A, and the index node information of the shared sub-folder is denoted as index node information a, the shared subfile X's Index node information is denoted as index node information b, and the directory entry of the shared sub-folder is denoted as directory entry B, the shared subfile Y Index node information be denoted as index node information c, wherein, index node information a is included in the memory block of the first virtual machine The identification information of the storage subregion of the shared sub-folder is stored in domain;This document is shared equipment and is determined according to directory entry A The index node information a and index node information b, so as to which the identification information in index node information a is determined the The storage subregion of the shared sub-folder is stored in the storage region of one virtual machine, and the mesh is determined according to the storage subregion Item B is recorded, and index node information c is determined according to directory entry B, it is empty first so as to be determined according to index node information c The storage subregion of the shared sub-folder Y is stored in the storage region of plan machine;This document shares equipment according to the index node Information b determines to store the storage subregion of the shared subfile X in the storage region of the first virtual machine, in this way, this document is total to Enjoy the storage region information that equipment obtains the Shared Folders(Shared sub-folder and shared subfile X and shared subfile The mark letter of storage subregion of the corresponding storage regions of shared subfile Y in the storage region of the first virtual machine in folder Breath).
It should be noted that the storage region division of the first virtual machine has multiple storage subregions, the plurality of storage sub-district Domain is corresponding with identification information, and the corresponding index node information of above-mentioned directory entry, which is included in the storage region of the first virtual machine, to be stored The corresponding shared sub-folder of the directory entry(The shared subfile Y in sub-folder is shared including this)And/or the shared Ziwen The corresponding identification information of storage subregion of part X, then this document share equipment and determined according to the identification information in the first virtual machine Storage region in store the shared sub-folder(The shared subfile in sub-folder is shared including this)And/or the shared son Storage subregion in file.
S303, this document share equipment and the storage region information are sent to storage resource management device.
It should be noted that this document shares equipment can also send idle memory region letter to storage resource management device Breath, wherein, which includes not having the storage sub-district for storing data in the storage region of first virtual machine The identification information in domain, that is to say, that above-mentioned storage region information can also include the free storage domain information, the storage resource Manager then determines target storage domain according to the storage region information, and it is second virtual that the target storage domain is distributed to this Machine, if in this way, the permission that file sharing devices are set allows second virtual machine to write shared file progress write operation The data of the shared file can be stored in the corresponding idle memory region of free storage domain information, to improve user's body It tests.
S304, the storage resource management device determine to store the LUN of the Shared Folders according to the storage region information.
Wherein, which is stored with the Shared Folders.
S305, the storage resource management device determine target storage domain according to the LUN, and the target storage domain is distributed To the second virtual machine of the reception Shared Folders, so that second virtual machine accesses to the Shared Folders.
Wherein, which stores the Shared Folders.
Specifically, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage Shared Folders in the storage region of the first virtual machine, wherein, LUN storages should Shared Folders and unshared file, and the storage resource management device is determined according to the storage region information in the LUN The storage region of the Shared Folders is stored, which is encapsulated as target storage domain by the storage region, and By the target storage, domain is distributed to the second virtual machine, for example, the storage region can store the disk of the Shared Folders Storage region, the target storage domain can be virtual volumes, then the storage resource management device will store the shared file in the LUN The disk storage region of folder is encapsulated as virtual volume, and the virtual volume is distributed to the second virtual machine, in this way, the second virtual machine is upper After electricity, it can identify the virtual volume, and can access to the Shared Folders stored in the virtual volume.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes storage The storage region B and idle memory region C of the storage region A of shared file, the unshared file of storage, then the storage resource pipe Storage region A and idle memory region C are encapsulated as target storage domain by reason device according to the storage region information, which deposits Storage area domain includes storage region A and idle memory region C, and the target storage domain is distributed second virtual to this Machine so that second virtual machine accesses the shared file in the target storage domain because the target storage domain be by The storage resource management device distributes to the second virtual machine, so the target storage domain is equivalent to the memory block of second virtual machine Domain, in this way, after first virtual machine shutdown, second virtual machine still can to stored in the target storage domain this is common It enjoys file to access, so as to improve user experience.
Can be institute in the LUN it should be noted that in the idle memory region C that above-mentioned target storage domain includes Part idle memory region in some idle memory regions or LUN, the present invention do not limit this.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file The LUN is distributed to the second virtual machine by LUN, wherein, the access right that the second virtual machine accesses the shared file is included in the LUN Limit or Share Permissions.I.e. target storage domain is above-mentioned LUN.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file Either the virtual disk or volume are distributed to the second virtual machine to virtual disk by a volume.Target storage domain is above-mentioned virtual Disk or volume.
Optionally, the storage resource management device LUN for storing the Shared Folders can also be distributed directly to this second Virtual machine, so that second virtual machine accesses to the Shared Folders in the LUN.
When the LUN also stores unshared file, it is necessary to which explanation, this document share equipment and set the unshared file Hidden state is set to, and limits the access rights of the unshared file(The second virtual machine is such as forbidden to carry out the unshared file Read operation and write operation), in this way, the unshared file is sightless to user, meanwhile, it is non-that the second virtual machine can not access this Shared file so as to prevent sharing unshared file, improves user experience.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes depositing The storage region A of shared file and idle memory region B is stored up, it, should if the LUN includes the storage region C of unshared file The unshared file is arranged to hidden state by file sharing devices, and limits the access limit of the unshared file, so that Second virtual machine can not access the unshared file in the storage region C for storing unshared file, the storage resource management device The LUN is distributed to second virtual machine, so that second virtual machine accesses the shared file in the LUN.
It should be noted that because the LUN is to distribute to the second virtual machine by the storage resource management device, the LUN The storage region of second virtual machine is equivalent to, in this way, after first virtual machine shutdown, which still can be right The shared file stored in the LUN accesses, so as to improve user experience.
Further, when user needs to cancel the file-sharing to second virtual machine, following steps are performed:
S306, this document share the identification information that equipment obtains second virtual machine, and the identification information is sent to and is deposited Store up explorer.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
S307, the storage resource management device delete the target storage domain of second virtual machine according to the identification information.
Specifically, when user determines to need to cancel the file-sharing to second virtual machine, this document is shared equipment and is obtained Take the identification information of second virtual machine(Such as the title or IP address of the second virtual machine), and the identification information is sent to and is deposited Explorer is stored up, which deletes the target storage domain of second virtual machine according to the identification information, from And cancel the file-sharing of first virtual machine to second virtual machine.
It should be noted that first virtual machine shares file, then first virtual machine can be by this article File where part is shared, and is shared so as to fulfill to this document, and specific implementation may be referred to step S301 extremely Step S307, details are not described herein again.
If it should be noted that when further including unshared file in file where the shared file, this document is common It enjoys equipment and the unshared file is arranged to hidden state, and limit the access rights of the unshared file, in this way, this is unshared File is sightless to user, so as to prevent sharing unshared file, improves user experience.
In addition, first virtual machine can also directly share file, then this document shares equipment in first void It is determined in the storage region of plan machine after needing to carry out shared file, this document shares the index section that equipment obtains the shared file Point information, and determine that the shared file stores this in the storage region of first virtual machine and shares according to the index node information The storage subregion of file, in this way, this document shares the storage region information that equipment obtains the shared file, and this is shared literary The storage region information of part is sent to the storage resource management device, so that the storage resource management device is according to the storage region information It determines target storage domain, and the target storage domain is sent to second virtual machine.
By using above-mentioned implementation steps, file sharing devices should by what is got in the storage region of first virtual machine The storage region information of shared file is sent to storage resource management device, and the storage resource management device is according to the storage region information It determines target storage domain, and the target storage domain is distributed to second virtual machine, so that second virtual machine accesses Shared file in the target storage domain, in this way, since the target storage domain is distributed by the storage resource management device To second virtual machine, so the target storage domain is equivalent to the storage region of second virtual machine, second virtual machine The shared file in the target storage domain can be directly accessed, without accessing the shared file from the first virtual machine, So as to reduce the occupancy to the first virtual machine computing resource, and improve access speed of second virtual machine to shared file Degree.
It should be noted that for above method embodiment, in order to be briefly described, therefore it is all expressed as a series of dynamic It combines, but those skilled in the art should know, the present invention and from the limitation of described sequence of movement, secondly, this Field technology personnel should also know, embodiment described in this description belongs to preferred embodiment, involved action and Module is not necessarily essential to the invention.
The embodiment of the present invention provides a kind of file sharing devices 40, includes as shown in figure 4, this document shares equipment 40:
Processing unit 41, for determining to provide the shared file in the first virtual machine of shared service.
Acquiring unit 42, for obtaining the storage region information of the shared file determined in the processing unit 41.
Transmitting element 43, the storage region information for the acquiring unit 42 to be got are sent to storage resource management Device, so that the storage resource management device determines target storage domain according to the storage region information, and by the target storage domain Distribute to the second virtual machine.
Wherein, which is stored with the shared file, which is the void for receiving the shared file Plan machine.
Specifically, user needs text to be sharing by the way that file sharing devices are definite in the storage region of first virtual machine After part, then equipment is shared by this document and the access rights of the shared file are set and allow receive the shared file second Virtual machine, second virtual machine can access to the shared file according to access rights.When shared file is usually set, meeting In units of file, i.e., the file in this document folder is shared file, and shared file in the embodiment of the present invention is also comprising setting Put the scene of Shared Folders.
Further, which is specifically used for, and the directory entry for obtaining the shared file is corresponding with the directory entry Index node information, and the storage region information is determined according to directory entry index node information corresponding with the directory entry.
Wherein, which is included in the storage that the shared file is stored in the storage region of first virtual machine The identification information of subregion.
In a kind of possible realization method of the present invention, which realizes text by being shared to file Part is shared, i.e., to share a certain file, then the file where this document is set to Shared Folders, wherein, the shared file Include shared file in folder, shared at least one of sub-folder and shared subfile can also be included, then this document is shared Equipment determines after needing file to be sharing that this document shares the mesh that equipment obtains the Shared Folders in first virtual machine Record item(Such as title of the shared sub-folder and/or the shared subfile), corresponding index node is determined according to the directory entry Information, and determine according to the index node information to store the storage sub-district of the shared file in the storage region of the first virtual machine Domain in the case of shared at least one of sub-folder and shared subfile is included, such as includes shared sub-folder, also wraps Include the storage subregion that the shared sub-folder stored in the storage region of the first virtual machine is determined according to index node information. Wherein, by taking the situation that Shared Folders includes shared file as an example, which is included in depositing for first virtual machine The identification information of the storage subregion of the shared file is stored in storage area domain, in this way, this document, which shares equipment, obtains the shared text The storage region information of part folder(The mark of the storage subregion of the shared file is such as stored in the storage region of the first virtual machine Information).
Illustratively, this document shares equipment and determines Shared Folders in first virtual machine, bag in the Shared Folders Shared sub-folder and shared subfile X are included, includes shared subfile Y, the mesh of the Shared Folders in the shared sub-folder Record item is denoted as directory entry A, and the index node information of the shared sub-folder is denoted as index node information a, the shared subfile X's Index node information is denoted as index node information b, and the directory entry of the shared sub-folder is denoted as directory entry B, the shared subfile Y Index node information be denoted as index node information c, wherein, index node information a is included in the memory block of the first virtual machine The identification information of the storage subregion of the shared sub-folder is stored in domain;This document is shared equipment and is determined according to directory entry A The index node information a and index node information b, so as to which the identification information in index node information a is determined the The storage subregion of the shared sub-folder is stored in the storage region of one virtual machine, and the mesh is determined according to the storage subregion Item B is recorded, and index node information c is determined according to directory entry B, it is empty first so as to be determined according to index node information c The storage subregion of the shared sub-folder Y is stored in the storage region of plan machine;This document shares equipment according to the index node Information b determines to store the storage subregion of the shared subfile X in the storage region of the first virtual machine, in this way, this document is total to Enjoy the storage region information that equipment obtains the Shared Folders(Shared sub-folder and shared subfile X and shared subfile The mark letter of storage subregion of the corresponding storage regions of shared subfile Y in the storage region of the first virtual machine in folder Breath).
It should be noted that the storage region division of the first virtual machine has multiple storage subregions, the plurality of storage sub-district Domain is corresponding with identification information, and the corresponding index node information of above-mentioned directory entry, which is included in the storage region of the first virtual machine, to be stored The corresponding shared sub-folder of the directory entry(The shared subfile Y in sub-folder is shared including this)And/or the shared Ziwen The corresponding identification information of storage subregion of part X, then this document share equipment and determined according to the identification information in the first virtual machine Storage region in store the shared sub-folder(The shared subfile in sub-folder is shared including this)And/or the shared son Storage subregion in file.
In the alternatively possible realization method of the present invention, which shares file, then first void Plan machine can be shared, specific implementation by being shared to the file where this document so as to fulfill to this document It may be referred to carry out file in a kind of realization method shared corresponding description, details are not described herein again.
If it should be noted that when further including unshared file in file where the shared file, this document is common It enjoys equipment and the unshared file is arranged to hidden state, and limit the access rights of the unshared file, in this way, this is unshared File is sightless to user, so as to prevent sharing unshared file, improves user experience.
In addition, first virtual machine can also directly share file, then this document shares equipment in first void It is determined in the storage region of plan machine after needing to carry out shared file, this document shares the index section that equipment obtains the shared file Point information, and determine that the shared file stores this in the storage region of first virtual machine and shares according to the index node information The storage subregion of file, in this way, this document shares the storage region information that equipment obtains the shared file.
It should be noted that this document shares equipment can also send idle memory region letter to storage resource management device Breath, wherein, which includes not having the storage sub-district for storing data in the storage region of first virtual machine The identification information in domain, that is to say, that above-mentioned storage region information can also include the free storage domain information, the storage resource Manager then determines target storage domain according to the storage region information, and it is second virtual that the target storage domain is distributed to this Machine, if in this way, the permission that file sharing devices are set allows second virtual machine to write shared file progress write operation The data of the shared file can be stored in the corresponding idle memory region of free storage domain information, to improve user's body It tests.
Specifically, above-mentioned storage resource management device determines that the target storage domain can include according to the storage region information Following two realization methods:
Mode one, this document shares equipment and the storage region information is sent to storage resource management device, so as to the storage Explorer determines to store according to the storage region information LUN of the shared file, and the LUN is distributed second virtual to this Machine, so that second virtual machine accesses to the shared file in the LUN.
Wherein, which stores the shared file.
When the LUN also stores unshared file, it is necessary to which explanation, this document share equipment and set the unshared file Hidden state is set to, and limits the access rights of the unshared file(The second virtual machine is such as forbidden to carry out the unshared file Read operation and write operation), in this way, the unshared file is sightless to user, meanwhile, it is non-that the second virtual machine can not access this Shared file so as to prevent sharing unshared file, improves user experience.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes depositing The storage region A of shared file and idle memory region B is stored up, it, should if the LUN includes the storage region C of unshared file The unshared file is arranged to hidden state by file sharing devices, and limits the access limit of the unshared file, so that Second virtual machine can not access the unshared file in the storage region C for storing unshared file, the storage resource management device The LUN is distributed to second virtual machine, so that second virtual machine visits the shared file stored in the LUN It asks.
It should be noted that because the LUN is to distribute to the second virtual machine by the storage resource management device, the LUN The storage region of second virtual machine is equivalent to, in this way, after first virtual machine shutdown, which still can be right The shared file stored in the LUN accesses, so as to improve user experience.
Mode two, this document shares equipment and the storage region information is sent to storage resource management device, so as to the storage Explorer determines to store the LUN of the shared file according to the storage region information, and determines target storage according to the LUN Domain, and second virtual machine is distributed into the target storage domain, so that second virtual machine visits the shared file It asks.
Wherein, which stores the shared file and unshared file;The target storage domain stores the shared file.
Specifically, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, it is common which stores this File and unshared file are enjoyed, and the storage resource management device determines that storage should according to the storage region information in the LUN The storage region is encapsulated as target storage domain by the storage region of shared file, the storage resource management device, and by the target Storage region is distributed to the second virtual machine, for example, the storage region can store the disk storage region of the shared file, it should Target storage domain can be virtual volume, then the storage resource management device will store the disk storage of the shared file in the LUN Region is encapsulated as virtual volume, and the virtual volume is distributed to the second virtual machine, in this way, the second virtual machine is after the power-up, Neng Goushi The not virtual volume, and can access to the shared file stored in the virtual volume.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes storage The storage region B and idle memory region C of the storage region A of shared file, the unshared file of storage, then the storage resource pipe Storage region A and idle memory region C are encapsulated as target storage domain by reason device according to the storage region information, which deposits Storage area domain includes storage region A and idle memory region C, and the target storage domain is distributed second virtual to this Machine so that second virtual machine accesses the shared file in the target storage domain because the target storage domain be by The storage resource management device distributes to the second virtual machine, so the target storage domain is equivalent to the memory block of second virtual machine Domain, in this way, after first virtual machine shutdown, second virtual machine still can to stored in the target storage domain this is common It enjoys file to access, so as to improve user experience.
Can be institute in the LUN it should be noted that in the idle memory region C that above-mentioned target storage domain includes Part idle memory region in some idle memory regions or LUN, the present invention do not limit this.
In addition, aforesaid way one and mode two difference lies in:Mode one, being directly will be in the memory block of the first virtual machine In domain determine LUN distribute to the second virtual machine, due to the LUN include storage shared file storage region and including store it is non- The storage region of shared file therefore, it is also desirable to which unshared file is arranged to hidden state, and limits the unshared file Access rights;And mode two, it is by the memory block of the LUN determined in the storage region of the first virtual machine the shared files included Domain is encapsulated as a new storage region, and the new storage region is distributed to the second virtual machine, and the embodiment of the present invention is to upper Two kinds of realization methods are stated to be not construed as limiting.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file The LUN is distributed to the second virtual machine by LUN, wherein, the access right that the second virtual machine accesses the shared file is included in the LUN Limit or Share Permissions.I.e. target storage domain is above-mentioned LUN.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file Either the virtual disk or volume are distributed to the second virtual machine to virtual disk by a volume.Target storage domain is above-mentioned virtual Disk or volume.
Further, which is additionally operable to, and obtains the identification information of second virtual machine, wherein, mark letter Breath be used to indicate cancel second virtual machine access the shared file.
The transmitting element 43 is additionally operable to, which is sent to storage resource management device, so as to the storage resource pipe Reason device deletes the target storage domain of second virtual machine according to the identification information.
Specifically, when user determines to need to cancel the file-sharing to second virtual machine, this document is shared equipment and is obtained Take the identification information of second virtual machine(Such as the title or IP address of the second virtual machine), and the identification information is sent to and is deposited Explorer is stored up, which deletes the target storage domain of second virtual machine according to the identification information, from And cancel the file-sharing of first virtual machine to second virtual machine.
Using above-mentioned file sharing devices, this document, which shares equipment, to be got in the storage region of the first virtual machine The storage region information of the shared file is sent to storage resource management device, which believes according to the storage region Breath determines target storage domain, and the target storage domain is distributed to second virtual machine, so that second virtual machine pair The shared file accesses, in this way, since the target storage domain is to distribute to second void by the storage resource management device Plan machine, so the target storage domain is equivalent to the storage region of second virtual machine, which can directly access Shared file in the target storage domain, without accessing the shared file from first virtual machine again, so as to reduce To the occupancy of the first virtual machine computing resource, and improve access speed of second virtual machine to the shared file.
Affiliated those skilled in the art can be understood that, for convenience and simplicity of description, the text of foregoing description Part shares specific work process and the description of equipment, may be referred to the corresponding process in preceding method embodiment, no longer superfluous herein It states.
The embodiment of the present invention provides a kind of storage resource management device 50, as shown in figure 5, the storage resource management device 50 wraps It includes:
Receiving unit 51, for receiving the storage region information of the shared file of file sharing devices transmission, the shared text Part is provided by the first virtual machine.
Processing unit 52, the storage region information for being received according to the receiving unit 51 determine target storage domain, And the second virtual machine is distributed into the target storage domain, so that second virtual machine accesses to the shared file.
Wherein, which is stored with the shared file.
Specifically, user needs text to be sharing by the way that file sharing devices are definite in the storage region of first virtual machine After part, then equipment is shared by this document and the access rights of the shared file are set and allow receive the shared file second Virtual machine, second virtual machine can access to the shared file according to access rights.When shared file is usually set, meeting In units of file, i.e., the file in this document folder is shared file, and shared file in the embodiment of the present invention is also comprising setting Put the scene of Shared Folders.
Further, this document share equipment obtain the shared file directory entry and the directory entry it is corresponding index section Point information, and the storage region information is determined according to directory entry index node information corresponding with the directory entry, and this is deposited Storage area domain information is sent to storage resource management device.
Wherein, which is included in the storage that the shared file is stored in the storage region of first virtual machine The identification information of subregion.
In a kind of possible realization method of the present invention, which realizes text by being shared to file Part is shared, i.e., to share a certain file, then the file where this document is set to Shared Folders, wherein, the shared file Include shared file in folder, shared at least one of sub-folder and shared subfile can also be included, then this document is shared Equipment determines after needing file to be sharing that this document shares the mesh that equipment obtains the Shared Folders in first virtual machine Record item(Such as title of the shared sub-folder and/or the shared subfile), corresponding index node is determined according to the directory entry Information, and determine according to the index node information to store the storage sub-district of the shared file in the storage region of the first virtual machine Domain in the case of shared at least one of sub-folder and shared subfile is included, such as includes shared sub-folder, also wraps Include the storage subregion that the shared sub-folder stored in the storage region of the first virtual machine is determined according to index node information. Wherein, by taking the situation that Shared Folders includes shared file as an example, which is included in depositing for first virtual machine The identification information of the storage subregion of the shared file is stored in storage area domain, in this way, this document, which shares equipment, obtains the shared text The storage region information of part folder(The mark of the storage subregion of the shared file is such as stored in the storage region of the first virtual machine Information).
Illustratively, this document shares equipment and determines Shared Folders in first virtual machine, bag in the Shared Folders Shared sub-folder and shared subfile X are included, includes shared subfile Y, the mesh of the Shared Folders in the shared sub-folder Record item is denoted as directory entry A, and the index node information of the shared sub-folder is denoted as index node information a, the shared subfile X's Index node information is denoted as index node information b, and the directory entry of the shared sub-folder is denoted as directory entry B, the shared subfile Y Index node information be denoted as index node information c, wherein, index node information a is included in the memory block of the first virtual machine The identification information of the storage subregion of the shared sub-folder is stored in domain;This document is shared equipment and is determined according to directory entry A The index node information a and index node information b, so as to which the identification information in index node information a is determined the The storage subregion of the shared sub-folder is stored in the storage region of one virtual machine, and the mesh is determined according to the storage subregion Item B is recorded, and index node information c is determined according to directory entry B, it is empty first so as to be determined according to index node information c The storage subregion of the shared sub-folder Y is stored in the storage region of plan machine;This document shares equipment according to the index node Information b determines to store the storage subregion of the shared subfile X in the storage region of the first virtual machine, in this way, this document is total to Enjoy the storage region information that equipment obtains the Shared Folders(Shared sub-folder and shared subfile X and shared subfile The mark letter of storage subregion of the corresponding storage regions of shared subfile Y in the storage region of the first virtual machine in folder Breath).
It should be noted that the storage region division of the first virtual machine has multiple storage subregions, the plurality of storage sub-district Domain is corresponding with identification information, and the corresponding index node information of above-mentioned directory entry, which is included in the storage region of the first virtual machine, to be stored The corresponding shared sub-folder of the directory entry(The shared subfile Y in sub-folder is shared including this)And/or the shared Ziwen The corresponding identification information of storage subregion of part X, then this document share equipment and determined according to the identification information in the first virtual machine Storage region in store the shared sub-folder(The shared subfile in sub-folder is shared including this)And/or the shared son Storage subregion in file.
In the alternatively possible realization method of the present invention, which shares file, then first void Plan machine can be shared, specific implementation by being shared to the file where this document so as to fulfill to this document It may be referred to carry out file in a kind of realization method shared corresponding description, details are not described herein again.
If it should be noted that when further including unshared file in file where the shared file, this document is common It enjoys equipment and the unshared file is arranged to hidden state, and limit the access rights of the unshared file, in this way, this is unshared File is sightless to user, so as to prevent sharing unshared file, improves user experience.
In addition, first virtual machine can also directly share file, then this document shares equipment in first void It is determined in the storage region of plan machine after needing to carry out shared file, this document shares the index section that equipment obtains the shared file Point information, and determine that the shared file stores this in the storage region of first virtual machine and shares according to the index node information The storage subregion of file, in this way, this document shares the storage region information that equipment obtains the shared file.
It should be noted that this document shares equipment can also send idle memory region letter to storage resource management device Breath, wherein, which includes not having the storage sub-district for storing data in the storage region of first virtual machine The identification information in domain, that is to say, that above-mentioned storage region information can also include the free storage domain information, the storage resource Manager then determines target storage domain according to the storage region information, and it is second virtual that the target storage domain is distributed to this Machine, if in this way, the permission that file sharing devices are set allows second virtual machine to write shared file progress write operation The data of the shared file can be stored in the corresponding idle memory region of free storage domain information, to improve user's body It tests.
Optionally, which is additionally operable to, and LUN is determined according to the storage region information.
Wherein, which is stored with the shared file.
Specifically, which determines to store the LUN of the shared file according to the storage region information, and will The LUN is distributed to second virtual machine, so that second virtual machine accesses to the shared file in the LUN.
When the LUN also stores unshared file, it is necessary to which explanation, this document share equipment and set the unshared file Hidden state is set to, and limits the access rights of the unshared file(The second virtual machine is such as forbidden to carry out the unshared file Read operation and write operation), in this way, the unshared file is sightless to user, meanwhile, it is non-that the second virtual machine can not access this Shared file so as to prevent sharing unshared file, improves user experience.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes depositing The storage region A of shared file and idle memory region B is stored up, it, should if the LUN includes the storage region C of unshared file The unshared file is arranged to hidden state by file sharing devices, and limits the access limit of the unshared file, so that Second virtual machine can not access the unshared file in the storage region C for storing unshared file, the storage resource management device The LUN is distributed to second virtual machine, so that second virtual machine visits the shared file stored in the LUN It asks.
It should be noted that because the LUN is to distribute to the second virtual machine by the storage resource management device, the LUN The storage region of second virtual machine is equivalent to, in this way, after first virtual machine shutdown, which still can be right The shared file stored in the LUN accesses, so as to improve user experience.
Optionally, which is specifically used for, and determines LUN according to the storage region information, and is determined according to the LUN The target storage domain.
Wherein, which stores the shared file and unshared file;The target storage domain stores the shared file.
Specifically, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, it is common which stores this File and unshared file are enjoyed, and the storage resource management device determines that storage should according to the storage region information in the LUN The storage region of shared file, which is encapsulated as target storage domain by storage region, and the target is deposited Storage area domain is distributed to the second virtual machine, for example, the storage region can store the disk storage region of the shared file, the mesh It can be virtual volume to mark storage region, then the storage resource management device will store the disk storage area of the shared file in the LUN Domain is encapsulated as virtual volume, and the virtual volume is distributed to the second virtual machine, in this way, the second virtual machine is after the power-up, can identify The virtual volume, and can access to the shared file stored in the virtual volume.
Illustratively, which receives the storage region information that file sharing devices are sent, and passes through this and deposit Storage area domain information determines the LUN of the storage shared file in the storage region of the first virtual machine, wherein, which includes storage The storage region B and idle memory region C of the storage region A of the shared file, the unshared file of storage, the then storage resource Storage region A and idle memory region C are encapsulated as target storage domain by manager according to the storage region information, the target Storage region includes storage region A and idle memory region C, and the target storage domain is distributed second virtual to this Machine, so that second virtual machine accesses to the shared file stored in the target storage domain, because the target is deposited Storage area domain is to distribute to the second virtual machine by the storage resource management device, so to be equivalent to this second virtual in the target storage domain The storage region of machine, in this way, after first virtual machine shutdown, which still can be in the target storage domain The shared file of storage accesses, so as to improve user experience.
Can be institute in the LUN it should be noted that in the idle memory region C that above-mentioned target storage domain includes Part idle memory region in some idle memory regions or LUN, the present invention do not limit this.
In addition, the optional processing unit of above two difference lies in:The first processing unit, being directly will be virtual first In the storage region of machine determine LUN distribute to the second virtual machine, due to the LUN include storage shared file storage region and Including storing the storage region of unshared file, therefore, it is also desirable to unshared file is arranged to hidden state, and it is non-to limit this The access rights of shared file;And second of processing unit, it is to include the LUN determined in the storage region of the first virtual machine The storage region of shared file be encapsulated as a new storage region, and the new storage region is distributed to second virtual Machine, the embodiment of the present invention are not construed as limiting the realization method of above two processing unit.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file The LUN is distributed to the second virtual machine by LUN, wherein, the access right that the second virtual machine accesses the shared file is included in the LUN Limit or Share Permissions.I.e. target storage domain is above-mentioned LUN.
Another embodiment, this document share equipment and the storage region information are sent to storage resource management device, with Just the storage resource management device determines to store the storage region of the shared file according to the storage region information, including this is shared Storage region and one section of idle memory region where file are packaged into one as the storage region for storing the shared file Either the virtual disk or volume are distributed to the second virtual machine to virtual disk by a volume.Target storage domain is above-mentioned virtual Disk or volume.
Further, which is additionally operable to, and receives the mark that this document shares second virtual machine of equipment transmission Know information.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
The processing unit 52 is additionally operable to, and the target storage domain of second virtual machine is deleted according to the identification information
Specifically, when user determines to need to cancel the file-sharing to second virtual machine, this document is shared equipment and is obtained Take the identification information of second virtual machine(Such as the title or IP address of the second virtual machine), and the identification information is sent to and is deposited Explorer is stored up, which deletes the target storage domain of second virtual machine according to the identification information, from And cancel the file-sharing of first virtual machine to second virtual machine.
Using above-mentioned storage resource management device, shared file in file sharing devices determine first virtual machine simultaneously obtains After taking the storage region information of the shared file, which receives the memory block that this document shares equipment transmission Domain information, and determine target storage domain according to the storage region information, the storage resource management device is by the target storage domain Second virtual machine is distributed to, so that second virtual machine accesses to the shared file in the target storage domain, In this way, since the target storage domain is to distribute to second virtual machine by the storage resource management device, so the target is deposited Storage area domain is equivalent to the storage region of second virtual machine, which can directly access in the target storage domain The shared file, without accessing the shared file from first virtual machine, so as to reduce to the first virtual machine meter The occupancy of resource is calculated, and improves access speed of second virtual machine to shared file.
Affiliated those skilled in the art can be understood that for convenience and simplicity of description, foregoing description is deposited Specific work process and the description of explorer are stored up, may be referred to the corresponding process in preceding method embodiment, herein no longer It repeats.
The present invention provides a kind of file sharing devices 60, includes as shown in fig. 6, this document shares equipment 60:
Processor(processor)61st, communication interface(Communications Interface)62nd, memory (memory)63 and communication bus 64;Wherein, the processor 61, the communication interface 62 and the memory 63 are by described Communication bus 64 completes mutual communication.
Processor 61 may be a multi-core central processing unit CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit)Or it is arranged to implement the one of the embodiment of the present invention A or multiple integrated circuits.
For memory 63 for storing program code, said program code includes computer-managed instruction and network flow graph.It deposits Reservoir 63 may include high-speed RAM memory, it is also possible to further include nonvolatile memory(non-volatile memory), A for example, at least magnetic disk storage.
The communication interface 62, the connection communication being used to implement between these devices.
The processor 61 performs program code, for determining to provide the shared file in the first virtual machine of shared service, The storage region information of the shared file is obtained, and the storage region information is sent to storage resource management device, so that this is deposited Storage explorer determines target storage domain according to the storage region information, and the target storage domain is distributed to the second void Plan machine.
Wherein, which is stored with the shared file, which is the void for receiving the shared file Plan machine.
Optionally, which is additionally operable to, and obtains the directory entry index section corresponding with the directory entry of the shared file Point information, and the storage region information is determined according to directory entry index node information corresponding with the directory entry.
Wherein, which is included in the storage that the shared file is stored in the storage region of first virtual machine The identification information of subregion.
Optionally, which is additionally operable to, and obtains the identification information of second virtual machine, and the identification information is sent Storage resource management device is given, so that the target that the storage resource management device deletes according to the identification information second virtual machine is deposited Storage area domain.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
The embodiment of the present invention provides a kind of storage resource management device 70, as shown in fig. 7, the storage resource management device 70 wraps It includes:
Processor(processor)71st, communication interface(Communications Interface)72nd, memory (memory)73 and communication bus 74;Wherein, the processor 71, the communication interface 72 and the memory 73 are by described Communication bus 74 completes mutual communication.
Processor 71 may be a multi-core central processing unit CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit)Or it is arranged to implement the one of the embodiment of the present invention A or multiple integrated circuits.
For memory 73 for storing program code, which includes computer-managed instruction and network flow graph.Storage Device 73 may include high-speed RAM memory, it is also possible to further include nonvolatile memory(non-volatile memory), example Such as at least one magnetic disk storage.
The communication interface 72, the connection communication being used to implement between these devices.
The processor 71 performs program code, for receiving the storage region letter of the shared file of file sharing devices transmission Breath, which provided by the first virtual machine, and target storage domain is determined according to the storage region information, and by the mesh Mark storage region distributes to the second virtual machine, so that second virtual machine accesses to the shared file.
Wherein, which is stored with the shared file;The storage region information is included in first virtual machine Storage region in store the shared file storage subregion identification information.
Optionally, which is additionally operable to, and LUN is determined according to the storage region information.
Wherein, which stores the shared file.
Optionally, which is additionally operable to, and determines LUN according to the storage region information, and determines the mesh according to the LUN Mark storage region.
Wherein, which stores the shared file and unshared file;The target storage domain stores the shared file.
Optionally, which is additionally operable to, and receives the mark letter that this document shares second virtual machine of equipment transmission It ceases, and the target storage domain of second virtual machine is deleted according to the identification information.
Wherein, the identification information be used to indicate cancel second virtual machine access the shared file.
Virtual machine access shared file includes reading, modification, write-in, deletion etc. in the embodiment of the present invention, specifically can root It is determined according to the shared file access rights of setting, the embodiment of the present invention is not construed as limiting this.Receiving the virtual machine of shared file is After referring to virtual machine A setting shared files, there are shared file access rights in addition to virtual machine A, the shared file can be accessed Virtual machine.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, all should by the change or replacement that can be readily occurred in It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (14)

  1. A kind of 1. method of file-sharing, which is characterized in that including:
    File sharing devices determine to provide the shared file in the first virtual machine of shared service;
    Obtain the storage region information of the shared file;
    The storage region information is sent to storage resource management device, so that the storage resource management device is according to the storage Area information determines target storage domain, and the target storage domain is distributed to the second virtual machine, wherein, the target is deposited Storage area domain is stored with the shared file, and second virtual machine is the virtual machine for receiving the shared file;
    It is described that storage region information is sent to storage resource management device, so that the storage resource management device is according to the storage Area information determines target storage domain, and the target storage domain is distributed to the second virtual machine, specifically includes:
    Storage region information is sent to storage resource management device, in order to which storage resource management device is believed according to the storage region Breath, determines the LUN of the shared file in the storage region of the first virtual machine, and the storage resource management device is deposited according to Storage area domain information determines the storage region of the shared file in the LUN, and the storage region is encapsulated as the mesh Storage region is marked, second virtual machine is distributed in the target storage domain by the storage resource management device.
  2. 2. the according to the method described in claim 1, it is characterized in that, storage region packet for obtaining the shared file It includes:
    Obtain the directory entry of the shared file and the corresponding index node information of the directory entry;
    The storage region information is determined according to the directory entry and the corresponding index node information of the directory entry.
  3. 3. method according to claim 1 or 2, which is characterized in that in the storage resource management device according to the storage After area information determines target storage domain, the method further includes:
    The identification information of second virtual machine is obtained, wherein, the identification information, which is used to indicate, cancels second virtual machine Access the shared file;
    The identification information is sent to storage resource management device, so that the storage resource management device is according to the identification information Delete the target storage domain of second virtual machine.
  4. A kind of 4. method of file-sharing, which is characterized in that including:
    Storage resource management device receives the storage region information for the shared file that file sharing devices are sent, and the shared file is It is provided by the first virtual machine;
    Target storage domain is determined according to the storage region information, and the target storage domain is distributed to second virtually Machine, so that second virtual machine accesses to the shared file;Wherein, the target storage domain is stored with described Shared file;
    It is described that target storage domain is determined according to the storage region information, and the second void is distributed into the target storage domain Plan machine, specifically includes:
    The LUN of the storage shared file, root are determined in the storage region of the first virtual machine by the storage region information The storage region of the storage shared file is determined in the LUN according to the storage region information, the storage region is sealed It fills as the target storage domain, and the target storage domain is distributed to second virtual machine.
  5. 5. according to the method described in claim 4, it is characterized in that, the target storage domain is logical unit number LUN;Its In, the LUN stores the shared file.
  6. 6. according to the method described in claim 4, it is characterized in that, described determine that target stores according to the storage region information Region includes:
    LUN is determined according to the storage region information, and the target storage domain is determined according to the LUN, wherein, it is described LUN stores the shared file and unshared file;The target storage domain stores the shared file.
  7. 7. according to claim 4 to 6 any one of them method, which is characterized in that distribute to institute in the target storage domain After stating the second virtual machine, the method further includes:
    The identification information for second virtual machine that the file sharing devices are sent is received, wherein, the identification information is used for Instruction cancels second virtual machine and accesses the shared file;
    The target storage domain of second virtual machine is deleted according to the identification information.
  8. 8. a kind of file sharing devices, which is characterized in that including:
    Processing unit, for determining to provide the shared file in the first virtual machine of shared service;
    Acquiring unit, for obtaining the storage region information of the shared file determined in the processing unit;
    Transmitting element, the storage region information for the acquiring unit to be got are sent to storage resource management device, so as to The storage resource management device determines target storage domain according to the storage region information, and the target storage domain is divided The second virtual machine of dispensing, wherein, the target storage domain is stored with the shared file, and second virtual machine is reception institute State the virtual machine of shared file;
    The storage resource management device determines target storage domain according to the storage region information, and by the target storage The second virtual machine is distributed in domain, is specifically included:
    The LUN of the storage shared file, root are determined in the storage region of the first virtual machine by the storage region information The storage region of the storage shared file is determined in the LUN according to the storage region information, the storage region is sealed It fills as the target storage domain, and the target storage domain is distributed to second virtual machine.
  9. 9. equipment according to claim 8, which is characterized in that the acquiring unit is specifically used for:
    Obtain the directory entry of the shared file and the corresponding index node information of the directory entry, and according to the directory entry and The corresponding index node information of the directory entry determines the storage region information.
  10. 10. equipment according to claim 8 or claim 9, which is characterized in that
    The acquiring unit is additionally operable to, and obtains the identification information of second virtual machine, wherein, the identification information is used to indicate Cancel second virtual machine and access the shared file;
    The transmitting element is additionally operable to, and the identification information is sent to storage resource management device, so as to the storage resource pipe Manage the target storage domain that device deletes second virtual machine according to the identification information.
  11. 11. a kind of storage resource management device, which is characterized in that including:
    Receiving unit, for receiving the storage region information of the shared file of file sharing devices transmission, the shared file is It is provided by the first virtual machine;
    Processing unit, the storage region information for being received according to the receiving unit determine target storage domain, and by institute It states target storage domain and distributes to the second virtual machine, so that second virtual machine accesses to the shared file;Its In, the target storage domain is stored with the shared file;
    The processing unit is specifically used for, and storage is determined in the storage region of the first virtual machine by the storage region information The LUN of the shared file determines the memory block of the storage shared file according to the storage region information in the LUN The storage region is encapsulated as the target storage domain, and the target storage domain is distributed to the described second void by domain Plan machine.
  12. 12. storage resource management device according to claim 11, which is characterized in that the processing unit is specifically used for:
    LUN is determined according to the storage region information;Wherein, the LUN stores the shared file.
  13. 13. storage resource management device according to claim 11, which is characterized in that the processing unit is specifically used for:
    LUN is determined according to the storage region information, and the target storage domain is determined according to the LUN, wherein, it is described LUN stores the shared file and unshared file;The target storage domain stores the shared file.
  14. 14. according to claim 11 to 13 any one of them storage resource management device, which is characterized in that
    The receiving unit is additionally operable to, and receives the identification information for second virtual machine that the file sharing devices are sent, In, the identification information, which is used to indicate, cancels the second virtual machine access shared file;
    The processing unit is additionally operable to, and the target storage domain of second virtual machine is deleted according to the identification information.
CN201310464197.XA 2013-09-30 2013-09-30 A kind of method and apparatus of file-sharing Active CN103491193B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310464197.XA CN103491193B (en) 2013-09-30 2013-09-30 A kind of method and apparatus of file-sharing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310464197.XA CN103491193B (en) 2013-09-30 2013-09-30 A kind of method and apparatus of file-sharing

Publications (2)

Publication Number Publication Date
CN103491193A CN103491193A (en) 2014-01-01
CN103491193B true CN103491193B (en) 2018-06-05

Family

ID=49831146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310464197.XA Active CN103491193B (en) 2013-09-30 2013-09-30 A kind of method and apparatus of file-sharing

Country Status (1)

Country Link
CN (1) CN103491193B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156031B (en) * 2015-03-24 2019-10-29 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN105550576B (en) * 2015-12-11 2018-09-11 华为技术服务有限公司 The method and apparatus communicated between container
CN110688194B (en) * 2018-07-06 2023-03-17 中兴通讯股份有限公司 Disk management method based on cloud desktop, virtual machine and storage medium
CN109189741A (en) * 2018-09-11 2019-01-11 郑州云海信息技术有限公司 The system and method for shared file between a kind of virtual machine
CN113467941A (en) * 2021-06-25 2021-10-01 北京汇钧科技有限公司 Method and device for sharing information
CN117938830A (en) * 2022-01-21 2024-04-26 荣耀终端有限公司 File sharing method, communication system and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289513A (en) * 2011-09-05 2011-12-21 盛乐信息技术(上海)有限公司 Method and system for obtaining internal files of virtual machine

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2216963A1 (en) * 2009-02-04 2010-08-11 Nec Corporation Method for transmitting virtualized data in cloud computing environment
WO2012057581A2 (en) * 2010-10-28 2012-05-03 에스케이텔레콤 주식회사 Cloud computing system and data synchronization method therefor
CN103309743A (en) * 2012-03-07 2013-09-18 上海聚耘信息科技有限公司 Resource sharing management method of virtual server
CN103389884A (en) * 2013-07-29 2013-11-13 华为技术有限公司 Method for processing input/output request, host, server and virtual machine

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289513A (en) * 2011-09-05 2011-12-21 盛乐信息技术(上海)有限公司 Method and system for obtaining internal files of virtual machine

Also Published As

Publication number Publication date
CN103491193A (en) 2014-01-01

Similar Documents

Publication Publication Date Title
CN103491193B (en) A kind of method and apparatus of file-sharing
CN104899286B (en) Distributed content is stored and is fetched
CN103324533B (en) distributed data processing method, device and system
CN106446159B (en) A kind of method of storage file, the first virtual machine and name node
US9860317B1 (en) Throughput throttling for distributed file storage services with varying connection characteristics
CN104461685B (en) Virtual machine processing method and virtual computer system
US20180196603A1 (en) Memory Management Method, Apparatus, and System
CN107818013A (en) A kind of application scheduling method thereof and device
CN103401902A (en) Portable cloud storage system and method
CN103425538A (en) Process communication method and process communication system
CN103559319B (en) The cache synchronization method and equipment of distributed cluster file system
CN105892943A (en) Access method and system for block storage data in distributed storage system
CN102404399A (en) Fuzzy dynamic allocation method for cloud storage resource
CN107179878A (en) The method and apparatus of data storage based on optimizing application
CN106802955A (en) A kind of image data caching method
CN109582213A (en) Data reconstruction method and device, data-storage system
CN103218305B (en) The distribution method of memory space
CN108197038A (en) A kind of Linux data transmission methods, device and user terminal
CN107436798A (en) A kind of process access method and device based on NUMA node
CN102427476A (en) Wireless cloud storage module
CN108829738A (en) Date storage method and device in a kind of ceph
US10057348B2 (en) Storage fabric address based data block retrieval
CN102427477A (en) Wireless cloud storage device
CN102833295B (en) Data manipulation method and device in distributed cache system
CN106951190B (en) Data storage and access method, node and server cluster

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211221

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right