CN108255577A - The acceleration method and device that a kind of virtual machine starts - Google Patents

The acceleration method and device that a kind of virtual machine starts Download PDF

Info

Publication number
CN108255577A
CN108255577A CN201711383593.4A CN201711383593A CN108255577A CN 108255577 A CN108255577 A CN 108255577A CN 201711383593 A CN201711383593 A CN 201711383593A CN 108255577 A CN108255577 A CN 108255577A
Authority
CN
China
Prior art keywords
virtual machine
data
file
parent roll
starts
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
CN201711383593.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.)
Shenzhen Sandstone Data Technology Co Ltd
Original Assignee
Shenzhen Sandstone Data Technology 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 Shenzhen Sandstone Data Technology Co Ltd filed Critical Shenzhen Sandstone Data Technology Co Ltd
Priority to CN201711383593.4A priority Critical patent/CN108255577A/en
Publication of CN108255577A publication Critical patent/CN108255577A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses the accelerated methods that a kind of virtual machine starts, and include the following steps:System is respectively that each virtual machine distributes a clone volume as system boot disk, and the virtual machine creating one for same parent roll clone is used to cache the file directory of parent roll data;When virtual machine starts, system controls corresponding IO processes to load corresponding clone volume;The IO processes of the virtual machine are when reading I/O data, if the data are located at parent roll, whether query caching catalogue has the cache file of corresponding parent roll data;If so, then first obtaining the read lock of this document, then open respective file and read data;And a kind of accelerator that virtual machine starts.The acceleration method and device that virtual machine provided by the invention starts, with reference to the Read-Write Locks of file and the mapping table of clone data, utilize the parent roll data of local file system cached virtual machine, reduce the storage pressure when virtual machine concurrently starts, it shortens virtual machine and starts time delay, be widely used in virtual machine field.

Description

