CN105511938A - Virtual disk construction method - Google Patents

Virtual disk construction method Download PDF

Info

Publication number
CN105511938A
CN105511938A CN201510821450.1A CN201510821450A CN105511938A CN 105511938 A CN105511938 A CN 105511938A CN 201510821450 A CN201510821450 A CN 201510821450A CN 105511938 A CN105511938 A CN 105511938A
Authority
CN
China
Prior art keywords
block device
virtual disk
disk
virtual
virtual machine
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.)
Withdrawn
Application number
CN201510821450.1A
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.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud 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 G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201510821450.1A priority Critical patent/CN105511938A/en
Publication of CN105511938A publication Critical patent/CN105511938A/en
Withdrawn 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
    • 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

Abstract

The invention relates to the technical field of virtual machine disks and in particular relates to a virtual disk construction method combining advantages of block devices and virtual disk file formats. A block device is first prepared; the block device has unlimited realization methods; a qcow2 format file is built in the block device via a qemu tool chain; a path of the block device is configured to a virtual disk path configuration item of the virtual machine; the equipment format of the virtual machine disk is configured to a qcow2 format; and virtual disk building and virtual machine construction are finished and the virtual disk is operated as needed. Problems of virtual disk building due to the individual use of virtual disk file format or individual use of block device can be avoided; and the virtual disk construction method is suitable for virtual disk building of various types of storage systems.

Description

A kind of virtual disk construction method
Technical field
The present invention relates to magnetic disk of virtual machine technical field, particularly the virtual disk construction method of a kind of combined block equipment and virtual disk files form advantage.
Background technology
If the mode being used alone virtual disk files form creates and uses virtual disk, its great advantage to use as required, conserve space, and form is flexible, but can bring following problem:
One is that virtual disk is placed in file system, and read-write efficiency is relatively low;
Two is share inconvenience, if want to share, needs to use third party's network file system(NFS) as nfs, can increase the complicacy of system like this, increase the burden of O&M;
If directly use the mode of block device create and use virtual disk, its great advantage is that read-write efficiency is high, and it is convenient to share, but can bring following problem:
One is wasting space, because it is exactly the size that virtual disk defines that block device format creates the actual space taken after file system, even if what content there all is not write inside disk, is also to take the space that exceedes actual write size of data.
Two be storing the data on disk, snapshot, backup, the operation such as packing time because operation be data on whole block device, so special wasting space and time.
Three is the various dirigibilities lacking virtual disk form, the mutual conversion such as between different-format.
Be used alone qcow2 filesystem manner or be used alone block device mode to create and use virtual disk, there is respective merits and demerits, no matter use which kind of mode, there is its limitation, need to look for a kind of method, make the use of virtual disk have the advantage of these two kinds of modes simultaneously, and evade the shortcoming of these two kinds of modes.
Summary of the invention
The technical matters that the present invention solves is to provide a kind of virtual disk construction method; Combined block equipment and virtual disk files form advantage, solve the problem that the mode being used alone virtual disk files form or the mode being used alone block device use virtual disk to bring.
The technical scheme that the present invention solves the problem, comprises the following steps:
Described method comprises the steps:
Step 1: prepare a block device, block device implementation is not limit;
Step 2: use qemu tools chain to create the file of a qcow2 form on block device;
Step 3: the path configurations of this block device enter in the disk path configurations item of virtual machine;
Step 4: the device format of magnetic disk of virtual machine is configured to qcow2 form;
Step 5: complete establishment, can operate virtual disk on demand.
Described block device from dissimilar storage system, can store as SAN or creates a block device in distributed memory system and be mapped on local path.
Use command format qemu-imgcreate-fqcow2/path/to/block_devsizeG, block device creates the file of a qcow2 form.
Source parameter inside amendment virtual machine configuration, the disk path of configuring virtual machine, as: <sourcefile='/dev/rbd/volumes/volume-xxxxxxxxxxx '/>; The path configurations of this block device enter in the disk path configurations item of virtual machine;
Amendment driver parameter, as: <drivername=' qemu ' type=' qcow2 ' cache=' none '/>; The device format of magnetic disk of virtual machine is configured to qcow2 form.
The invention provides the virtual disk use-pattern of a kind of combined block equipment and virtual disk files form advantage, by creating virtual disk than these the two kinds of modes of methods combining being easier to realize, the various problems that the mode that is used alone is brought successfully are evaded, make virtual disk have the advantage of virtual disk files format disc and block device disk simultaneously, not only conserve space, convenient shared, form is flexible, transmission speed is faster, also improves the stability of system and reduces maintenance cost.The present invention can be applicable to dissimilar storage system, and such as SAN stores or distributed memory system, realizes simple.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is further described:
Fig. 1 is FB(flow block) of the present invention.
Embodiment
As shown in Figure 1, enforcement of the present invention comprises the following steps:
1, use qemu tools chain on block device, create the file of a qcow2 form, order as follows;
qemu-imgcreate-fqcow2/dev/rbd/volume-xxxxx100G
Wherein/dev/rbd/volume-xxxxx refers to the path of block device
2, the path configurations of block device enter in the disk path configurations item of virtual machine, this writes libvirt.xml, and code is as follows;
After completing, parameter value following (noticing that this path is being flexible coupling to actual block equipment) in configuration file:
<sourcefile=′/instances/disk/1cb99ecb01c548bfbe684fa4d095338f/i-61283E03/i-61283E03_snap′/>;
3, the device format of magnetic disk of virtual machine is configured to qcow2 form, orders as follows;
qemu-imgcreate-bbFile-fformatdisksizeGB
The mirror image that wherein parameter: bFile refers to; The system disk that disk refers to; The system disk size that sizeGB refers to.
After completing, in configuration file, parameter value is as follows:
<drivername=′qemu′type=′qcow2′cache=′none′/>。

