CN104239575A - Virtual machine mirror image file storage and distribution method and device - Google Patents

Virtual machine mirror image file storage and distribution method and device Download PDF

Info

Publication number
CN104239575A
CN104239575A CN201410524284.4A CN201410524284A CN104239575A CN 104239575 A CN104239575 A CN 104239575A CN 201410524284 A CN201410524284 A CN 201410524284A CN 104239575 A CN104239575 A CN 104239575A
Authority
CN
China
Prior art keywords
image file
file block
virtual machine
fingerprint characteristic
block
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.)
Pending
Application number
CN201410524284.4A
Other languages
Chinese (zh)
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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201410524284.4A priority Critical patent/CN104239575A/en
Publication of CN104239575A publication Critical patent/CN104239575A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a virtual machine mirror image file storage and distribution method and device. The storage method comprises the steps of segmenting mirror image files into length-fixed mirror image file blocks; storing the mirror image file blocks. The length-fixed blocking and storage are performed on the mirror image files, so that a storage space for the virtual machine mirror image files can be effectively saved, and meanwhile high compression ratio is ensured. The distribution method comprises the steps of determining the mirror image file blocks belonging to a client-side node virtual machine; establishing connection between the client-side node virtual machine and other client-side nodes; obtaining the mirror image file blocks from other client-side nodes when the mirror image file blocks required by the client-side node virtual machine exist in other client-side nodes, and obtaining the required mirror image file blocks from a data server if the mirror image file blocks do not exist in other client-side nodes; or sending the mirror image file blocks when the mirror image file blocks required by other client-side nodes exist in the client-side node virtual machine. Mirror image file distribution of virtual machine client-sides is achieved by adopting a P2P protocol, and virtual machine mirror image file distribution efficiency and speed are effectively improved.

Description