The acceleration method and device that a kind of virtual machine starts
Technical field
The present invention relates to virtual machine field, the acceleration method and device that specially virtual machine starts.
Background technology
KVM:Virtual machine based on kernel is a kind of usual way of linux virtualizations.
Ceph:Distributed storage of increasing income software.
Qemu:IO simulation programs, for KVM virtualization scene.
When solving virtual machine starting problem in the prior art, the parent roll of virtual machine is copied to ram disk by needs first, Then restart virtual machine, which increase the times of copy virtual machine image.And if there is multiple and different virtual machine moulds Plate, then need to consume more memories.
In the configuration flow using the virtualization scheme of KVM+Ceph, a parent roll, installation operation system are usually first created System and some necessary application software.After installing related software, a snapshot is made a call to the parent roll.It is cloned based on the snapshot Several clone volumes are used for virtual machine.When virtual machine starts, most of operating system related data can't be written over, therefore Data are only stored in parent roll, and virtual machine can arrive parent roll and read corresponding data.Due to each virtual machine have independent qemu, Librbd processes thus while most of data that each virtual machine is read are identical, but can not be realized shared;Intel is opened Although the client side cache of hair can in local cache parent roll data, when starting simultaneously due to numerous virtual machines, There are no parent roll data by local ssd at this time, and the IO processes of virtual machine is caused still to read corresponding number to the ceph storage clusters of rear end According to;When multiple virtual machines of server start simultaneously, since data cannot be shared, many I/O data needs is caused to repeat to read, The CPU pressure of server has been aggravated significantly, while also increases the startup time of virtual machine.
To sum up, it is necessary to be improved for the technology.
Invention content
In order to solve the above-mentioned technical problem, the object of the present invention is to provide the accelerated methods and dress that a kind of virtual machine starts It puts.
The technical solution adopted in the present invention is:
The present invention provides the accelerated method that a kind of virtual machine starts, and includes the following steps:
System is respectively that each virtual machine distributes a clone volume as system boot disk, and is the virtual machine of same parent roll clone One is created for caching the file directory of parent roll data;
When virtual machine starts, system controls corresponding IO processes to load corresponding clone volume;
The IO processes of the virtual machine are when reading I/O data, if the data are located at parent roll, query caching catalogue is The no cache file for having corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and the cache file is added and writes lock, then from rear End storage reads corresponding data, and write the data to cache file;
After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
As the improvement of the technical solution, if from clone volume read data when, rear end storage return corresponding data be not present, Then whether there is corresponding cache file under query caching catalogue, if so, then obtaining the read lock of this document, open respective file and read Access evidence.
As the improvement of the technical solution, the method further includes:By inquiring volume index table, if read data bit In parent roll, then whether there is corresponding cache file under query caching catalogue, if so, the read lock of this document is then obtained, opening pair File is answered to read data.
As the improvement of the technical solution, if write I/O data bit directly writes data into rear end storage in clone volume.
As the improvement of the technical solution, if the virtual machine when IO is write in processing, first updates the concordance list of volume, then Directly write the data to rear end storage.
Further, the file directory is set on the SSD of the virtual machine server or is stored in virtual memory On disk.
Further, when the IO processes of virtual machine open the cache file of corresponding parent roll and writing for the cache file is locked not During release, the virtual machine is in the read lock for obtaining this document, until another virtual machine IO processes complete the data of cache file It is written and releasing document is write after locking and gets read lock.
On the other hand, the present invention also provides a kind of virtual machine start accelerator, including:
System setup module is respectively that each virtual machine distributes a clone volume as system startup for performing step system Disk, and the virtual machine creating one for same parent roll clone is used to cache the file directory of parent roll data;
Starting module, for performing step when virtual machine starts, system controls corresponding IO processes to load corresponding gram Grand volume;
Judgment module, for performing the IO processes of virtual machine described in step when reading I/O data, if the data are located at Parent roll, then query caching catalogue whether have the cache file of corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and this document is added and writes lock, then stored from rear end Corresponding data is read, and writes the data to cache file;
After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
The beneficial effects of the invention are as follows:The acceleration method and device that virtual machine provided by the invention starts, with reference to file The mapping table of Read-Write Locks and clone data using the parent roll data of local file system cached virtual machine, reduces virtual Storage pressure when machine concurrently starts shortens virtual machine and starts time delay.
Description of the drawings
The specific embodiment of the present invention is described further below in conjunction with the accompanying drawings:
Fig. 1 is the schematic device of one embodiment of the invention.
Specific embodiment
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase Mutually combination.
The present invention provides the accelerated method that a kind of virtual machine starts, and includes the following steps:
System is respectively that each virtual machine distributes a clone volume as system boot disk, and is the virtual machine of same parent roll clone One is created for caching the file directory of parent roll data;
When virtual machine starts, system controls corresponding IO processes to load corresponding clone volume;
The IO processes of the virtual machine are when reading I/O data, if the data are located at parent roll, query caching catalogue is The no cache file for having corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and the cache file is added and writes lock, then deposited It stores up rear end and reads corresponding data, and write the data to cache file;
After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
Wherein, the present invention provides two ways to judge the I/O data bit in parent roll or clone volume:
1, system does a mapping table (i.e. concordance list) when starting, and updates mapping table after data are written every time;
Specifically, creating one in virtual machine server for caching the file directory of parent roll data, can create On the SSD of server or on virtual flash disk.
When each virtual machine starts, corresponding clone volume is loaded by corresponding IO processes.The IO processes of virtual machine are being located When reason reads IO, Data Position is first confirmed, if the data read are to be located at parent roll:
Whether query caching catalogue has the cache file of corresponding parent roll data, if there is then first obtaining the read lock of this document, Then it opens respective file and reads data.
If without cache file, corresponding cache file is created, and this document is added and writes lock, rear end is then gone to store (ceph) corresponding data is read, and writes the data to cache file.
It is written after cache file success, releasing document writes lock, and corresponding I/O request data are returned to client.
The IO processes of virtual machine are when IO is read in processing, if the data read are to be located at clone volume, then directly from rear end Data are read in storage.
Virtual machine first updates the concordance list of the volume when IO is write in processing, then directly writes the data to rear end storage.
When the cache file of the corresponding parent roll of IO processes opening of virtual machine, but the lock of writing of cache file discharges not yet When, in the read lock for obtaining this document, IO processes can be blocked the virtual machine.Until another virtual machine IO processes complete caching Simultaneously releasing document writes lock for the data write-in of file, and the IO processes of the virtual machine can get read lock at this time, opens caching text Part simultaneously therefrom reads corresponding data.
As an embodiment, a kind of virtual machine Acceleration of starting method based on file cache comprises the steps of:
A. a clone volume is distributed as system boot disk for each virtual machine, clone volume configuration mapping table record is each The save location of data;
B. a CACHE DIRECTORY is created on the corresponding server of virtual machine, the virtual machine data conversion that reads of needs into The file of fixed size is cached;
C. when virtual machine carries out reading IO, first search index table confirms that data are located at parent roll or clone volume, if reading IO's Data are to be located at parent roll:
Whether there is corresponding cache file under query caching catalogue, if there is then obtaining the read lock of this document, then open Respective file reads data.
If without corresponding cache file, the cache file is created, and this document is added and writes lock, rear end is then gone to deposit Corresponding data is read in storage, and writes the data to cache file.
It is written after cache file success, releasing document writes lock, and corresponding I/O request data are returned to client.
D. it if the data for reading IO are to be located at clone volume, is directly stored from rear end and reads corresponding data.
E. when virtual machine is into row write IO, corresponding mapping table (i.e. concordance list) is first updated, rear end is then write the data to and deposits Storage.
2, system does not have mapping table, and clone volume is first gone to read data every time, if data are not present, illustrates data in mother Volume.
Specifically, creating one in virtual machine server for caching the file directory of parent roll data, can create On the SSD of server or on virtual flash disk.
Each the corresponding IO processes of virtual machine load corresponding clone volume.The IO processes of virtual machine are when reading IO, directly Data are read from clone volume:
If rear end storage returns to corresponding data and is not present:
It then represents that the data are located on parent roll, whether has corresponding cache file under query caching catalogue, if there is then obtaining The read lock of this document is taken, respective file is opened and reads data.
If without cache file, corresponding cache file is created, and this document is added and writes lock, rear end is then gone to store (ceph) corresponding data is read, and writes the data to cache file.
It is written after cache file success, releasing document writes lock, and corresponding I/O request data are returned to client.
Virtual machine directly writes the data to rear end storage when IO is write in processing.
As another embodiment, a kind of virtual machine Acceleration of starting method based on file cache comprises the steps of:
A. a clone volume is distributed for each virtual machine as system to start;
B. a CACHE DIRECTORY is created on the corresponding server of virtual machine, the virtual machine data conversion that reads of needs into The file of fixed size is cached;
C. when virtual machine carries out reading IO, data directly are read from clone volume:
If rear end storage returns to corresponding data and is not present, then it represents that the data are located on parent roll, under query caching catalogue Whether there is corresponding cache file, if there is then obtaining the read lock of this document, then open respective file and read data.
If without corresponding cache file, the cache file is created, and this document is added and writes lock, parent roll is then gone to read Corresponding data is taken, and writes the data to cache file.
It is written after cache file success, releasing document writes lock, and corresponding I/O request data are returned to client.
D. when virtual machine is into row write IO, rear end storage is directly write the data to.
File directory described in this programme is set on the SSD of the virtual machine server or is stored in virtual flash disk On.
The present invention is readily applicable to the solution that virtual machine is created based on storage snapshot other than Ceph.
With reference to Fig. 1, the present invention also provides the accelerator that a kind of virtual machine starts, including:
System setup module is respectively that each virtual machine distributes a clone volume as system startup for performing step system Disk, and the virtual machine creating one for same parent roll clone is used to cache the file directory of parent roll data;
Starting module, for performing step when virtual machine starts, system controls corresponding IO processes to load corresponding gram Grand volume;
Judgment module, for performing the IO processes of virtual machine described in step when reading I/O data, if the data are located at Parent roll, then query caching catalogue whether have the cache file of corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and this document is added and writes lock, then held after storing Corresponding data is read, and writes the data to cache file;
After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
Acceleration method and device that virtual machine provided by the invention starts, with reference to the Read-Write Locks and clone data of file Mapping table using the parent roll data of local file system cached virtual machine, reduces the storage pressure when virtual machine concurrently starts Power shortens virtual machine and starts time delay.
It is that the preferable of the present invention is implemented to be illustrated, but the invention is not limited to the implementation above Example, those skilled in the art can also make various equivalent variations under the premise of without prejudice to spirit of the invention or replace It changes, these equivalent deformations or replacement are all contained in the application claim limited range.

