CN105607869B - A kind of quick formatting and the method using magnetic disk of virtual machine - Google Patents

A kind of quick formatting and the method using magnetic disk of virtual machine Download PDF

Info

Publication number
CN105607869B
CN105607869B CN201510940163.2A CN201510940163A CN105607869B CN 105607869 B CN105607869 B CN 105607869B CN 201510940163 A CN201510940163 A CN 201510940163A CN 105607869 B CN105607869 B CN 105607869B
Authority
CN
China
Prior art keywords
virtual machine
file
disk
block device
formatting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510940163.2A
Other languages
Chinese (zh)
Other versions
CN105607869A (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.)
Hunan Zhongke Guoyun big data industry development 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 CN201510940163.2A priority Critical patent/CN105607869B/en
Publication of CN105607869A publication Critical patent/CN105607869A/en
Application granted granted Critical
Publication of CN105607869B publication Critical patent/CN105607869B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The present invention relates to field of cloud computer technology, especially a kind of quick formatting and the method using magnetic disk of virtual machine.The described method includes: magnetic disk of virtual machine formatted file is created above in host;The disk file created connection is mounted to a block device above host followed by virtualization tool;The block device is formatted using block device Formatting Facility;Unload formatted block device;Formatted magnetic disk of virtual machine file mount is used to virtual machine.It completely avoids user from logging in the tedious steps formatted diskette manually after virtual machine the invention can ensure that magnetic disk of virtual machine has just quickly been formatted before by virtual machine use, improves user experience;It can be used for magnetic disk of virtual machine formatting.

Description

A kind of quick formatting and the method using magnetic disk of virtual machine
Technical field
The present invention relates to field of cloud computer technology, especially a kind of quick formatting and the method using magnetic disk of virtual machine.
Background technique
Under cloud computing environment, each cloud platform is intended to dominate the market, and increases the user volume of oneself, in such case Under, good user experience is most important.
Virtual machine requires addition storing data disk and comes extension storage space, current method in operation use process Steps are as follows:
1, the disk file of specified format is created above in host;
2, the disk file of creation is mounted to virtual machine;
3, user logs in virtual machine, the disk newly increased is checked in disk management, and format, disk is divided to use.
This method is available, but user experience is not so good, especially for being unfamiliar with for the user of virtual machine system, It may not know how to find new disk and format to use.
In order to improve user using the Experience Degree in virtual machine process, facilitate user that extension is simply gone to use virtual machine Disk storage space, need a kind of simple and effective quick formatting and the method using magnetic disk of virtual machine.
Summary of the invention
Present invention solves the technical problem that being to provide a kind of quick formatting and the method using magnetic disk of virtual machine, solve Virtual machine existing user experience bottom, use process when extension is using disk are cumbersome under cloud platform environment at this stage Problem.
The technical solution that the present invention solves above-mentioned technical problem is:
The method includes:
Step 1, magnetic disk of virtual machine formatted file is created above in host;
Step 2, the block that the disk file created connection is mounted to above host is set using virtualization tool It is standby;
Step 3, the block device is formatted using block device Formatting Facility;
Step 4, formatted block device is unloaded;
Step 5, formatted magnetic disk of virtual machine file mount is used to virtual machine.
The block device is one kind in computer I/O equipment, and block device stores information in the block of fixed size, The each piece of address for having oneself;Each piece can read and write independently of other pieces.
The block device Formatting Facility determines according to virtual machine system type and required disk type, commonly such as The common ntfs type of windows virtual machine then uses mkfs.ntfs Formatting Facility etc.:
The formatting refers to the storage content in fully erased disk file, and a kind of new file system is arranged for it System;
The file system refers to that operating system is for clearly storing the side of equipment or the file on subregion in computer Method and data structure;That is the method for constituent act on a storage device.
The unloading block device is the connection relationship for closing the disk file and block device.
The carry disk file can be to virtual machine use restarts mode by modifying virtual machine configuration, It can be direct hot plug form;
The hot plug refers to directly using virsh attach-device tool mount virtual machine disk file to void Quasi- machine is used as disk, and virtual machine does not need to restart.
The present invention program's has the beneficial effect that:
1, a kind of new, simpler quick formatting is provided with using the method for magnetic disk of virtual machine, and the present invention provides Method And Principle is simple, operating process is efficient, while method is also easily realized.
2, method user experience provided by the invention is good, and it is existing during newly-increased magnetic disk of virtual machine to avoid user Cumbersome, professional technique requires the problems such as high.
Detailed description of the invention
The following further describes the present invention with reference to the drawings:
Fig. 1 is flow chart of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Whole description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
It referring to Figure 1, is a kind of quick formatting provided in an embodiment of the present invention and the method using magnetic disk of virtual machine Flow diagram, which comprises
First the creation in host virtualizes the disk file that type corresponds to format to administrator
Specifically we are illustrated by taking the disk file of XEN virtualization type creation vhd format as an example, and others are such as The application methods such as the qcow2 format disc file under KVM virtualization type are similar;Execution, which is such as issued orders, creates vhd format Disk file:
#vhd-util create -n add.vhd-s 2000
As above order creates the vhd format disc file add.vhd of a 2G size with vhd-util tool.
Then it is virtual the vhd format disc file add.vhd connection created to be mounted to an XEN on host Change the block device under type:
0 tap2:tapdisk:vhd:/root/add.vhd of #xm block-attach/dev/xvdf w 0
Non- xvda/b/c... of block device naming rule under XEN virtualized environment etc., above we utilize xm block- Disk file connection has been mounted to/dev/xvdf block device by attach tool.
Then above-mentioned block device/dev/xvdf is formatted using the Formatting Facilities such as mkfs.ntfs, here we Assuming that disk file is formatted as ntfs file system is supplied to windows virtual machine use, execution is such as issued orders:
#mkfs.ntfs /dev/xvdf -f
After formatting successfully above, it that is to say and formatted the subsequent disk file add.vhd of block device.Then The connection of block device and disk file is closed in unloading:
#xm block-detach 0 /dev/xvdf
Finally, we edit the relevant configuration file add.xml of a virtual machine block device, content is as follows:
Then by executing virsh attach-device i-xxxxxxxx add.xml order for disk file carry It is used to virtual machine, is not necessarily to the troublesome operations such as carry out additional discovery disk, format diskette after logging in virtual machine.