A kind of virtual machine image file storage, distribution method and device
Technical field
The present invention relates to technical field of data storage, particularly a kind of virtual machine image file storage, distribution method and device.
Background technology
" cloud computing, " cloud storage " are the technological concepts occurring outbalance in recent years, bring long-range impact to the development of computer science and internet.Cloud computing, cloud storage conceal infrastructure and the management logic of bottom complexity, for user provides resource pool that is succinct, easy-to-use, dynamic adjustment.User is without the need to grasping the professional knowledge of cloud inside, and without the need to directly controlling the infrastructure of cloud base layer, the calculating that just can cloud be used easily to provide, storage resources, and can according to the demand of oneself, the use amount of change resource, so that save cost.
Along with building up of each cloud data center of major company, virtual machine scale under cloud environment is sharply expanded, between virtual machine, the aggravation that is multiplexing and network service load of hardware resource result in the decline of whole cloud computing service performance, how promoted the service quality of cloud system by the service performance improved under virtual environment, become the important topic of virtual machine research field.Virtual machine depends on required virtual machine image file itself in operational process, and in the data center of large-scale virtual cluster, the storage of the virtual machine image file of magnanimity seems particularly important.
When cloud computing environment creates new virtual machine, the hard disk mirror-image of use normally copies from a template mirror image.And fault-tolerant processing do not supported by traditional SAN (Storage Area Network and SAN protocols, Storage are network and agreement thereof) memory device, if SAN equipment failure, then whole system all cannot work on.
Visible, existing virtual machine image file store and in distribution Problems existing as follows:
1. the storage space shared by huge virtual machine image file stores is huge;
2. the distribution of virtual machine image file relies on merely image file data server, causes image file server to become network hotspot, limits the foundation of virtual machine and travelling speed and robustness.
Summary of the invention
The present invention is directed to the problems referred to above, propose the storage of a kind of virtual machine image file, distribution method and device, in order to solve the mass memory waste storage space of virtual machine image file and to distribute inefficient problem.
The invention provides a kind of virtual machine image file storage means, comprise the steps:
Image file is divided into the image file block of fixed length;
Image file block is stored.
The invention provides a kind of virtual machine image file distribution method, comprise the steps:
Determine the image file block belonging to this client node virtual machine;
Connect based on P2P (Peer to Peer, peer-to-peer network) agreement and other client nodes;
When determining the image file block existed in other client nodes needed for this client node virtual machine, from other client nodes, obtain this image file block, otherwise the image file block needed for obtaining from data server; Or, when determining to there is the image file block needed for other client node virtual machines in this client node virtual machine, this image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by image file block.
The invention provides a kind of virtual machine image file memory storage, comprising:
Cutting unit, for being divided into the image file block of fixed length by image file;
Storage unit, for storing image file block.
The invention provides a kind of virtual machine image file dispensing device, comprising:
Determining unit, for determining the image file block belonging to this client node virtual machine;
Linkage unit, for connecting based on Peer-to-Peer Network P2P agreement and other client nodes;
Dispatching Unit, for when determining the image file block existed in other client nodes needed for this client node virtual machine, obtains this image file block from other client nodes, otherwise the image file block needed for obtaining from data server; Or, when determining to there is the image file block needed for other client node virtual machines in this client node virtual machine, this image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by image file block.
Beneficial effect of the present invention is as follows:
During current virtual machine image file stores, due to image file substantial amounts, cause virtual machine image file to store institute and take up space huge.In the virtual machine image file storage scheme that the embodiment of the present invention provides, store by being divided into the image file block of fixed length to virtual machine image file, due to by being divided into block to image file fixed length, ensure that higher ratio of compression, so, effectively can save the storage space of virtual machine image file.
In addition, in the distribution of existing virtual machine image file, rely on image file server merely, limit the foundation of virtual machine and travelling speed and robustness.For this problem, in the virtual machine image file distribution approach that the embodiment of the present invention provides, adopt P2P agreement between virtual machine client end, carry out the quick clone of image file, distribution, because utilize the distribution method of P2P virtual machine image file, all image file server and client node all can be used as the supplier of image file block, the mutual image file block exchanging storage, effectively the data transfer loads of image file server is transferred on client node, balance the load of data transmission, avoid the appearance of network hotspot, effectively shorten time and the IO expense of the required wait of copy image file, improve efficiency and the speed of virtual machine image file distribution.
Accompanying drawing explanation
Below with reference to accompanying drawings specific embodiments of the invention are described, wherein:
Fig. 1 is the schematic flow sheet of virtual machine image file storage means in the embodiment of the present invention;
Fig. 2 is the de-redundancy ratio of compression schematic diagram that in the embodiment of the present invention, under different image file stripping and slicing size, system realizes;
Fig. 3 is the IO results of property schematic diagram of system under different image file stripping and slicing size parameter in the embodiment of the present invention;
Fig. 4 is image file block storage scheme IO the performance test results schematic diagram in the embodiment of the present invention;
Fig. 5 is the MD5 algorithm of fingerprint calculating and the Performance comparision schematic diagram of SHA-1 algorithm in the embodiment of the present invention;
Fig. 6 is that in the embodiment of the present invention, image file block file stores schematic diagram;
Fig. 7 is the schematic flow sheet of virtual machine image file distribution method in the embodiment of the present invention;
Fig. 8 is the application scenarios schematic diagram of virtual machine image file distribution method in the embodiment of the present invention;
Fig. 9 is virtual machine image file memory storage schematic diagram in the embodiment of the present invention;
Figure 10 is virtual machine image file dispensing device schematic diagram in the embodiment of the present invention;
Figure 11 is Bonnie++ system performance testing result schematic diagram in the embodiment of the present invention;
Figure 12 is PostMark system performance testing result schematic diagram in the embodiment of the present invention;
Figure 13 is Linux virtual machine performance test result schematic diagram in the embodiment of the present invention;
Figure 14 is the time contrast schematic diagram of transfer of virtual machine image file cost in the embodiment of the present invention;
Figure 15 is the toggle speed contrast schematic diagram of virtual machine when transmitting as required in the embodiment of the present invention.
Embodiment
Clearly understand to make technical scheme of the present invention and advantage, below in conjunction with accompanying drawing, exemplary embodiment of the present invention is described in more detail, obviously, described embodiment is only a part of embodiment of the present invention, instead of all embodiments is exhaustive.
Fig. 1 is the schematic flow sheet of virtual machine image file storage means in the embodiment of the present invention, as shown in Figure 1, can comprise the steps: when virtual machine image file stores
Step 101: image file block image file being divided into fixed length;
Step 102: image file block is stored.
In enforcement, the image file block size of fixed length can be N times of 4KB, and wherein N is natural number.
Concrete, adopt the image file block comminute scheme of fixed length, the master data block size using 4KB or 4KB integral multiple size to preserve on disk as file system as image file block, ensure that the data of all write disks can be alignd according to disk cluster border.Because operating system mirror image and application program mirror image are read-only, once can not revise after write image file, therefore, the scheme of fixed length cutting can ensure higher ratio of compression again.
Due to the size of image file block, will directly have influence on IO performance and the store compressed ratio of system.Therefore need to choose a best data block size parameter, to obtain the balance between IO performance and store compressed ratio.
Fig. 2 is the de-redundancy ratio of compression schematic diagram that in the embodiment of the present invention, under different image file stripping and slicing size, system realizes, as shown in Figure 2, carry out de-redundancy by the virtual machine image file that is 2.31TB to 183 conventional total sizes to obtain, these image files include Windows operating system and the (SuSE) Linux OS of multiple version, application software has comprised computational science software, bioinformatic analysis software, data base management system (DBMS), office system, network service system, the multiple combinations such as Integrated Development Environment, substantially the virtual machine application demand of the overwhelming majority is covered.The disk cluster size of all virtual machine file system storages is all 4KB, and therefore, the de-redundancy image file block being less than 4KB can not bring raising clearly to de-redundancy ratio of compression.When image file block size increases, the de-redundancy ratio of compression of entire system declines rapidly.
Fig. 3 is the IO results of property schematic diagram of system under different image file stripping and slicing size parameter in the embodiment of the present invention, as shown in Figure 3, experimental data is from Liquid, wherein, the virtual machine image file storage means provided in the embodiment of the present invention is applied to after in reality by Liquid, obtain corresponding virtual machine image file storage system, in order to call conveniently, name this device for " Liquid ".Marked Raw data in Fig. 3, is the performance of the image file block storage of this locality being carried out to read-write operation, because the image file block of read-write operates through de-redundancy, can only be not identical image file block, the data that its quantity writes mirror image than reality be few.Marked the data of de-redundancy, be then the result considering de-redundancy ratio of compression and obtain, also namely indicate the index of the actual IO performance that client file systems provides to virtual machine.Less data block will cause more disk random read-write to operate, and therefore will destroy the IO performance of system.Along with the growth of image file block, IO performance promotes gradually, and settles out gradually after image file block size reaches 256KB.
Show based on the experimental result in the embodiment of the present invention and actual use experience, use the image file block size of 256KB to 1MB scope can obtain good system IO performance and de-redundancy ratio of compression, reach balance between the two, the application demand of the overwhelming majority can be met.
In enforcement, the image file block size of fixed length can be 256KB.
In concrete enforcement, in the selection of image file block size, can customize the size of stripping and slicing, the compression that can realize different size stripping and slicing stores, in general larger stripping and slicing scheme means that the multiplicity between each mirror image block is less, ratio of compression is less, and less stripping and slicing scheme is then because the increment of metadata amount result in the decline of system IO performance.Through experimental test, suitable stripping and slicing size is 256KB, can reach the balance of IO performance and store compressed ratio.
Fig. 4 is image file block storage scheme IO the performance test results schematic diagram in the embodiment of the present invention, as shown in Figure 4, adopt the virtual machine image file storage scheme in the embodiment of the present invention and common Ext4 (The fourth extended file system, expansion Journal File System the 4th edition) File system design compares contrast, Intel (R) the Xeon CPU E5-2640 processor of experimental situation to be 32 core dominant frequency be 2GHz, 32GB inner server 1, the virtual machine image file storage system Liquid provided in the invention process is installed, then be the stripping and slicing size of default image file with 256KB, the image file writing 1GB ~ 160GB size respectively carries out readwrite performance test.Test result shows, the storage scheme provided in the optimised embodiment of the present invention, performance is better than the memory property of Ext4 file system, both performance difference in mirror image reading are little, but can obviously see in write performance, Ext4 is along with the expansion gradually of memory image file size in system, in system, metadata scale will significantly increase, its write performance straight line after memory space is greater than 10G is caused to decline, then support relatively stable for the performance of image file write in the storage scheme provided in the embodiment of the present invention, in the extensive growth for image file, its writing speed is all stabilized in more than 40MB/s, reading performance is then stabilized in about 30MB/s, on the whole in the scheme supporting to be better than in the storage of magnanimity image file based on Ext4.
In enforcement, when image file block is stored, can store according to disk cluster boundary alignment.
In concrete enforcement, the image file block being divided into fixed length can be 4KB or 4KB integral multiple size, is being stored on disk and can storing by disk cluster boundary alignment, effectively to utilize disk space.
In enforcement, de-redundancy can be carried out to the image file block stored.
In concrete enforcement, to the image file block de-redundancy stored, can to the elongated stripping and slicing of image file or fixed length stripping and slicing, from effect, the better effects if of elongated stripping and slicing, but realize complicated, calculated amount is also large; Image file block amendment in the embodiment of the present invention is few, and fixed length stripping and slicing is easy to realize, and can realize good compression effectiveness.
In enforcement, MD5 (Message Digest Algorithm MD5, Message Digest Algorithm 5) fingerprint characteristic can be carried out to image file block and calculate, determine the fingerprint characteristic of image file block; According to fingerprint characteristic to the image file block de-redundancy stored; Its fingerprint characteristic is stored while memory image blocks of files.
In concrete enforcement, consider de-redundancy in storage virtual machine image file process, whether need to detect in image file containing the image file block repeated.Md5 encryption algorithm can be adopted to carry out the calculating of image file fingerprint characteristic, for the image file block possessing identical fingerprints feature, be then considered to the image file block of repeated and redundant.For choosing of fingerprint characteristic algorithm, in the embodiment of the present invention, to md5 encryption algorithm and SHA-1 (Secure Hash Algorithm, Secure Hash Algorithm) performance of algorithm carries out test and comparison, the two is applied to the fingerprint characteristic calculating each fixed length image file block, finds out the process that the mirror image block possessing identical data implements de-redundancy storage.In embodiments of the present invention, employ the calculating test that 1 ~ 16 thread is concurrent, calculate the throughput performance difference performance that two kinds of algorithms show under same line number of passes.Fig. 5 is the MD5 algorithm of fingerprint calculating and the Performance comparision schematic diagram of SHA-1 algorithm in the embodiment of the present invention, concrete test and comparison result is as shown in Figure 5: MD5 algorithm is obviously better than SHA-1 algorithm in calculating handling capacity, and in a certain degree lower meeting along with the increase computing velocity advantage of number of threads is more obvious, and SHA-1 algorithm is inadequate for the sensitivity of CPU computational resource, calculates handling capacity under multithreading condition and still maintain lower level.Therefore, MD5 is the more excellent algorithm of one of calculated fingerprint feature.Certainly, except MD5 algorithm, also can adopt and can realize other algorithms of said function.
In concrete enforcement, after the image file completing an application program or operating system stores, when running this image file, the calculating of MD5 fingerprint characteristic carried out to this image file piecemeal, can comprise:
The image file block needing to modify in different virtual machine is stored in first order buffer area, the read-only image file block read recently is stored in second level buffer area;
The calculating of MD5 fingerprint characteristic is carried out to the image file block in the buffer area of the second level.
In concrete enforcement, two-level cache district can be safeguarded in internal memory, the image file block needing to modify in different virtual machine is stored in first order buffer area, here, the each virtual machine client end of the main buffer memory of first order buffer area runs in image file process the image file block needing frequent amendment, that is, first order buffer area can the privately owned buffer memory of called after, and the image file block in first order buffer area does not calculate fingerprint characteristic.Second level buffer area mainly preserves the read-only data block read recently, the image file block in the buffer area of the second level is carried out to the calculating of fingerprint characteristic.Namely, image file block in first order buffer area only has to be brushed in the buffer area of the second level, just need calculated fingerprint feature, adopt two-level cache effectively can reduce the fingerprint characteristic calculated amount of image file block, image file block in first order buffer memory, for different virtual machine amendment, can not, for other virtual machines, therefore not need to calculate its fingerprint characteristic, such process ensure that the image file block for frequent amendment can complete fast, the operational efficiency of great elevator system.
In enforcement, the image file block in the second buffer area can be determined according to LRU (Least Recently Used, recent minimum use algorithm) algorithm.
In concrete enforcement, lru algorithm can be used to carry out cache management, accelerate virtual machine access speed.Lru algorithm, i.e. minimum use page replacement algorithm are virtual page mobile sms service.About the memory management of operating system, how to save utilize capacity little in save as maximum processes resource be provided, be the important directions of research always.And the virtual memory management of internal memory, be now comparatively general mode, be specially: when limited memory, expand a part of external memory as virtual memory, usedly when real internal memory only stores current operation obtain information.This has greatly expanded the function of internal memory undoubtedly, drastically increases the concurrent processing ability of computing machine.Virtual paged memory management, be then that process requisite space is divided into multiple page, only deposit current desired page in internal memory, all the other pages put into the way to manage of external memory.
Virtual paged memory management decreases the memory headroom needed for process, bring this shortcoming elongated working time also: in process operational process, inevitably exchange existing in some information deposited in external memory and internal memory, due to the low speed of external memory, the time that this step spends can not ignore.Thus, by taking outstanding algorithm to reduce the number of times reading external memory, better effect can also be obtained further.
In enforcement, can be store image file merged block after long data block BLK (Block, data block) file.
In enforcement, the position offset corresponding to fingerprint characteristic of the size of BLK file, clear position and image file block can be obtained; According to the position offset corresponding to the fingerprint characteristic of the size of BLK file, clear position and image file block, memory image blocks of files.
In enforcement, bitmap file bitmap can be adopted to record BLK file and to have used and/or untapped position.
In concrete enforcement, Fig. 4 is image file block storage scheme IO the performance test results schematic diagram in the embodiment of the present invention, Fig. 6 is that in the embodiment of the present invention, image file block file stores schematic diagram, by carrying out merging management to magnanimity image file block file, the metadata operation of magnanimity in minimizing system, raising system IO performance, specifically as illustrated in figures 6 and 5, traditional virtual machine image file storage means is placed under the catalogue of specifying using all image file blocks as independent storage file, a large amount of image file block files will be produced like this under this catalogue, the file metadata management that simultaneous is a large amount of, reduce system performance.The principle can using for reference Haystack in the invention process stores to realize virtual machine image file, that is, merged by multiple image file block, existed in the long data block BLK file of.
The upper strata of file system needs to manage the metadata of long data block BLK, comprises the size of BLK file, clear position, the corresponding side-play amount of fingerprint characteristic etc.Here BMP (Bitmap can be adopted, image file format) use in file record BLK file and show with the idle bitmap recorded, IDX (Index, index) deviation post of the corresponding image file block of file record fingerprint characteristic in BLK file, three files, specifically can be as follows all using the first Byte character of fingerprint as its filename prefix:
BMP file: when carrying out the write of new image file block or data are deleted at every turn, need to use BMP file, whether the data space that this file have recorded in BLK file in corresponding side-play amount in the mode of bit position uses, before write image file block, first to check in BMP file idle space, the image file block of deletion then just the bit position of its correspondence be 0.
IDX file: record the content metadata in corresponding BLK file, be mainly used in the deviation post of image file block in BLK file finding fingerprint characteristic corresponding, first the reading of all image file blocks needs to read corresponding deviation post from IDX, and then corresponding deviation post reads image file block from BLK file, for improving the speed that image file block reads, IDX file content can be buffered in internal memory.
BLK file: place the image file blocks of data that fingerprint characteristic is corresponding, BLK is the array of a similar image file set of blocks, each array element length is fixed as the stripping and slicing length of mirror image block, namely, be 4KB or its integral multiple in embodiments of the present invention, for searching of image file block position, the image file block position corresponding by IDX file fingerprint feature is determined.
As shown in Figure 6, based on above-mentioned three files, a large amount of image file block contents can be incorporated in same file.In virtual machine user when writing new mirror image blocks of data, first read-write position BLK_ID can be obtained from BMP file, this BLK_ID is set to 1 by BMP file, then in IDX file, write the mapping of corresponding fingerprint-block to BLK_ID, the deviation post of BLK_ID corresponding in BLK file is supplied to user simultaneously and carries out write operation.When in mirror image block Already in Liquid, only need from IDX file, read corresponding No. BLK_ID, then from BLK file, read related data.
On the basis solving virtual machine image file storage, the embodiment of the present invention relies on image file server merely in existing virtual machine image file distribution, limit the foundation of virtual machine and the problem of travelling speed and robustness, provide a kind of virtual machine image file distribution method, Fig. 7 is the schematic flow sheet that in the embodiment of the present invention, virtual machine image file distribution method is implemented, as shown in Figure 7, the method can comprise the steps:
Step 701: determine the image file block belonging to this client node virtual machine;
Step 702: connect based on P2P agreement and other client nodes;
Step 703: when determining the image file block existed in other client nodes needed for this client node virtual machine, obtains this image file block from other client nodes, otherwise the image file block needed for obtaining from data server; Or, when determining to there is the image file block needed for other client node virtual machines in this client node virtual machine, this image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by image file block.
Wherein, step 701 and step 702 do not have strict timing requirements, and it will be understood by those skilled in the art that step 702 both can perform after step 701, also can carry out before step 701, the execution sequence of the present invention to above-mentioned steps is not restricted.
In concrete enforcement, Fig. 8 is the application scenarios schematic diagram of virtual machine image file distribution method in the embodiment of the present invention, as shown in Figure 8, based on the Data dissemination pattern of P2P in the embodiment of the present invention, data transfer loads on mirror image server is transferred on client node, image file server nodes all in system and client node can provide node as image file block, realize the distribution of information by exchanging the data block fingerprint set stored mutually, in enforcement, node load relevant information can be sent to connected node by heartbeat packet by each node (comprising image file server node and client node), with the load distribution in balanced system, effectively evade the appearance of network hotspot, avoid the appearance of bottleneck in system.
In concrete enforcement, client node preferentially can obtain image file block from connected client node, when only having the fingerprint characteristic when the image file block not comprising needs in all connected client nodes is corresponding, client node just can initiate read requests in image file server, to obtain required image file block, effectively the data transfer loads of image file server is transferred on client node, balance the load of data transmission, avoid the appearance of network hotspot.
In enforcement, can further the image file block obtained from other clients or data server be left in buffer area.
In enforcement, the image file block obtained from other clients or data server is left in buffer area, can by determining the image file block in buffer area according to recent minimum use algorithm LRU.
In concrete enforcement, lru algorithm can be used to carry out cache management, accelerate virtual machine access speed.Lru algorithm, i.e. minimum use page replacement algorithm are virtual page mobile sms service.About the memory management of operating system, how to save utilize capacity little in save as maximum processes resource be provided, be the important directions of research always.And the virtual memory management of internal memory, be now comparatively general mode, be specially: when limited memory, expand a part of external memory as virtual memory, usedly when real internal memory only stores current operation obtain information.This has greatly expanded the function of internal memory undoubtedly, drastically increases the concurrent processing ability of computing machine.Virtual paged memory management, be then that process requisite space is divided into multiple page, only deposit current desired page in internal memory, all the other pages put into the way to manage of external memory.
Virtual paged memory management decreases the memory headroom needed for process, bring this shortcoming elongated working time also: in process operational process, inevitably exchange existing in some information deposited in external memory and internal memory, due to the low speed of external memory, the time that this step spends can not ignore.Thus, by taking outstanding algorithm to reduce the number of times reading external memory, better effect can also be obtained further.
In enforcement, the MD5 fingerprint characteristic of image file block can be calculated; The image file block whether existed in other client nodes needed for this client node virtual machine is determined according to fingerprint characteristic, or, determine in this client node virtual machine, whether to there is the image file block needed for other client node virtual machines according to fingerprint characteristic.
In concrete enforcement, after the image file being obtained an application program or operating system by virtual machine image file distribution method, when running this image file, the calculating of MD5 fingerprint characteristic is carried out to this image file piecemeal, can comprise:
The image file block needing to modify in different virtual machine is stored in first order buffer area, the read-only image file block read recently is stored in second level buffer area;
The calculating of MD5 fingerprint characteristic is carried out to the image file block in the buffer area of the second level.
In concrete enforcement, two-level cache district can be safeguarded in internal memory, the image file block needing to modify in different virtual machine is stored in first order buffer area, here, the each virtual machine client end of the main buffer memory of first order buffer area runs in image file process the image file block needing frequent amendment, that is, first order buffer area can the privately owned buffer memory of called after, and the image file block in first order buffer area does not calculate fingerprint characteristic.Second level buffer area mainly preserves the read-only data block read recently, the image file block in the buffer area of the second level is carried out to the calculating of fingerprint characteristic.Namely, image file block in first order buffer area only has to be brushed in the buffer area of the second level, just need calculated fingerprint feature, adopt two-level cache effectively can reduce the fingerprint characteristic calculated amount of image file block, image file block in first order buffer memory, for different virtual machine amendment, can not, for other virtual machines, therefore not need to calculate its fingerprint characteristic, such process ensure that the image file block for frequent amendment can complete fast, the operational efficiency of great elevator system.
In enforcement, the image file block in the second buffer area can be determined according to lru algorithm.
In enforcement, determine the image file block whether existed in other client nodes needed for this client node virtual machine according to fingerprint characteristic, can comprise: send the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes; Fingerprint characteristic set is used for supplying other client nodes to determine whether there is the image file block needed for this client node virtual machine according to this fingerprint characteristic set; Or, determine whether there is the image file block needed for other client node virtual machines in this client node virtual machine, comprising according to fingerprint characteristic: receive this image file block fingerprint characteristic set needed for client node virtual machine that other client nodes send; The image file block needed for this client node virtual machine is determined whether there is according to fingerprint characteristic set.
In concrete enforcement, in system, each client node can inquire about the position of other nodes to metadata server node, and maintain the connection with these client nodes, and that understands the cycle obtains up-to-date image file block fingerprint characteristic set to these client nodes, ensures that its maintain customer end node information is enough accurate.When need to obtain there is image file block corresponding to certain fingerprint characteristic time, what client node was first random chooses other client nodes several, detect the fingerprint characteristic that the image file block that whether contains needs in these connected client nodes is corresponding, if have found the fingerprint characteristic that the image file block of needs is corresponding, then obtain this image file block from this client node.
The algorithm of Peer back end is found in P2P image file distribution protocol, as follows:
Above-mentioned code implication is:
Find in the algorithm of Peer back end, based on the fingerprint characteristic of the image file block that will read of input, if find the fingerprint characteristic of this image file block in Peer back end, the image file block finding this fingerprint characteristic corresponding also reads, otherwise, the image file block not existing in this Peer back end and will read is described.
When searching client node, inquire about with random order, such way can avoid the appearance of focus in system effectively, ensures that the load of each client node is spread out fifty-fifty.
In enforcement, the set of image file block fingerprint characteristic can adopt Bloom Filter data structure to compress process before transmission.
In concrete enforcement, Bloom filter is the binary vector data structure proposed in 1970 by Howard Bloom, it has good room and time efficiency, can be used for detection element whether gather in a member, this detection only can to the data misjudgement in set, and can not to be not set in data misjudge, each like this detection request has returned " in set (possible errors) " and " not in set (absolutely not in set) " two kinds of situations, visible Bloom filter sacrifices accuracy to exchange Time and place for.If needs judgement element is in a set, usual way is that all elements is preserved, then know that it is in set by comparing, chained list, tree are all based on this thinking, when the change of set interior element number is large, the room and time needed all linearly becomes greatly, and retrieval rate is also more and more slower.What Bloom filter adopted is the method for hash function, and by an element map to a point on the array of a m length, when this point is 1, so this element is in set, otherwise then not in set.The shortcoming of this method is exactly may have conflict when the element detected is a lot of time, and solution uses corresponding k the point of k hash function exactly, if institute is a little all 1, so element is in set, if having 0, element is not then in set.
A Bloom Filter has following parameter:
The width (bit number) of m:bit array;
N: the quantity adding key wherein;
K: the number of the hash function of use;
The ratio of f:False Positive;
The f of Bloom Filter meets following formula:
( 1 - ( 1 - 1 m ) kn ) k ≈ ( 1 - e - kn / m ) k
When given m and n, the minimized k value of f can be made to be:
m n ln 2 ≈ 9 m 13 n ≈ 0.7 m n
The f now provided is:
According to above formula, for any given f, have:
n=m?ln(0.6185)/ln(f)
Meanwhile, need k hash to reach this target:
k=-ln(f)/ln(2)
Due to the necessary round numbers of k, in the program of Bloom Filter realizes, also formula above should be used try to achieve actual f:
f=(1-e -kn/m) k
Above 3 formula are key equation that program realizes Bloom Filter.
The fingerprint set of transmission carries out compression process by the data structure of Bloom Filter, and each Bloom Filter is a Bit array, uses m binary digit to represent a set with n fingerprint.When new interpolation in a fingerprint to Bloom Filter, the position that k hash function obtains in k Bit array will be used, then the data bit on these positions is all set to 1, to represent that a new fingerprint adds.When whether detection fingerprint belongs to a Bloom Filter, a same use k hash function finds k position in bit array, whether the data detected on these positions are all 1, when and if only if all positions are all 1, prove that fingerprint to be detected belongs in Bloom Filter.
In system, each client node can find the position of other client nodes to metadata server node, and maintain the connection with these client nodes, and that understands the cycle obtains up-to-date Boom Filter array to these client nodes, ensures that these client node information that it is safeguarded are enough accurate.When this client node need to obtain there is image file block corresponding to certain fingerprint characteristic time, what this client node was first random chooses several client node, detect the fingerprint characteristic whether containing the image file block of needs in the Boom Filter array of these client nodes, if find the fingerprint characteristic of the image file block of needs in one or several in these client nodes, this client node preferentially can obtain mirror image blocks of data from these client nodes, only have when all client nodes do not comprise the finger print data needing image file block, client node just can initiate read requests in image file server, mirror image block content required for acquisition.Utilize the P2P Data dissemination pattern of this optimal design, can effectively the data transfer loads on mirror image server be transferred in client, the load distribution in balanced system, avoid the appearance of network hotspot, effectively avoid the appearance of bottleneck in system.
In enforcement, can with compression speed higher than the compression algorithm compressional mirror of network bandwidth speed as blocks of files.Further, compression algorithm can be Google Snappy compression algorithm.
In concrete enforcement, because image file needs to be transmitted by network.In order to reduce the consumption of the network bandwidth as much as possible, and the speed of Internet Transmission being risen to maximal value, simply can compress process to the image file block of transmission in the embodiment of the present invention, reducing the size of each packet.The compression algorithm of image file block must have speed faster, is at least higher than the network bandwidth, to avoid itself becoming bottleneck.Too many CPU computational resource can not be taken in addition, with the operation so as not to affecting virtual machine.By comparing some conventional ripe compression algorithms, such as, the Snappy compression function storehouse of Google is compressed image file block.The main target of this function library guarantees compression speed faster, instead of in order to obtain higher compression ratio.Snappy compression algorithm can obtain rational compression ratio, very suitable for compression network packet.Test result demonstrates the superiority that Snappy data compression algorithm compares gzip, bzip2 two kinds of data compression algorithms, and concrete test result is as follows:
Adopt Google Snappy algorithm to be because this method comparison is conventional, main flow, be easy to those skilled in the art and use/understand, so here for Google Snappy algorithm; But, in theory, also be fine with other algorithm, as long as the object of Fast Compression can be realized, how Google Snappy algorithm only specifically implements the present invention as a preferred embodiment for instructing those skilled in the art, but do not mean and only can use Google Snappy algorithm, can in conjunction with putting into practice needs to determine corresponding algorithm in implementation process.
The quick clone of image file eliminates the new image file of copy required time of waiting for and IO expense, reduces the time of required cost when user creates new virtual machine greatly; In cloud computing platform, creating the best practice of a new virtual machine is exactly go out a new virtual machine image file from pre-configured image file template duplicating, all re-start the installation of operating system and application program when can remove each newly-built virtual machine like this from, avoid the time of overspending.The virtual machine image file size of the overwhelming majority has a few GB, and the image file of the such size of byte-by-byte assignment needs the time expending several minutes, and along with needing the increase of the virtual machine quantity created, the T.T. of required cost also can linearly increase.In order to effectively create new virtual machine image file, Liquid provides the fast replicate functions of image file, just can create new virtual machine image file within the very short time.
For Liquid, an image file in fact metadata saving all image file block fingerprint characteristics shows.The operation copying image file can be replaced by replication meta completely, only needs to adjust the reference count of image file block extraly.Storage due to Liquid bottom is that relevance stores (Content Addressable Storage), support the operation of Copy on write, therefore the content of template image file can't be had influence on to clone's image file amendment out, also impact can not be brought to the image file of follow-up clone.The metadata of virtual machine image file is mainly made up of fingerprint metadata, and its data scale is much smaller for image file.When using 256KB image file block size, the metadata of the image file of a 10GB only has 640KB, and its replicate run can complete in millisecond rank.Relative to the byte-by-byte scheme copying image file content, the time creating new virtual machine image file can shorten by echo cloning function that Liquid provides greatly, accelerates the speed creating new virtual machine image.
Finally, image file can be transmitted as required by network, can taper to minimum by the image file content of Internet Transmission, can effectively reduce offered load.Liquid supports the technology utilizing Copy on write (Copy-on-Write), copies to existing customer end node by an image file block from other client nodes, then downloads the image file block of needs in real time according to the access of virtual machine.This makes client node when image file is not also transferred to local storage, just can start virtual machine, the time of image file to be transmitted such as can to remove from, thus significantly shortens the time that virtual machine activation spends.
In addition, owing to needing the part of access when being only limitted to by the data of Internet Transmission start, a less value is limited in by the data volume of Internet Transmission.This compares and downloads the way that complete image file restarts virtual machine, namely saves the stand-by period, reduces again the expense of Internet Transmission, have great advantage.
Based on the same inventive concept of method that virtual machine image file stores, in the embodiment of the present invention, additionally provide a kind of virtual machine image file memory storage.The principle of dealing with problems due to these equipment is similar to a kind of virtual machine image file storage means, and therefore the enforcement of these equipment see the enforcement of method, can repeat part and repeat no more.
Fig. 9 is virtual machine image file memory storage schematic diagram in the embodiment of the present invention, and as shown in Figure 9, virtual machine image file memory storage can comprise:
Cutting unit 901, for being divided into the image file block of fixed length by image file;
Storage unit 902, for storing image file block.
In enforcement, cutting unit can be further used for the image file block doubly image file being divided into fixed length by the N of 4KB, and wherein N is natural number.
In enforcement, cutting unit, can be further used for fixed length image file block image file being divided into 256KB size.
In enforcement, storage unit, can be further used for the mode memory image blocks of files according to disk cluster boundary alignment.
In enforcement, storage unit, the image file block that can be further used for storing carries out de-redundancy.
In enforcement, may further include:
Fingerprint characteristic unit, for carrying out the calculating of MD5 fingerprint characteristic to image file block, determines the fingerprint characteristic of image file block;
Storage unit can be further used for according to fingerprint characteristic to the image file block de-redundancy stored, and stores its fingerprint characteristic while memory image blocks of files.
In enforcement, fingerprint characteristic unit is used for after the storage completing an application program or operating system image file, when running image file, can comprise:
Buffer memory subelement, for the image file needing to modify in different virtual machine block is stored in first order buffer area, is stored in second level buffer area by the read-only image file block read recently;
Fingerprint characteristic subelement, for carrying out the calculating of MD5 fingerprint characteristic to the image file block in the buffer area of the second level;
Determine subelement, for the fingerprint characteristic of the fingerprint characteristic determination image file block according to fingerprint characteristic subunit computes.
In enforcement, buffer memory subelement, can be further used for the image file block determined according to recent minimum use algorithm LRU in the second buffer area.
In enforcement, storage unit, can be further used for being store image file merged block after long data block BLK file.
In enforcement, storage unit, can be further used for the position offset corresponding to fingerprint characteristic of the size according to BLK file, clear position and image file block, memory image blocks of files.
In enforcement, storage unit, can be further used for adopting bitmap file bitmap to record BLK file and use and/or untapped position.
At the virtual machine image file memory storage that the embodiment of the present invention provides, store by being divided into the image file block of fixed length to virtual machine image file, due to by being divided into block to image file fixed length, ensure that higher ratio of compression, so, effectively can save the storage space of virtual machine image file.
Based on the same inventive concept of virtual machine image file distribution method, in the embodiment of the present invention, additionally provide a kind of virtual machine image file dispensing device.The principle of dealing with problems due to these equipment is similar to a kind of virtual machine image file distribution method, and therefore the enforcement of these equipment see the enforcement of method, can repeat part and repeat no more.
Figure 10 is virtual machine image file dispensing device schematic diagram in the embodiment of the present invention, and as shown in Figure 10, virtual machine image file dispensing device can comprise:
Determining unit 1001, for determining the image file block belonging to this client node virtual machine;
Linkage unit 1002, for connecting based on Peer-to-Peer Network P2P agreement and other client nodes;
Dispatching Unit 1003, for when determining the image file block existed in other client nodes needed for this client node virtual machine, obtains described image file block, otherwise obtains described image file block from data server from other client nodes; Or, when determining to there is the image file block needed for other client node virtual machines in this client node virtual machine, described image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by described image file block.
In enforcement, this virtual machine image file dispensing device, may further include buffer unit, for being left in buffer area by the image file block obtained from other clients or data server.
In enforcement, buffer unit, is further used for the image file block determined according to recent minimum use algorithm LRU in buffer area.
In enforcement, this virtual machine image file dispensing device, may further include fingerprint characteristic computing unit, may be used for the MD5 fingerprint characteristic calculating image file block;
Dispatching Unit, can be further used for determining according to fingerprint characteristic the image file block that whether exists in other client nodes needed for this client node virtual machine, or, determine in this client node virtual machine, whether to there is the image file block needed for other client node virtual machines according to fingerprint characteristic.
In enforcement, Dispatching Unit, can be further used for when determining the image file block whether existed in other client nodes needed for this client node virtual machine according to fingerprint characteristic, send the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes; This fingerprint characteristic set is used for supplying other client nodes to determine whether there is the image file block needed for this client node virtual machine according to this fingerprint characteristic set; Or, when determining whether there is the image file block needed for other client node virtual machines in this client node virtual machine according to this fingerprint characteristic, receive this image file block fingerprint characteristic set needed for client node virtual machine that other client nodes send; The image file block needed for this client node virtual machine is determined whether there is according to this fingerprint characteristic set.
In enforcement, this Dispatching Unit, can be further used for before send the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes, Bloom Filter data structure compression process is carried out to the set of described image file block fingerprint characteristic.
In enforcement, Dispatching Unit, can be further used for compression speed higher than the compression algorithm compressional mirror of network bandwidth speed as blocks of files.
In enforcement, Dispatching Unit, can be further used for adopting Google Snappy compression algorithm compressional mirror as blocks of files.
The virtual machine image file dispensing device provided in the embodiment of the present invention, because adopt P2P agreement to carry out the quick clone of image file between virtual machine client end, the principle of work of distribution, all image file server and client node all be can be used as the supplier of image file block, the mutual image file block exchanging storage, effectively the data transfer loads of image file server is transferred on client node, balance the load of data transmission, avoid the appearance of network hotspot, effectively shorten time and the IO expense of the required wait of copy image file, improve efficiency and the speed of virtual machine image file distribution.
Be described with example below, in this example, have employed the virtual machine image file storage scheme provided in the embodiment of the present invention, and virtual machine image file distribution approach.
Figure 11 is Bonnie++ system performance testing result schematic diagram in the embodiment of the present invention, Figure 12 is PostMark system performance testing result schematic diagram in the embodiment of the present invention, Figure 13 is Linux virtual machine performance test result schematic diagram in the embodiment of the present invention, as shown in Figure 11 to Figure 13, in order to the performance of more different mirrored storage systems, and reflect the performance of Liquid mirrored storage system more practically, the embodiment of the present invention utilizes virtual machine to carry out performance test experiments to them, and experimental situation is deployed in Tsing-Hua University virtual computing platforms Nova system.
First, test is needed to be the IO performance comparing virtual machine.Experiment uses these two IO performance testing tool of Bonnie++ and PostMark, compares the Raw form be stored in local file system, Qcow2 form, and is stored in the IO performance of the Raw mirror-image format file in Liquid.In this experiment, Liquid employs the mirror image block size of 16KB to 2MB.All virtual machine image are all the files of the 50GB that newly creates, and use ext4 file system.Virtual machine employs internal memory and 1 vCPU of 2GB, and the operating system environment of operation is Ubuntu 10.10 and Linux Kernel 2.6.35.
Shown in the result figure referring to Figure 11 and Figure 12, can be found out by test result, the Native IO of the local file system in physical machine has best performance.This is used to the benchmark of the image file storage solution to other.The image file of Raw form has best readwrite performance, because its form is simple, can not bring too much performance cost.For the image file of Qcow2 form, and be stored in the image file in Liquid system, because write operation can need the distribution relating to new data block continually, its write performance receives obvious impact.Although but Liquid also will provide the support of de-redundancy when writing data, its IO speed is slightly faster than Qcow2, because its inside employs outstanding caching mechanism, to guarantee that write operation can carry out effectively.Compare write operation, the impact that the speed of digital independent is subject to is then so unobvious, because the data in fact read also can be carried out buffer memory by operating system.A large young pathbreaker of rational data block can use buffer memory more effectively, and larger data block can cause lower cache hit rate, and less data block then can bring extra performance cost because need to carry out random I/O operation continually.
As shown in figure 13, to the test set of virtual machine activation speed, secondly putting up the best performance of Raw mirror-image format be the image file of Qcow2 form.The toggle speed of the virtual machine image file stored in Liquid is slow a little, and the data block that ready storage is commonly used well because buffer memory can also be able to do in time is to provide IO to accelerate.Less image file block can extend start-up time, because can need to perform more random I/O operation in the stage of virtual machine activation.In the decompress(ion) of Linux source code and the test of compilation operations, the performance of Liquid is better than Qcow2 form.This is because the caching mechanism in Liquid ensure that the image file block of frequent access is recently buffered in internal memory, to guarantee good IO performance.These two tests can produce a large amount of small documents, for a large amount of image file blocks, these image file blocks are not directly written to disk by Liquid, but it are temporarily placed in the buffer, so that follow-up need to write same image file block time, can carry out rapidly.When the cache is filled, Liquid can concentrate, be written in disk storage by image file in bulk, and this is better than scattered small block data IO performance.
Figure 14 is the time contrast schematic diagram of transfer of virtual machine image file cost in the embodiment of the present invention, as shown in figure 14, in order to the speed of the virtual machine image file distribution method provided in the embodiment of the present invention is described, the image file of a 8GB is transferred to the time spent required for 7 other client nodes from 1 client node.Be the image file of the Ubuntu 10.10 that is newly installed for what test, use the data block size of 256KB.From test result, in these tests, directly use scp instrument (Secure Copy, safe copy) transmit image file and need to spend maximum time, because image file source node itself becomes a focus in system, the bandwidth of its Internet Transmission has been saturated, and the encryption of scp instrument itself, decipherment algorithm also bring no small performance loss.NFS stores and also faces similar problem, but the optimization owing to itself realizing, performance is more better than scp.BitTorrent agreement is shared equally to all nodes by load data transmitted, and avoids image file source node and become a bottleneck, and its performance is better than scp instrument far away and NFS stores.But BitTorrent agreement itself does not consider the redundant data in mirror image, and the data therefore repeated still still are transmitted by network.Liquid uses the transmission mode of P2P equally, but take into account the existence of redundant data block, avoids the data repeated by Internet Transmission, therefore also achieves better performance than BitTorrent.
The performance transmitting (On-demand Fetching) is as required then undertaken weighing by the speed of startup virtual machine.As shown in figure 15, the way of virtual machine is restarted compared to the complete image file of traditional download, as required transmission can image file also do not download complete in just start virtual machine, the way of the mirror image data block needed by real-time Transmission meets the IO demand of virtual machine.Can see in an experiment, it is longer than traditional way to transmit required start-up time as required, this is because when lacking image file block at every turn, all need to carry out a RPC (Remote Procedure Call Protocol in real time, remote procedure call protocol), download corresponding image file block.This compares local IO, can bring longer time delay.When image file block diminishes time, the number of times lacking data block that local disk occurs can increase, and therefore also just needs more network, and then causes start-up time of more growing.Even if but there is such time overhead, the overall time of virtual machine activation has been shortened, and therefore this is actually the toggle speed accelerating virtual machine.In addition, the embodiment of the present invention has also carried out the toggle speed test of virtual machine, the other system performance tests such as the decompression of linux kernel source code and compiling.This cover test set had both included the test of computation-intensive (CPU-Intensive), also included the test of IO intensive (IO-Intensive), effectively can represent common Virtual Machine Worker load.In this test, the linux kernel source code of use is 3.0.4.
For convenience of description, each several part of above device is divided into various module or unit to describe respectively with function.Certainly, the function of each module or unit can be realized in same or multiple software or hardware when implementing of the present invention.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (34)