Claims (8)

1. the accelerated method that a kind of virtual machine starts, which is characterized in that include the following steps:
System is respectively that each virtual machine distributes a clone volume as system boot disk, and is the virtual machine creating of same parent roll clone One is used to cache the file directory of parent roll data;
When virtual machine starts, system controls corresponding IO processes to load corresponding clone volume;
The IO processes of the virtual machine are when reading I/O data, if the data are located at parent roll, whether query caching catalogue has The cache file of corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and the cache file is added and writes lock, then deposited from rear end Corresponding data is read in storage, and writes the data to cache file;
After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
2. the accelerated method that virtual machine according to claim 1 starts, it is characterised in that:If read data from clone volume When, rear end storage returns to corresponding data and is not present, then whether has corresponding cache file under query caching catalogue, if so, then The read lock of this document is obtained, respective file is opened and reads data.
3. the accelerated method that virtual machine according to claim 1 starts, which is characterized in that the method further includes:Pass through Volume index table is inquired, if read data are located at parent roll, whether has corresponding cache file under query caching catalogue, if Have, then obtain the read lock of this document, open respective file and read data.
4. the accelerated method that virtual machine according to claim 1 starts, it is characterised in that:If write I/O data bit is in clone Volume then directly writes data into rear end storage.
5. the accelerated method that virtual machine according to claim 1 starts, it is characterised in that:If the virtual machine is write in processing During IO, then the concordance list of volume is first updated, then directly write the data to rear end storage.
6. the accelerated method that virtual machine according to any one of claims 1 to 5 starts, it is characterised in that:The file mesh Record is set on the SSD of the virtual machine server or is stored on virtual flash disk.
7. the accelerated method that virtual machine according to claim 6 starts, it is characterised in that:When the IO processes of virtual machine are opened When writing lock and not discharging of the cache file of corresponding parent roll and the cache file, the virtual machine is in the read lock for obtaining this document When, until another virtual machine IO processes complete the data write-in of cache file and releasing document is write after locking and gets read lock.
8. a kind of accelerator that virtual machine starts, which is characterized in that including:
System setup module is respectively that each virtual machine distributes a clone volume as system boot disk for performing step system, and Virtual machine creating one for same parent roll clone is used to cache the file directory of parent roll data;
Starting module, for performing step when virtual machine starts, system controls corresponding IO processes to load corresponding clone volume;
Judgment module, for performing the IO processes of virtual machine described in step when reading I/O data, if the data are located at parent roll, Then whether query caching catalogue has the cache file of corresponding parent roll data;
If so, then first obtaining the read lock of this document, then open respective file and read data;
If without cache file, corresponding cache file is created, and this document is added and writes lock, then store and read from rear end Corresponding data, and write the data to cache file;After write-in cache file success, releasing document writes lock, and corresponding I/O request data are back to client.
CN201711383593.4A 2017-12-20 2017-12-20 The acceleration method and device that a kind of virtual machine starts Pending CN108255577A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711383593.4A CN108255577A (en) 2017-12-20 2017-12-20 The acceleration method and device that a kind of virtual machine starts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711383593.4A CN108255577A (en) 2017-12-20 2017-12-20 The acceleration method and device that a kind of virtual machine starts