Claims (7)

1. a kind of quick formatting and the method using magnetic disk of virtual machine, which is characterized in that the method includes:
Step 1, magnetic disk of virtual machine file is created above in host;
Step 2, the disk file created connection is mounted to a block device above host using virtualization tool;
Step 3, the block device is formatted using block device Formatting Facility;
Step 4, formatted block device is unloaded;
Step 5, formatted magnetic disk of virtual machine file mount is used to virtual machine.
2. the method according to claim 1, wherein the block device is one kind in computer I/O equipment, Block device stores information in the block of fixed size, each piece of address for having oneself;Each piece can be independently of other pieces And it reads and writes.
3. the method according to claim 1, wherein the block device Formatting Facility is according to virtual machine system Type and required disk type determine that the ntfs type of windows virtual machine uses mkfs.ntfs Formatting Facility:
The formatting refers to the storage content in fully erased disk file, and a kind of new file system is arranged for it;
The file system refer to operating system in computer for clearly store equipment or the file on subregion method and Data structure;That is the method for constituent act on a storage device.
4. according to the method described in claim 2, it is characterized in that, the block device Formatting Facility is according to virtual machine system Type and required disk type determine that the ntfs type of windows virtual machine uses mkfs.ntfs Formatting Facility:
The formatting refers to the storage content in fully erased disk file, and a kind of new file system is arranged for it;
The file system refer to operating system in computer for clearly store equipment or the file on subregion method and Data structure;That is the method for constituent act on a storage device.
5. method according to any one of claims 1 to 4, which is characterized in that described in the unloading block device is closed The connection relationship of disk file and block device.
6. method according to any one of claims 1 to 4, which is characterized in that the carry disk file is to virtual machine Mode is restarted by modifying virtual machine configuration using can be, and is also possible to direct hot plug form;
The hot plug refers to directly using virshattach-device tool mount virtual machine disk file to virtual machine It is used as disk, virtual machine does not need to restart.
7. according to the method described in claim 5, it is characterized in that, the carry disk file can be to virtual machine use Mode is restarted by modifying virtual machine configuration, is also possible to direct hot plug form;
The hot plug refers to directly using virshattach-device tool mount virtual machine disk file to virtual machine It is used as disk, virtual machine does not need to restart.
CN201510940163.2A 2015-12-15 2015-12-15 A kind of quick formatting and the method using magnetic disk of virtual machine Active CN105607869B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510940163.2A CN105607869B (en) 2015-12-15 2015-12-15 A kind of quick formatting and the method using magnetic disk of virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510940163.2A CN105607869B (en) 2015-12-15 2015-12-15 A kind of quick formatting and the method using magnetic disk of virtual machine

Publications (2)