1. a virtual machine image file storage means, is characterized in that, comprises the steps:
Image file is divided into the image file block of fixed length;
Image file block is stored.
2. the method for claim 1, is characterized in that, the image file block size of fixed length is N times of 4KB, and wherein N is natural number.
3. method as claimed in claim 2, it is characterized in that, the image file block size of fixed length is 256KB.
4. the method as described in as arbitrary in claims 1 to 3, is characterized in that, when storing image file block, store according to disk cluster boundary alignment.
5. the method for claim 1, is characterized in that, comprises further:
De-redundancy is carried out to the image file block stored.
6. method as claimed in claim 5, is characterized in that, comprise further:
Carry out Message Digest Algorithm 5 MD5 fingerprint characteristic to image file block to calculate, determine the fingerprint characteristic of image file block;
According to fingerprint characteristic to the image file block de-redundancy stored;
Its fingerprint characteristic is stored while memory image blocks of files.
7. the method for claim 1, is characterized in that, is to store image file merged block after long data block BLK file.
8. method as claimed in claim 7, is characterized in that, comprising:
Obtain the position offset corresponding to fingerprint characteristic of the size of BLK file, clear position and image file block;
According to the position offset corresponding to the fingerprint characteristic of the size of BLK file, clear position and image file block, memory image blocks of files.
9. method as claimed in claim 8, is characterized in that, comprising:
Adopt bitmap file bitmap to record BLK file to have used and/or untapped position.
10. a virtual machine image file distribution method, is characterized in that, comprises the steps:
Determine the image file block belonging to this client node virtual machine;
Connect based on Peer-to-Peer Network P2P agreement and other client nodes;
When determining the image file block existed in other client nodes needed for this client node virtual machine, from other client nodes, obtain described image file block, otherwise the image file block needed for obtaining from data server; Or, determine to exist in this client node virtual machine needed for other client node virtual machines image file block time, described image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by described image file block.
11. methods as claimed in claim 10, is characterized in that, comprise further: left in buffer area by the image file block obtained from other clients or data server.
12. methods as claimed in claim 11, is characterized in that, leave the image file block obtained from other clients or data server in buffer area and comprise: determine the image file block in buffer area according to recent minimum use algorithm LRU.
13. methods as claimed in claim 10, is characterized in that, comprise further:
Calculate the MD5 fingerprint characteristic of image file block;
The image file block whether existed in other client nodes needed for this client node virtual machine is determined according to fingerprint characteristic, or, according to fingerprint characteristic determine whether to exist in this client node virtual machine needed for other client node virtual machines image file block.
14. methods as claimed in claim 13, it is characterized in that, determine the image file block whether existed in other client nodes needed for this client node virtual machine according to fingerprint characteristic, comprising: send the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes; Fingerprint characteristic set is used for supplying other client nodes to determine whether there is the image file block needed for this client node virtual machine according to this fingerprint characteristic set;
Or, according to fingerprint characteristic determine whether to exist in this client node virtual machine needed for other client node virtual machines image file block, comprising: this image file block fingerprint characteristic set needed for client node virtual machine receiving that other client nodes send; The image file block needed for this client node virtual machine is determined whether there is according to fingerprint characteristic set.
15. methods as claimed in claim 14, is characterized in that, comprise further: the set of image file block fingerprint characteristic adopts Bloom Filter data structure to compress process before transmission.
16. methods as claimed in claim 10, is characterized in that, comprise further:
Described image file block is compressed higher than the compression algorithm of network bandwidth speed with compression speed.
17. will go the method as described in 16 as right, it is characterized in that, comprising:
Described compression algorithm is Google Snappy compression algorithm.
18. 1 kinds of virtual machine image file memory storages, is characterized in that, comprising:
Cutting unit, for being divided into the image file block of fixed length by image file;
Storage unit, for storing image file block.
19. devices as claimed in claim 18, is characterized in that, cutting unit is further used for the image file block doubly image file being divided into fixed length by the N of 4KB, and wherein N is natural number.
20. devices as claimed in claim 19, is characterized in that, cutting unit is further used for fixed length image file block image file being divided into 256KB size.
21. as arbitrary in claim 18 to 20 as described in device, it is characterized in that, storage unit is further used for the mode memory image blocks of files according to disk cluster boundary alignment.
22. devices as claimed in claim 18, is characterized in that, the image file block that storage unit is further used for storing carries out de-redundancy.
23. devices as claimed in claim 22, is characterized in that, comprise further:
Fingerprint characteristic unit, for carrying out the calculating of MD5 fingerprint characteristic to image file block, determines the fingerprint characteristic of image file block;
Storage unit is further used for according to fingerprint characteristic to the image file block de-redundancy stored, and stores its fingerprint characteristic while memory image blocks of files.
24. devices as claimed in claim 18, is characterized in that, storage unit is further used for being store image file merged block after long data block BLK file.
25. devices as claimed in claim 24, is characterized in that, storage unit is further used for the position offset corresponding to fingerprint characteristic of size, clear position and image file block according to BLK file, memory image blocks of files.
26. devices as claimed in claim 25, is characterized in that, storage unit is further used for adopting bitmap file bitmap to record BLK file and has used and/or untapped position.
27. 1 kinds of virtual machine image file dispensing devices, is characterized in that, comprising:
Determining unit, for determining the image file block belonging to this client node virtual machine;
Linkage unit, for connecting based on Peer-to-Peer Network P2P agreement and other client nodes;
Dispatching Unit, for when determining the image file block existed in other client nodes needed for this client node virtual machine, obtains described image file block, otherwise obtains described image file block from data server from other client nodes; Or, when determining to there is the image file block needed for other client node virtual machines in this client node virtual machine, described image file block is sent to other client nodes, and wherein, virtual machine image file obtains by after fixed length segmentation by described image file block.
28. devices as claimed in claim 27, is characterized in that, comprise further: buffer unit, for being left in buffer area by the image file block obtained from other clients or data server.
29. devices as claimed in claim 28, is characterized in that, buffer unit, are further used for the image file block determined according to recent minimum use algorithm LRU in buffer area.
30. devices as claimed in claim 27, is characterized in that, comprise further:
Fingerprint characteristic computing unit, for calculating the MD5 fingerprint characteristic of described image file block;
Dispatching Unit is further used for determining according to fingerprint characteristic the image file block that whether exists in other client nodes needed for this client node virtual machine, or, according to fingerprint characteristic determine whether to exist in this client node virtual machine needed for other client node virtual machines image file block.
31. devices as claimed in claim 30, it is characterized in that, Dispatching Unit is further used for when determining the image file block whether existed in other client nodes needed for this client node virtual machine according to fingerprint characteristic, sends the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes; Fingerprint characteristic set is used for supplying other client nodes to determine whether there is the image file block needed for this client node virtual machine according to this fingerprint characteristic set; Or, determine according to fingerprint characteristic whether to exist in this client node virtual machine needed for other client node virtual machines image file block time, this image file block fingerprint characteristic set needed for client node virtual machine receiving that other client nodes send; The image file block needed for this client node virtual machine is determined whether there is according to fingerprint characteristic set.
32. devices as claimed in claim 31, it is characterized in that, Dispatching Unit is further used for before send the image file block fingerprint characteristic set needed for this client node virtual machine to other client nodes, carries out Bloom Filter data structure compression process to the set of described image file block fingerprint characteristic.
33. devices as claimed in claim 27, is characterized in that, Dispatching Unit is further used for compressing described image file block with compression speed higher than the compression algorithm of network bandwidth speed.
34. devices as claimed in claim 33, is characterized in that, Dispatching Unit is further used for adopting Google Snappy compression algorithm to compress described image file block.
CN201410524284.4A 2014-10-08 2014-10-08 Virtual machine mirror image file storage and distribution method and device Pending CN104239575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410524284.4A CN104239575A (en) 2014-10-08 2014-10-08 Virtual machine mirror image file storage and distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410524284.4A CN104239575A (en) 2014-10-08 2014-10-08 Virtual machine mirror image file storage and distribution method and device