Publications (1)

Publication Number Publication Date
CN108255577A true CN108255577A (en) 2018-07-06

Family

ID=62723372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711383593.4A Pending CN108255577A (en) 2017-12-20 2017-12-20 The acceleration method and device that a kind of virtual machine starts

Country Status (1)

Country Link
CN (1) CN108255577A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697134A (en) * 2009-10-27 2010-04-21 北京大学 Method for supporting quick start of similar virtual machine
CN103870312A (en) * 2012-12-12 2014-06-18 华为技术有限公司 Method and device for establishing storage cache shared by virtual machines
CN105094948A (en) * 2015-07-31 2015-11-25 杭州华为数字技术有限公司 System mirror image file updating method of virtual machine, cloud data center and system
CN105549905A (en) * 2015-12-09 2016-05-04 上海理工大学 Method for multiple virtual machines to access distributed object storage system
KR101740902B1 (en) * 2013-04-19 2017-05-30 한국전자통신연구원 System for providing virtual desktop service using cache server and method thereof
CN107479942A (en) * 2016-06-08 2017-12-15 深圳市深信服电子科技有限公司 The client operating system of virtual machine starts method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697134A (en) * 2009-10-27 2010-04-21 北京大学 Method for supporting quick start of similar virtual machine
CN103870312A (en) * 2012-12-12 2014-06-18 华为技术有限公司 Method and device for establishing storage cache shared by virtual machines
KR101740902B1 (en) * 2013-04-19 2017-05-30 한국전자통신연구원 System for providing virtual desktop service using cache server and method thereof
CN105094948A (en) * 2015-07-31 2015-11-25 杭州华为数字技术有限公司 System mirror image file updating method of virtual machine, cloud data center and system
CN105549905A (en) * 2015-12-09 2016-05-04 上海理工大学 Method for multiple virtual machines to access distributed object storage system
CN107479942A (en) * 2016-06-08 2017-12-15 深圳市深信服电子科技有限公司 The client operating system of virtual machine starts method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张沪滨等: "面向QEMU的分布式块存储系统的设计与实现", 《微型电脑应用》 *