Publication Number Publication Date
CN105607869A CN105607869A (en) 2016-05-25
CN105607869B true CN105607869B (en) 2019-02-01

Family

ID=55987832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510940163.2A Active CN105607869B (en) 2015-12-15 2015-12-15 A kind of quick formatting and the method using magnetic disk of virtual machine

Country Status (1)

Country Link
CN (1) CN105607869B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800730B (en) * 2016-08-30 2021-01-29 阿里巴巴集团控股有限公司 Capacity expansion method and device for virtual disk
CN108021372A (en) * 2016-11-01 2018-05-11 深圳市中兴微电子技术有限公司 The management method and device of a kind of application program
CN108733323B (en) * 2018-05-24 2021-12-21 云宏信息科技股份有限公司 Self-service formatting method and device for data disc
CN111381929A (en) * 2018-12-29 2020-07-07 广州小沐信息科技有限公司 Realization method for xen virtualization to automatically identify newly-added disk of windows virtual machine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323943A (en) * 2011-09-02 2012-01-18 北京天地云箱科技有限公司 Virtual-machine-based data storage method and system
CN102868727A (en) * 2012-08-23 2013-01-09 广东电子工业研究院有限公司 Method for realizing high availability of logical volume
CN104461698A (en) * 2014-12-29 2015-03-25 成都致云科技有限公司 Dynamic virtual disk mounting method, virtual disk management device and distributed storage system
CN104484279A (en) * 2014-12-05 2015-04-01 国云科技股份有限公司 Centralized storage over-allotment using method suitable for cloud computing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2488946B1 (en) * 2009-10-12 2018-11-28 Veeam Software Ag Item-level restoration and verification of image level backups
US8990806B2 (en) * 2012-07-31 2015-03-24 Hewlett-Packard Development Company, L.P. Customized virtual machine creation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323943A (en) * 2011-09-02 2012-01-18 北京天地云箱科技有限公司 Virtual-machine-based data storage method and system
CN102868727A (en) * 2012-08-23 2013-01-09 广东电子工业研究院有限公司 Method for realizing high availability of logical volume
CN104484279A (en) * 2014-12-05 2015-04-01 国云科技股份有限公司 Centralized storage over-allotment using method suitable for cloud computing
CN104461698A (en) * 2014-12-29 2015-03-25 成都致云科技有限公司 Dynamic virtual disk mounting method, virtual disk management device and distributed storage system

Also Published As

Publication number Publication date
CN105607869A (en) 2016-05-25

Similar Documents

Publication Publication Date Title
US9921940B2 (en) Creating a software performance testing environment on a virtual machine system
US8738883B2 (en) Snapshot creation from block lists
US9019977B2 (en) Configuration management of distributed virtual switch
AU2014374256B2 (en) Systems and methods for improving snapshot performance
US8495351B2 (en) Preparing and preserving a system configuration during a hot upgrade
US8751785B2 (en) Memory tagging and preservation during a hot upgrade
US9665419B2 (en) Enhanced restart of a core dumping application
US9588793B2 (en) Creating new virtual machines based on post-boot virtual machine snapshots
US10642529B2 (en) Trim support for a solid-state drive in a virtualized environment
CN105607869B (en) A kind of quick formatting and the method using magnetic disk of virtual machine
US20150106334A1 (en) Systems and methods for backing up a live virtual machine
US9158550B2 (en) Caching based operating system installation
US20200110666A1 (en) Data recovery of guest virtual machines
CN106293535B (en) NAS performance optimization method and device
US9946559B1 (en) Techniques for managing virtual machine backups
US11030100B1 (en) Expansion of HBA write cache using NVDIMM
WO2015196820A1 (en) Method and apparatus for creating jbod file system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 523808 19th Floor, Cloud Computing Center, Chinese Academy of Sciences, No. 1 Kehui Road, Songshan Lake Hi-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant after: G-Cloud Technology Co., Ltd.

Address before: 523808 No. 14 Building, Songke Garden, Songshan Lake Science and Technology Industrial Park, Dongguan City, Guangdong Province

Applicant before: G-Cloud Technology Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201214

Address after: Room 203, 2 / F, building 6, modern service industry headquarters park, 1769 Yunfeng Avenue, Yunlong demonstration zone, Zhuzhou City, Hunan Province

Patentee after: Hunan Zhongke Guoyun big data industry development Co.,Ltd.

Address before: 523808 19th floor, Cloud Computing Center, Chinese Academy of Sciences, No.1 Kehui Road, Songshanhu high tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee before: G-CLOUD TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right