Publications (1)

Publication Number Publication Date
CN104239575A true CN104239575A (en) 2014-12-24

Family

ID=52227634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410524284.4A Pending CN104239575A (en) 2014-10-08 2014-10-08 Virtual machine mirror image file storage and distribution method and device

Country Status (1)

Country Link
CN (1) CN104239575A (en)

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780048A (en) * 2015-04-13 2015-07-15 中国电子科技集团公司第二十八研究所 Lightweight mirror image file encryption system and method
CN104902000A (en) * 2015-04-03 2015-09-09 易云捷讯科技(北京)有限公司 Method for using p2p technology to fast transmit virtual machine template
CN105468306A (en) * 2016-01-06 2016-04-06 浪潮(北京)电子信息产业有限公司 Disk mirroring processing method and device
CN106095331A (en) * 2016-05-31 2016-11-09 浙江科澜信息技术有限公司 A kind of control method fixing big file internal resource
CN106155758A (en) * 2015-03-24 2016-11-23 联想(北京)有限公司 A kind of server system and corresponding control methods thereof
CN106202337A (en) * 2016-07-04 2016-12-07 华中师范大学 A kind of PPT sharing method and realize teacher side and the student side of the method
CN107301063A (en) * 2017-05-10 2017-10-27 北京奇艺世纪科技有限公司 A kind of mirror image management method and device
CN107479942A (en) * 2016-06-08 2017-12-15 深圳市深信服电子科技有限公司 The client operating system of virtual machine starts method and device
CN108139868A (en) * 2015-09-17 2018-06-08 华睿泰科技有限责任公司 For the system and method for image segment frequently used from cache supply
CN108170455A (en) * 2018-03-12 2018-06-15 晶晨半导体(上海)股份有限公司 The packaging method and upgrade method of upgrade package
CN108694086A (en) * 2017-03-31 2018-10-23 英特尔公司 Technology for the service guarantee for using and executing the associated fingerprint of virtualization applications
CN109344121A (en) * 2018-09-27 2019-02-15 郑州云海信息技术有限公司 A kind for the treatment of method and apparatus of image file
CN109522028A (en) * 2018-11-15 2019-03-26 郑州云海信息技术有限公司 A kind of installation method and system of operating system
CN109683916A (en) * 2018-12-03 2019-04-26 武汉钢铁工程技术集团通信有限责任公司 A kind of method of cloud mirrored host computer of the autonomous creation comprising application software
CN109725980A (en) * 2017-10-27 2019-05-07 伊姆西Ip控股有限责任公司 Generate method, equipment and the computer-readable medium of mirror image label
CN110018878A (en) * 2018-01-09 2019-07-16 阿里巴巴集团控股有限公司 A kind of distributed system data load method and device
CN110019013A (en) * 2017-12-08 2019-07-16 中国电信股份有限公司 Mirrored storage method, apparatus and computer readable storage medium
CN110086847A (en) * 2019-03-12 2019-08-02 中国科学院计算技术研究所 Data distributing method, medium and electronic equipment
CN110287064A (en) * 2019-07-02 2019-09-27 成都易我科技开发有限责任公司 A kind of restoring method of data in magnetic disk, device and electronic equipment
CN110336883A (en) * 2019-07-09 2019-10-15 深信服科技股份有限公司 Mirror image data transmission method, device, equipment and computer readable storage medium
CN110399099A (en) * 2019-06-28 2019-11-01 苏州浪潮智能科技有限公司 Data mover system and method
CN110740192A (en) * 2019-10-29 2020-01-31 西安雷风电子科技有限公司 mirror image distribution method and system in P2P network-based virtualization environment
CN112235427A (en) * 2020-12-14 2021-01-15 广东睿江云计算股份有限公司 Merging method and system for mirror image files
CN112433810A (en) * 2020-11-05 2021-03-02 北京浪潮数据技术有限公司 Docker container mirror image storage and pulling method and device and computer readable storage medium
CN113176886A (en) * 2021-04-29 2021-07-27 中国工商银行股份有限公司 Mirror image file compression operation method and device
WO2021155857A1 (en) * 2020-02-07 2021-08-12 Huawei Technologies Co., Ltd. Fast file snapshots and clones
CN114969731A (en) * 2022-03-28 2022-08-30 慧之安信息技术股份有限公司 Malicious software detection method and device based on operating system
WO2023036310A1 (en) * 2021-09-10 2023-03-16 中兴通讯股份有限公司 File downloading method, electronic device and computer-readable storage medium
CN116909752A (en) * 2023-09-11 2023-10-20 京东科技信息技术有限公司 Page mirror image storage method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788976A (en) * 2010-02-10 2010-07-28 北京播思软件技术有限公司 File splitting method based on contents
CN102033924A (en) * 2010-12-08 2011-04-27 浪潮(北京)电子信息产业有限公司 Data storage method and system
CN102301347A (en) * 2009-03-04 2011-12-28 日本电气株式会社 Storage system
CN102456059A (en) * 2010-10-21 2012-05-16 英业达股份有限公司 Data deduplication processing system
CN102469142A (en) * 2010-11-16 2012-05-23 英业达股份有限公司 Data transmission method for data deduplication program
CN102801757A (en) * 2011-05-25 2012-11-28 英业达股份有限公司 Processing method and system for data de-duplication of point-to-point transmission
CN102799598A (en) * 2011-05-25 2012-11-28 英业达股份有限公司 Data recovery method for deleting repeated data
CN102833298A (en) * 2011-06-17 2012-12-19 英业达集团(天津)电子技术有限公司 Distributed repeated data deleting system and processing method thereof
CN103942161A (en) * 2014-04-24 2014-07-23 杭州冰特科技有限公司 Redundancy elimination system and method for read-only cache and redundancy elimination method for cache

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102301347A (en) * 2009-03-04 2011-12-28 日本电气株式会社 Storage system
CN101788976A (en) * 2010-02-10 2010-07-28 北京播思软件技术有限公司 File splitting method based on contents
CN102456059A (en) * 2010-10-21 2012-05-16 英业达股份有限公司 Data deduplication processing system
CN102469142A (en) * 2010-11-16 2012-05-23 英业达股份有限公司 Data transmission method for data deduplication program
CN102033924A (en) * 2010-12-08 2011-04-27 浪潮(北京)电子信息产业有限公司 Data storage method and system
CN102801757A (en) * 2011-05-25 2012-11-28 英业达股份有限公司 Processing method and system for data de-duplication of point-to-point transmission
CN102799598A (en) * 2011-05-25 2012-11-28 英业达股份有限公司 Data recovery method for deleting repeated data
CN102833298A (en) * 2011-06-17 2012-12-19 英业达集团(天津)电子技术有限公司 Distributed repeated data deleting system and processing method thereof
CN103942161A (en) * 2014-04-24 2014-07-23 杭州冰特科技有限公司 Redundancy elimination system and method for read-only cache and redundancy elimination method for cache