Similar Documents

Publication Publication Date Title
US10360149B2 (en) Data structure store in persistent memory
CN105612503B (en) Persistent data structure
US7673105B2 (en) Managing memory pages
US9501421B1 (en) Memory sharing and page deduplication using indirect lines
CN109697016B (en) Method and apparatus for improving storage performance of containers
US20030200394A1 (en) Cache memory arrangement and methods for use in a cache memory system
US20090164715A1 (en) Protecting Against Stale Page Overlays
US20160314177A1 (en) Method and apparatus of maintaining data for online analytical processing in a database system
CN107341114B (en) Directory management method, node controller and system
CN103516549A (en) File system metadata log mechanism based on shared object storage
CN118140217A (en) Local page writes via pre-staging buffers for elastic buffer pool expansion
US20060277221A1 (en) Transactional file system with client partitioning
CN113220469B (en) Inter-process communication method, inter-process communication device, computer equipment and computer readable medium
JP4189342B2 (en) Storage apparatus, storage controller, and write-back cache control method
CN113448701A (en) Multi-process outbound control method, system, electronic equipment and storage medium
US9208080B2 (en) Persistent memory garbage collection
US10055139B1 (en) Optimized layout in a two tier storage
CN115048046B (en) Log file system and data management method
CN108255577A (en) The acceleration method and device that a kind of virtual machine starts
US11237925B2 (en) Systems and methods for implementing persistent data structures on an asymmetric non-volatile memory architecture
CN114780043A (en) Data processing method and device based on multilayer cache and electronic equipment
CN113590273A (en) Transaction processing method, system, device and storage medium
US9846553B2 (en) Organization and management of key-value stores
US20230168924A1 (en) Apparatus for preloading data in distributed computing environment and method using the same
CN117271379A (en) Storage management method and device for burst cache nodes in super-computing cluster

Legal Events

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

Application publication date: 20180706

RJ01 Rejection of invention patent application after publication