Claims (5)

1. a virtual disk construction method, is characterized in that: described method comprises the steps:
Step 1: prepare a block device, block device implementation is not limit;
Step 2: use qemu tools chain to create the file of a qcow2 form on block device;
Step 3: the path configurations of this block device enter in the disk path configurations item of virtual machine;
Step 4: the device format of magnetic disk of virtual machine is configured to qcow2 form;
Step 5: complete establishment, can operate virtual disk on demand.
2. the virtual disk construction method according to right 1, is characterized in that: described block device from dissimilar storage system, can store as SAN or create a block device in distributed memory system and be mapped on local path.
3. the virtual disk construction method according to right 1, is characterized in that: use command format qemu-imgcreate-fqcow2/path/to/block_devsizeG, and block device creates the file of a qcow2 form.
4. the virtual disk construction method according to right 2, is characterized in that: use command format qemu-imgcreate-fqcow2/path/to/block_devsizeG, and block device creates the file of a qcow2 form.
5. the virtual disk construction method according to any one of right 1 to 4, it is characterized in that: the source parameter inside amendment virtual machine configuration, the disk path of configuring virtual machine, as: <sourcefile='/dev/rbd/volumes/volume-xxxxxx xxxxx'/>; The path configurations of this block device enter in the disk path configurations item of virtual machine;
Amendment driver parameter, as: <drivername='qemu'type='qcow2'cache='none'/ >; The device format of magnetic disk of virtual machine is configured to qcow2 form.
CN201510821450.1A 2015-11-23 2015-11-23 Virtual disk construction method Withdrawn CN105511938A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510821450.1A CN105511938A (en) 2015-11-23 2015-11-23 Virtual disk construction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510821450.1A CN105511938A (en) 2015-11-23 2015-11-23 Virtual disk construction method

Publications (1)

Publication Number Publication Date
CN105511938A true CN105511938A (en) 2016-04-20

Family

ID=55719945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510821450.1A Withdrawn CN105511938A (en) 2015-11-23 2015-11-23 Virtual disk construction method

Country Status (1)