Cited By (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155758A (en) * 2015-03-24 2016-11-23 联想(北京)有限公司 A kind of server system and corresponding control methods thereof
CN104902000A (en) * 2015-04-03 2015-09-09 易云捷讯科技(北京)有限公司 Method for using p2p technology to fast transmit virtual machine template
CN104780048B (en) * 2015-04-13 2018-04-10 中国电子科技集团公司第二十八研究所 The image file encryption system and method for a kind of lightweight
CN104780048A (en) * 2015-04-13 2015-07-15 中国电子科技集团公司第二十八研究所 Lightweight mirror image file encryption system and method
CN108139868A (en) * 2015-09-17 2018-06-08 华睿泰科技有限责任公司 For the system and method for image segment frequently used from cache supply
CN105468306A (en) * 2016-01-06 2016-04-06 浪潮(北京)电子信息产业有限公司 Disk mirroring processing method and device
CN106095331A (en) * 2016-05-31 2016-11-09 浙江科澜信息技术有限公司 A kind of control method fixing big file internal resource
CN106095331B (en) * 2016-05-31 2020-06-23 浙江科澜信息技术有限公司 Control method for internal resources of fixed large file
CN107479942A (en) * 2016-06-08 2017-12-15 深圳市深信服电子科技有限公司 The client operating system of virtual machine starts method and device
CN106202337B (en) * 2016-07-04 2020-02-28 华中师范大学 PPT sharing method and teacher end and student end for realizing PPT sharing method
CN106202337A (en) * 2016-07-04 2016-12-07 华中师范大学 A kind of PPT sharing method and realize teacher side and the student side of the method
CN108694086A (en) * 2017-03-31 2018-10-23 英特尔公司 Technology for the service guarantee for using and executing the associated fingerprint of virtualization applications
CN107301063B (en) * 2017-05-10 2020-07-31 北京奇艺世纪科技有限公司 Mirror image management method and device
CN107301063A (en) * 2017-05-10 2017-10-27 北京奇艺世纪科技有限公司 A kind of mirror image management method and device
CN109725980A (en) * 2017-10-27 2019-05-07 伊姆西Ip控股有限责任公司 Generate method, equipment and the computer-readable medium of mirror image label
CN110019013A (en) * 2017-12-08 2019-07-16 中国电信股份有限公司 Mirrored storage method, apparatus and computer readable storage medium
CN110018878B (en) * 2018-01-09 2022-08-30 阿里巴巴集团控股有限公司 Distributed system data loading method and device
CN110018878A (en) * 2018-01-09 2019-07-16 阿里巴巴集团控股有限公司 A kind of distributed system data load method and device
CN108170455B (en) * 2018-03-12 2021-04-27 晶晨半导体(上海)股份有限公司 Upgrade package packaging method and upgrade method
CN108170455A (en) * 2018-03-12 2018-06-15 晶晨半导体(上海)股份有限公司 The packaging method and upgrade method of upgrade package
CN109344121A (en) * 2018-09-27 2019-02-15 郑州云海信息技术有限公司 A kind for the treatment of method and apparatus of image file
CN109522028A (en) * 2018-11-15 2019-03-26 郑州云海信息技术有限公司 A kind of installation method and system of operating system
CN109683916A (en) * 2018-12-03 2019-04-26 武汉钢铁工程技术集团通信有限责任公司 A kind of method of cloud mirrored host computer of the autonomous creation comprising application software
CN110086847B (en) * 2019-03-12 2021-03-09 中国科学院计算技术研究所 Data distribution method, medium, and electronic device
CN110086847A (en) * 2019-03-12 2019-08-02 中国科学院计算技术研究所 Data distributing method, medium and electronic equipment
CN110399099B (en) * 2019-06-28 2023-01-10 苏州浪潮智能科技有限公司 Data migration system and method
CN110399099A (en) * 2019-06-28 2019-11-01 苏州浪潮智能科技有限公司 Data mover system and method
CN110287064B (en) * 2019-07-02 2020-04-17 成都易我科技开发有限责任公司 Method and device for restoring disk data and electronic equipment
CN110287064A (en) * 2019-07-02 2019-09-27 成都易我科技开发有限责任公司 A kind of restoring method of data in magnetic disk, device and electronic equipment
CN110336883B (en) * 2019-07-09 2022-01-18 深信服科技股份有限公司 Mirror image data transmission method, device, equipment and computer readable storage medium
CN110336883A (en) * 2019-07-09 2019-10-15 深信服科技股份有限公司 Mirror image data transmission method, device, equipment and computer readable storage medium
CN110740192A (en) * 2019-10-29 2020-01-31 西安雷风电子科技有限公司 mirror image distribution method and system in P2P network-based virtualization environment
WO2021155857A1 (en) * 2020-02-07 2021-08-12 Huawei Technologies Co., Ltd. Fast file snapshots and clones
CN112433810A (en) * 2020-11-05 2021-03-02 北京浪潮数据技术有限公司 Docker container mirror image storage and pulling method and device and computer readable storage medium
CN112433810B (en) * 2020-11-05 2023-12-26 北京浪潮数据技术有限公司 Method and device for mirror image storage and pulling of docker container and computer readable storage medium
CN112235427A (en) * 2020-12-14 2021-01-15 广东睿江云计算股份有限公司 Merging method and system for mirror image files
CN113176886A (en) * 2021-04-29 2021-07-27 中国工商银行股份有限公司 Mirror image file compression operation method and device
WO2023036310A1 (en) * 2021-09-10 2023-03-16 中兴通讯股份有限公司 File downloading method, electronic device and computer-readable storage medium
CN114969731A (en) * 2022-03-28 2022-08-30 慧之安信息技术股份有限公司 Malicious software detection method and device based on operating system
CN114969731B (en) * 2022-03-28 2022-12-02 慧之安信息技术股份有限公司 Malicious software detection method and device based on operating system
CN116909752A (en) * 2023-09-11 2023-10-20 京东科技信息技术有限公司 Page mirror image storage method, device, equipment and storage medium
CN116909752B (en) * 2023-09-11 2024-02-02 京东科技信息技术有限公司 Page mirror image storage method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN104239575A (en) Virtual machine mirror image file storage and distribution method and device
US11068395B2 (en) Cached volumes at storage gateways
US10853339B2 (en) Peer to peer ownership negotiation
CA3027756C (en) Systems and methods for efficient distribution of stored data objects
US9946569B1 (en) Virtual machine bring-up with on-demand processing of storage requests
US11562091B2 (en) Low latency access to physical storage locations by implementing multiple levels of metadata
US10885005B2 (en) Disk optimized paging for column oriented databases
US9268651B1 (en) Efficient recovery of storage gateway cached volumes
US9274956B1 (en) Intelligent cache eviction at storage gateways
US9559889B1 (en) Cache population optimization for storage gateways
CN103501319A (en) Low-delay distributed storage system for small files
US10552371B1 (en) Data storage system with transparent presentation of file attributes during file system migration
Liu et al. Cfs: A distributed file system for large scale container platforms
US11016676B2 (en) Spot coalescing of distributed data concurrent with storage I/O operations
Merceedi et al. A comprehensive survey for hadoop distributed file system
CN114265814B (en) Data lake file system based on object storage
US11157456B2 (en) Replication of data in a distributed file system using an arbiter
US11989159B2 (en) Hybrid snapshot of a global namespace
US11586353B2 (en) Optimized access to high-speed storage device
Wang et al. Enhancement of cooperation between file systems and applications—on VFS extensions for optimized performance
Nguyen et al. A Scalable-High Performance Lightweight Distributed File System
Zeng et al. SHAstor: A Scalable HDFS-based Storage Framework for Small-Write Efficiency in Pervasive Computing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141224