CN105224386A - A kind of method and device improving virtual machine template transfer efficiency - Google Patents

A kind of method and device improving virtual machine template transfer efficiency Download PDF

Info

Publication number
CN105224386A
CN105224386A CN201510560034.0A CN201510560034A CN105224386A CN 105224386 A CN105224386 A CN 105224386A CN 201510560034 A CN201510560034 A CN 201510560034A CN 105224386 A CN105224386 A CN 105224386A
Authority
CN
China
Prior art keywords
template
virtual machine
download
bytes
machine template
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.)
Granted
Application number
CN201510560034.0A
Other languages
Chinese (zh)
Other versions
CN105224386B (en
Inventor
吕重霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510560034.0A priority Critical patent/CN105224386B/en
Publication of CN105224386A publication Critical patent/CN105224386A/en
Application granted granted Critical
Publication of CN105224386B publication Critical patent/CN105224386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and the device that improve virtual machine template transfer efficiency, described method comprises: after generating virtual machines template, for virtual machine template generates corresponding template description document, in described template description document, record the scope of all non-zero block of bytes in virtual machine template; Before download virtual machine template, the template description document that the virtual machine template that will download of acquisition is corresponding, parsing the scope of all non-zero block of bytes of the virtual machine template that will download, download and obtain each non-zero block of bytes, forming downloading the non-zero block of bytes obtained the virtual machine template that will download.The present invention can reduce the transmission consumption of downloading in virtual machine template process, reduces the transmission time of virtual machine template greatly, improves transfer efficiency.

Description

A kind of method and device improving virtual machine template transfer efficiency
Technical field
The present invention relates to virtual disk technology, espespecially a kind of method and device improving virtual machine template transfer efficiency.
Background technology
Virtual platform, as Vmware, XenCenter, OpenStack etc., generally has the concept of mirror nodes and computing node, wherein the main storage virtual machine template of mirror nodes, and provides download service for computing node, as HTTP service.
For Openstack platform of increasing income, virtual disk form mainly contains several forms such as unformatted (RAW) and QCOW2, wherein, virtual machine uses RAW form most effective as IO during storage, but it is also maximum to take up space, when from consuming time also maximum during mirror nodes downloads template mirror image.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of method and the device that improve virtual machine template transfer efficiency, effectively can shorten the download time of virtual machine template.
In order to reach the object of the invention, the invention provides a kind of method improving virtual machine template transfer efficiency, comprising:
After generating virtual machines template, for virtual machine template generates corresponding template description document, in described template description document, record the scope of all non-zero block of bytes in virtual machine template;
Before download virtual machine template, the template description document that the virtual machine template that will download of acquisition is corresponding, parsing the scope of all non-zero block of bytes of the virtual machine template that will download, download and obtain each non-zero block of bytes, forming downloading the non-zero block of bytes obtained the virtual machine template that will download.
Further, described method also comprises:
After generating virtual machines template, when deleting the file in virtual machine template, block corresponding for deleted file is reset.
Further, described download obtains each non-zero block of bytes, comprising:
The mode downloaded by burst is downloaded and is obtained each non-zero block of bytes.
Further, describedly forming downloading the non-zero block of bytes that obtains the virtual machine template that will download, comprising:
According to the scope of described all non-zero block of bytes, download the padding bytes 0 outside the non-zero block of bytes obtained, obtain the described virtual machine template that will download.
Further, described virtual machine template is the template of unformatted RAW form.
Further, a kind of device improving virtual machine template transfer efficiency, comprising: template generation unit, template description document generation unit, description document acquiring unit, resolution unit, download unit and module units, wherein:
Described template generation unit, for generating virtual machines template;
Described template description document generation unit, for after described template generation unit generating virtual machines template, for virtual machine template generates corresponding template description document, records the scope of all non-zero block of bytes in virtual machine template in described template description document;
Described description document acquiring unit, for before download virtual machine template, obtains the template description document that the virtual machine template that will download is corresponding;
Described resolution unit, parses the scope of all non-zero block of bytes of the virtual machine template that will download in the template description document that the virtual machine template that will download for obtaining from description document acquiring unit is corresponding;
Described download unit, for the scope of all non-zero block of bytes of the virtual machine template that will download parsed according to resolution unit, downloads and obtains each non-zero block of bytes;
Described module units, forms for download unit being downloaded the non-zero block of bytes obtained the virtual machine template that will download.
Further, described device also comprises delete cells, wherein:
Described delete cells, for after described template generation unit generating virtual machines template, when deleting the file in virtual machine template, resets block corresponding for deleted file.
Further, described download unit is downloaded and is obtained each non-zero block of bytes, comprising:
The mode downloaded by burst is downloaded and is obtained each non-zero block of bytes.
Further, described module units forms downloading the non-zero block of bytes obtained the virtual machine template that will download, and comprising:
According to the scope of described all non-zero block of bytes, download the padding bytes 0 outside the non-zero block of bytes obtained, obtain the described virtual machine template that will download.
Further, described virtual machine template is the template of unformatted RAM form.
Compared with prior art, after present invention resides in generating virtual machines template, for virtual machine template generates corresponding template description document, in template description document, record the scope of all non-zero block of bytes in virtual machine template; Before download virtual machine template, the template description document that the virtual machine template that will download of acquisition is corresponding, parsing the scope of all non-zero block of bytes of the virtual machine template that will download, download and obtain each non-zero block of bytes, forming downloading the non-zero block of bytes obtained the virtual machine template that will download.The present invention can reduce the transmission consumption of downloading in virtual machine template process, reduces the transmission time of virtual machine template greatly, improves transfer efficiency.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from instructions, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in instructions, claims and accompanying drawing and obtain.
Accompanying drawing explanation
Accompanying drawing is used to provide the further understanding to technical solution of the present invention, and forms a part for instructions, is used from and explains technical scheme of the present invention, do not form the restriction to technical solution of the present invention with the embodiment one of the application.
Fig. 1 is the process flow diagram of the method for raising virtual machine template transfer efficiency of the present invention;
Fig. 2 is the schematic diagram downloading virtual machine template example in method of the present invention;
Fig. 3 is the schematic diagram reducing virtual machine template example in method of the present invention;
Fig. 4 is the Organization Chart of the device of raising virtual machine template transfer efficiency of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, hereinafter will be described in detail to embodiments of the invention by reference to the accompanying drawings.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combination in any mutually.
Can perform in the computer system of such as one group of computer executable instructions in the step shown in the process flow diagram of accompanying drawing.Further, although show logical order in flow charts, in some cases, can be different from the step shown or described by order execution herein.
As shown in Figure 1, the method for raising virtual machine template transfer efficiency of the present invention, comprising:
Step 101: after generating virtual machines template, for virtual machine template generates corresponding template description document, records the scope of all non-zero block of bytes in virtual machine template in template description document;
Virtual template, especially RAW template has individual feature: the null byte of complete zero is many especially, time this just causes client to download virtual template by http protocol, wastes the much unnecessary time.Although can by RAW template compressed storage, after computing node be downloaded, all will decompress(ion) one time again, the cpu resource of serious waste computing node.Based on this, in the present invention, fully take into account the characteristic that HTTP burst downloads effective template block, devise a kind of description document describing effective template block, download virtual machine template by the mode of burst.
After in the present invention, each virtual machine template makes, be first template generation template description document (info file), this info file describes the scope of all non-zero block of bytes in template, rejects empty block.Computing node, before download mirror image, first obtains this info file, after resolving info file, draws the effective coverage of file, then obtains each non-zero block of bytes of template by the mode that burst is downloaded, the mirror image that finally composition one is complete.
Step 102: before download virtual machine template, obtain the template description document that the virtual machine template that will download is corresponding;
Step 103: the scope parsing all non-zero block of bytes of the virtual machine template that will download from the template description document that the virtual machine template that will download obtained is corresponding;
Step 104: download according to the scope of all non-zero block of bytes parsed and obtain each non-zero block of bytes;
Download in the present invention and obtain each non-zero block of bytes, comprising: the mode downloaded by burst is downloaded and obtained each non-zero block of bytes.
Step 105: form the virtual machine template that will download by downloading the non-zero block of bytes obtained.
Forming downloading the non-zero block of bytes obtained the virtual machine template that will download in the present invention, comprising: according to the scope of described all non-zero block of bytes, downloading the padding bytes 0 outside the non-zero block of bytes obtained, obtain the described virtual machine template that will download.
Further, in the present invention after generating virtual machines template, when deleting the file in virtual machine template, block corresponding for deleted file is reset.
Under normal circumstances, during to a file appending content, file system can apply for new block (block), and writes (non-zero) data, then by this block of next pointed of index node (inode) the data block array of file.And when a deletion file, then fairly simple, directly all inode are gone to quote, and all block that inode and inode data block array is pointed to do not reset.Why operating system so processes, and is to consider for two aspects: (1) can recover data by mistake after deleting; (2) deletion speed can be improved.
But, then do not have this necessary for virtual machine template, virtual machine template is in manufacturing process, write some gibberishes possibly, and then delete, these useless block without any use, are reset by certain means if more enough, then can improve HTTP downloading rate further by these data in no special situation.
The present invention has taken into full account that disk shared by file content is not reset this feature when deleted file by file system, and the singularity of combined with virtual machine template, generalized case does not need invalid disk block.The present invention devises a kind of method reset for the invalid disk block of virtual machine template file, when deleting the file in virtual machine template, is reset by block corresponding for deleted file, thus reduction virtual disk taken up space.
Further, the virtual machine template in the present invention is the template of RAW form.
Be described below by the method for application example to raising virtual machine template transfer efficiency of the present invention.
As shown in Figure 2, for downloading the citing of virtual machine template in the present invention, in figure, black region represents non-zero block of bytes, and white portion represents all-zero word joint block.
For the file of a template generation info, the scope of the non-zero block of bytes of logging template file inside this template, info file content is as follows:
0-10485759
52428800-62914559
104857600-115343359
Data above between these scopes are non-zero byte data (significant data of user).Client, to download this template, first downloads this info file, analyzes content wherein, then uses the function of the partialdownload of HTTP, only download these data bytes, and the order of curl correspondence is:
Curl-r0-10485759< template URL>
Curl-r52428800-62914559< template URL>
Curl-r104857600-115343359< template URL>
Byte outside these bytes downloaded all fills 0.
In this way, if the template file of a 10G, and in fact only employ 2G, so we only need to download 2G, greatly improve the speed of download of virtual machine template.
As shown in Figure 3, be the example in reduction mirror image space, wherein No. 3 inode represent a file index, other four block blocks that inode block points to, and represent file content, and what deposit in these four blocks is the true content of file.
At present when deleting this No. 3 files, only deleting quoting of inode block, not emptied inode block and block block.If file is large especially, then waste how useless especially block block space, will larger bandwidth be wasted later in transmitting procedure.The mode of the present invention by being reset by invalid block, greatly can reduce the transmission time.
As shown in Figure 4, present invention also offers a kind of device improving virtual machine template transfer efficiency, comprising: template generation unit, template description document generation unit, description document acquiring unit, resolution unit, download unit and module units, wherein:
Template generation unit, for generating virtual machines template;
Template description document generation unit, for after template generation unit generating virtual machines template, for virtual machine template generates corresponding template description document, records the scope of all non-zero block of bytes in virtual machine template in template description document;
Description document acquiring unit, for before download virtual machine template, obtains the template description document that the virtual machine template that will download is corresponding;
Resolution unit, parses the scope of all non-zero block of bytes of the virtual machine template that will download in the template description document that the virtual machine template that will download for obtaining from description document acquiring unit is corresponding;
Download unit, for the scope of all non-zero block of bytes of the virtual machine template that will download parsed according to resolution unit, downloads and obtains each non-zero block of bytes;
Module units, forms for download unit being downloaded the non-zero block of bytes obtained the virtual machine template that will download.
Further, device also comprises delete cells, wherein:
Delete cells, for after template generation unit generating virtual machines template, when deleting the file in virtual machine template, resets block corresponding for deleted file.
Further, download unit is downloaded and is obtained each non-zero block of bytes, comprising:
The mode downloaded by burst is downloaded and is obtained each non-zero block of bytes.
Further, module units forms downloading the non-zero block of bytes obtained the virtual machine template that will download, and comprising:
According to the scope of all non-zero block of bytes, downloading the padding bytes 0 outside the non-zero block of bytes obtained, obtain the virtual machine template that will download.
Further, virtual machine template is the template of unformatted RAM form.
Although the embodiment disclosed by the present invention is as above, the embodiment that described content only adopts for ease of understanding the present invention, and be not used to limit the present invention.Those of skill in the art belonging to any the present invention; under the prerequisite not departing from the spirit and scope disclosed by the present invention; any amendment and change can be carried out in the form implemented and details; but scope of patent protection of the present invention, the scope that still must define with appending claims is as the criterion.

Claims (10)

1. improve a method for virtual machine template transfer efficiency, it is characterized in that, comprising:
After generating virtual machines template, for virtual machine template generates corresponding template description document, in described template description document, record the scope of all non-zero block of bytes in virtual machine template;
Before download virtual machine template, the template description document that the virtual machine template that will download of acquisition is corresponding, parsing the scope of all non-zero block of bytes of the virtual machine template that will download, download and obtain each non-zero block of bytes, forming downloading the non-zero block of bytes obtained the virtual machine template that will download.
2. method according to claim 1, is characterized in that, described method also comprises:
After generating virtual machines template, when deleting the file in virtual machine template, block corresponding for deleted file is reset.
3. method according to claim 1 and 2, is characterized in that, described download obtains each non-zero block of bytes, comprising:
The mode downloaded by burst is downloaded and is obtained each non-zero block of bytes.
4. method according to claim 1 and 2, is characterized in that, describedly forms downloading the non-zero block of bytes that obtains the virtual machine template that will download, and comprising:
According to the scope of described all non-zero block of bytes, download the padding bytes 0 outside the non-zero block of bytes obtained, obtain the described virtual machine template that will download.
5. method according to claim 1 and 2, is characterized in that, described virtual machine template is the template of unformatted RAW form.
6. improve a device for virtual machine template transfer efficiency, it is characterized in that, comprising: template generation unit, template description document generation unit, description document acquiring unit, resolution unit, download unit and module units, wherein:
Described template generation unit, for generating virtual machines template;
Described template description document generation unit, for after described template generation unit generating virtual machines template, for virtual machine template generates corresponding template description document, records the scope of all non-zero block of bytes in virtual machine template in described template description document;
Described description document acquiring unit, for before download virtual machine template, obtains the template description document that the virtual machine template that will download is corresponding;
Described resolution unit, parses the scope of all non-zero block of bytes of the virtual machine template that will download in the template description document that the virtual machine template that will download for obtaining from description document acquiring unit is corresponding;
Described download unit, for the scope of all non-zero block of bytes of the virtual machine template that will download parsed according to resolution unit, downloads and obtains each non-zero block of bytes;
Described module units, forms for download unit being downloaded the non-zero block of bytes obtained the virtual machine template that will download.
7. device according to claim 6, is characterized in that, described device also comprises delete cells, wherein:
Described delete cells, for after described template generation unit generating virtual machines template, when deleting the file in virtual machine template, resets block corresponding for deleted file.
8. the device according to claim 6 or 7, is characterized in that, described download unit is downloaded and obtained each non-zero block of bytes, comprising:
The mode downloaded by burst is downloaded and is obtained each non-zero block of bytes.
9. the device according to claim 6 or 7, is characterized in that, described module units forms downloading the non-zero block of bytes obtained the virtual machine template that will download, and comprising:
According to the scope of described all non-zero block of bytes, download the padding bytes 0 outside the non-zero block of bytes obtained, obtain the described virtual machine template that will download.
10. the device according to claim 6 or 7, is characterized in that, described virtual machine template is the template of unformatted RAM form.
CN201510560034.0A 2015-09-06 2015-09-06 A kind of method and device improving virtual machine template efficiency of transmission Active CN105224386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510560034.0A CN105224386B (en) 2015-09-06 2015-09-06 A kind of method and device improving virtual machine template efficiency of transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510560034.0A CN105224386B (en) 2015-09-06 2015-09-06 A kind of method and device improving virtual machine template efficiency of transmission

Publications (2)

Publication Number Publication Date
CN105224386A true CN105224386A (en) 2016-01-06
CN105224386B CN105224386B (en) 2018-11-23

Family

ID=54993376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510560034.0A Active CN105224386B (en) 2015-09-06 2015-09-06 A kind of method and device improving virtual machine template efficiency of transmission

Country Status (1)

Country Link
CN (1) CN105224386B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483573A (en) * 2017-08-08 2017-12-15 郑州云海信息技术有限公司 The transmission method and device of image file in cloud platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7508776B2 (en) * 2003-08-15 2009-03-24 Tian Holdings, Llc Controlling method and device for data transmission
CN101917474A (en) * 2010-08-12 2010-12-15 中兴通讯股份有限公司 Method, system and device for downloading file
CN102467419A (en) * 2010-11-10 2012-05-23 英业达股份有限公司 File backup method
CN104536816A (en) * 2014-12-17 2015-04-22 中电科华云信息技术有限公司 Method for improving migration efficiency of virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7508776B2 (en) * 2003-08-15 2009-03-24 Tian Holdings, Llc Controlling method and device for data transmission
CN101917474A (en) * 2010-08-12 2010-12-15 中兴通讯股份有限公司 Method, system and device for downloading file
CN102467419A (en) * 2010-11-10 2012-05-23 英业达股份有限公司 File backup method
CN104536816A (en) * 2014-12-17 2015-04-22 中电科华云信息技术有限公司 Method for improving migration efficiency of virtual machine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483573A (en) * 2017-08-08 2017-12-15 郑州云海信息技术有限公司 The transmission method and device of image file in cloud platform

Also Published As

Publication number Publication date
CN105224386B (en) 2018-11-23

Similar Documents

Publication Publication Date Title
JP6629697B2 (en) Method and apparatus for extracting a virtual machine image file
CN106657174B (en) Data synchronization method, data updating method and data updating device
JP6110020B2 (en) Reference counter integrity check
CN108334367B (en) Firmware remote upgrading method for BMC chip
KR101745456B1 (en) Ecu for transmitting large data in hil test environment, system including the same and method thereof
CN109710185B (en) Data processing method and device
CN106648766B (en) Method and device for generating patch upgrade patch based on folder and differentially upgrading patch based on folder
CN105159968A (en) Directory management method for file system and client
CN105302920A (en) Optimal management method and system for cloud storage data
JP2014526098A (en) Method and system for downloading font files
CN104461404A (en) Metadata storage method, device and system
EP3963853B1 (en) Optimizing storage and retrieval of compressed data
CN114564227A (en) Application program updating method and device, electronic equipment and storage medium
CN108984622B (en) Storage access method and system for quick access of configuration data by home gateway
CN113900810A (en) Distributed graph processing method, system and storage medium
CN103593485A (en) Method and device for achieving real-time operation on data base
CN105224386A (en) A kind of method and device improving virtual machine template transfer efficiency
CN104063377B (en) Information processing method and use its electronic equipment
CN109614345B (en) Memory management method and device for communication between protocol layers
CN107547645B (en) Cross-platform file transmission method between Linux server and windows client
CN104484174A (en) Processing method and processing device for compressed file with RAR (Roshal A Rchive) format
CN108008984A (en) A kind of resource file downloading updating method and device
JP6893568B2 (en) Data interaction methods, equipment and devices
CN113612869A (en) Short network address generation method, terminal and storage medium
CN112905575A (en) Data acquisition method, system, storage medium and electronic equipment

Legal Events

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