Country Link
CN (1) CN105511938A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544751A (en) * 2017-05-17 2018-01-05 新华三云计算技术有限公司 A kind of method and apparatus for remotely accessing disk
CN108228108A (en) * 2018-01-04 2018-06-29 西安雷风电子科技有限公司 A kind of difference virtual disk link method
CN109101323A (en) * 2018-09-10 2018-12-28 南京铱迅信息技术股份有限公司 Snapshot implementing method based on qcow2 format under virtual machine operating status
CN114968128A (en) * 2022-07-28 2022-08-30 云宏信息科技股份有限公司 Qcow 2-based virtual disk mapping method, system and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375695A (en) * 2010-08-23 2012-03-14 联想(北京)有限公司 Disc accessing method and computer system
US8195866B2 (en) * 2007-04-26 2012-06-05 Vmware, Inc. Adjusting available persistent storage during execution in a virtual computer system
CN103593226A (en) * 2013-11-04 2014-02-19 国云科技股份有限公司 Method for improving IO performance of disc of virtual machine
CN104375877A (en) * 2014-10-15 2015-02-25 国云科技股份有限公司 Virtual machine online snapshot generating and deleting method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8195866B2 (en) * 2007-04-26 2012-06-05 Vmware, Inc. Adjusting available persistent storage during execution in a virtual computer system
CN102375695A (en) * 2010-08-23 2012-03-14 联想(北京)有限公司 Disc accessing method and computer system
CN103593226A (en) * 2013-11-04 2014-02-19 国云科技股份有限公司 Method for improving IO performance of disc of virtual machine
CN104375877A (en) * 2014-10-15 2015-02-25 国云科技股份有限公司 Virtual machine online snapshot generating and deleting method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544751A (en) * 2017-05-17 2018-01-05 新华三云计算技术有限公司 A kind of method and apparatus for remotely accessing disk
CN108228108A (en) * 2018-01-04 2018-06-29 西安雷风电子科技有限公司 A kind of difference virtual disk link method
CN109101323A (en) * 2018-09-10 2018-12-28 南京铱迅信息技术股份有限公司 Snapshot implementing method based on qcow2 format under virtual machine operating status
CN114968128A (en) * 2022-07-28 2022-08-30 云宏信息科技股份有限公司 Qcow 2-based virtual disk mapping method, system and medium

Similar Documents

Publication Publication Date Title
CN105511938A (en) Virtual disk construction method
CN102521072B (en) Virtual tape library equipment and data recovery method
US20150178005A1 (en) Systems and methods for migrating data
US20150268885A1 (en) Input/output operations at a virtual block device of a storage server
US11030056B2 (en) Data system for managing synchronized data protection operations at nodes of the data system, source node and destination node, and computer program product for use in such data system
CN104050248A (en) File storage system and storage method
US10015229B2 (en) Metadata sharing to decrease file transfer time
CN101582076A (en) Data de-duplication method based on data base
WO2009033074A3 (en) De-duplication in virtualized server and virtualized storage environments
WO2008055237A3 (en) System for automatically recovering a computer memory using shadowed data and file directory structures
CN104714858A (en) Data backup method, data recovery method and device
CN103946821A (en) Data storage architecture extension system and method
US20130227216A1 (en) Data storage system having multiple controller modules
CN101751307A (en) Data storage system, method as well as data storage and backup system
US10176048B2 (en) Creating a restore copy from a copy of source data in a repository having source data at different point-in-times and reading data from the repository for the restore copy
US20170161150A1 (en) Method and system for efficient replication of files using shared null mappings when having trim operations on files
US8190834B2 (en) Process for contiguously streaming data from a content addressed storage system
US9733850B2 (en) Optical cold storage with encoding and placement of data chunks on different optical disks
CN105005515A (en) LAN-free backup system
CN104142943A (en) Database expansion method and database
CA2963285A1 (en) Improved apparatus and method for performing snapshots of block-level storage devices
CN104050251A (en) File management method and management system
CN102521085B (en) Backup and restoration method based on IPTV (internet protocol television) for medium asset data and system
US20140310454A1 (en) Data set management
WO2006041750A3 (en) Method and system for managing data transfer between different types of tape media

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20160420