WO2021098267A1 - Magnetic disk processing method, system, and device, and readable storage medium - Google Patents

Magnetic disk processing method, system, and device, and readable storage medium Download PDF

Info

Publication number
WO2021098267A1
WO2021098267A1 PCT/CN2020/104004 CN2020104004W WO2021098267A1 WO 2021098267 A1 WO2021098267 A1 WO 2021098267A1 CN 2020104004 W CN2020104004 W CN 2020104004W WO 2021098267 A1 WO2021098267 A1 WO 2021098267A1
Authority
WO
WIPO (PCT)
Prior art keywords
disk
virtual machine
target
processing
space
Prior art date
Application number
PCT/CN2020/104004
Other languages
French (fr)
Chinese (zh)
Inventor
李宏伟
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2021098267A1 publication Critical patent/WO2021098267A1/en

Links

Images

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage 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/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • 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

Definitions

  • This application relates to the field of disk processing, and in particular to a method, system, device, and readable storage medium for disk processing.
  • High Available (HA) virtual machines can quickly switch the virtual machine to another host and keep the business running after the host where the user virtual machine is located fails. Minimize the interruption time.
  • the commonly used virtual machine HA solution is to store the virtual disks of the virtual machines in the shared storage pool in the form of files.
  • the virtualization management software quickly selects a host in the cluster corresponding to the shared storage pool lock. And pull up all the problematic virtual machines on it.
  • the shared storage pool is a container that can store virtual machine disk image files and configuration files, so that all hosts can share access and start virtual machines.
  • the bottom layer of the shared storage pool is generally implemented by a cluster file system or NFS. Its advantage is that it can store heterogeneous virtual machine data, is easy to use, and can ensure the consistency of virtual machine files at the file system level; but its disadvantages are also obvious.
  • the introduction of the file system abstraction layer allows the IO of the virtual machine to pass through the file system layer before it can fall into the underlying block device, which inevitably brings performance loss, which is unacceptable for application scenarios with heavy IO load.
  • the purpose of this application is to provide a method, system, device, and readable storage medium for disk processing, which are used to improve the IO performance of a virtual machine while improving the reliability of the system.
  • this application provides a method for disk processing, which includes:
  • the target disk is processed as a raw device disk
  • the data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • the processing the target disk as a raw device disk includes:
  • the target disk is formatted, and a preset magic number is added to the header of the target disk to obtain the raw disk device.
  • the disk processing command when the disk processing command is a disk delete command, it further includes:
  • the imaging device and access path corresponding to the disk to be deleted are deleted.
  • This application also provides a disk processing system, which includes:
  • a processing module which is used to process the target disk as a raw device disk when the disk processing command is a disk add command
  • the dividing module is used to divide the storage space of the bare device disk into a hidden space and a data space; wherein the hidden space is used to store virtual machine configuration data;
  • the mapping module is configured to map the data space into an imaging device and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • it also includes:
  • the pull-up module is used to pull up all the faulty virtual machines on the faulty host when a faulty host is detected;
  • the first determining module is configured to determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
  • the startup module is used to select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  • the processing module includes:
  • the processing sub-module is used to format the target disk and add a preset magic number to the header of the target disk to obtain the raw disk device.
  • it also includes:
  • the second determining module is configured to determine the disk to be deleted according to the disk delete command when the disk processing command is a disk delete command;
  • the deleting module is used to delete the imaging device and the access path corresponding to the disk to be deleted.
  • This application also provides a disk processing device, which includes:
  • Memory used to store computer programs
  • the processor is used to implement the steps of any one of the above-mentioned disk processing methods when the computer program is executed.
  • the present application also provides a readable storage medium having a computer program stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the disk processing method described in any one of the above are implemented.
  • the method for disk processing includes: obtaining a disk processing command; when the disk processing command is a disk adding command, processing the target disk as a raw device disk; dividing the storage space of the raw device disk into hidden space and data space; Among them, the hidden space is used to save the virtual machine configuration data; the data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • the technical solution provided by this application treats the target disk as a raw device disk, and then divides the storage space of the raw device disk into hidden space and data space, so that the bare device disk can store virtual machine configuration data, thereby supporting virtual The high availability of the machine; at the same time, by mapping the data space to the imaging device and generating an access path for the imaging device, the virtual machine can access the imaging device through the access path, which improves the IO performance of the virtual machine while improving the system’s performance reliability.
  • This application also provides a disk processing system, device and readable storage medium, which have the above-mentioned beneficial effects, and will not be repeated here.
  • FIG. 1 is a flowchart of a method for disk processing provided by an embodiment of the application
  • FIG. 2 is a flowchart of another method for processing a disk provided by an embodiment of the application
  • FIG. 3 is a structural diagram of a disk processing system provided by an embodiment of the application.
  • FIG. 4 is a structural diagram of another disk processing system provided by an embodiment of the application.
  • FIG. 5 is a structural diagram of a disk processing device provided by an embodiment of the application.
  • the core of this application is to provide a method, system, device, and readable storage medium for disk processing, which are used to improve the IO performance of the virtual machine while enhancing the reliability of the system.
  • FIG. 1 is a flowchart of a disk processing method provided by an embodiment of the application.
  • disk processing commands mentioned here may include, but are not limited to, disk add commands, disk delete commands, or disk change commands, among which:
  • the disk processing command is a disk delete command
  • the disk to be changed can also be determined according to the disk change command, and the disk to be changed can be changed to an imaging device. Specifically, the following steps can be performed:
  • the storage space of the disk to be changed is divided into hidden space and data space, and the data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path, so that the user needs to access the imaging device through the access path.
  • a new udev rule can be added to the host to obtain disk processing commands, so that the host can perceive the addition, change, and deletion of disk devices, and call the rawdisk_manager tool to perform processing on the original disk. To process.
  • the target disk mentioned here is the disk newly added to the system, and the target disk needs to be processed as an imaging device that the virtual machine can access;
  • Raw device also known as raw partition (raw partition)
  • raw partition is a special block device file that is not read by Unix through the file system.
  • the application is responsible for reading and writing operations on it, without going through the file system.
  • Buffer it is a device that is not directly managed by the operating system. This kind of device lacks the operating system layer and has higher I/O efficiency.
  • the raw device disk mentioned here is the disk that is not read by Unix through the file system;
  • the target disk is treated as a raw device disk, which can be specifically:
  • the hidden space mentioned here is used to store virtual machine configuration data. Based on the fact that existing raw device disks cannot store metadata such as virtual machine configuration files, this application creatively divides the storage space of the bare device disk into hidden space and data space. And save the virtual machine configuration data in the hidden space, so that the raw device disk supports the high availability of the virtual machine.
  • S104 Map the data space to the imaging device, and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • the raw device disk can be divided into two parts, the front 32M space and the remaining space; the /dev/disk/by-id/rawdisk- ⁇ scsi id> path is generated for the remaining space for virtual machine access , And the first 32M space is a hidden space, used to retain metadata such as virtual machine configuration data.
  • a disk processing method provided by this application is to process the target disk as a raw device disk, and then divide the storage space of the raw device disk into hidden space and data space, so that the raw device disk can store
  • the virtual machine configuration data can support the high availability of the virtual machine.
  • the virtual machine can access the imaging device through the access path, which improves the virtual
  • the machine IO performance improves the reliability of the system at the same time.
  • the present application also provides another method for disk processing, which is described below with reference to FIG. 2.
  • FIG. 2 is a flowchart of another disk processing method provided by an embodiment of the application.
  • S202 Determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
  • S203 Select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  • the embodiment of the present application pulls up all faulty virtual machines on the faulty host, then determines the target hidden space corresponding to the faulty virtual machine, and obtains the virtual machine in the target hidden space Configure the data, and finally select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data, thereby realizing the high availability of the virtual machine.
  • FIG. 3 is a structural diagram of a disk processing system provided by an embodiment of the application.
  • the system can include:
  • the obtaining module 100 is used to obtain disk processing commands
  • the processing module 200 is used to process the target disk as a raw device disk when the disk processing command is a disk add command;
  • the dividing module 300 is used to divide the storage space of the bare device disk into a hidden space and a data space; among them, the hidden space is used to store virtual machine configuration data;
  • the mapping module 400 is used to map the data space to the imaging device and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • FIG. 4 is a structural diagram of another disk processing system provided by an embodiment of the application.
  • the system can also include:
  • the pull-up module is used to pull up all the faulty virtual machines on the faulty host when a faulty host is detected;
  • the first determining module is used to determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
  • the startup module is used to select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  • the processing module 200 may include:
  • the processing sub-module is used to format the target disk and add a preset magic number to the head of the target disk to obtain a raw disk device.
  • the system can also include:
  • the second determining module is used to determine the disk to be deleted according to the disk delete command
  • the delete module is used to delete the imaging device and access path corresponding to the disk to be deleted.
  • the acquisition module acquires the disk processing command; when the disk processing command is a disk add command, the processing module processes the target disk as a raw device disk; the dividing module divides the storage space of the raw device disk into hidden space and data space; the mapping module divides the data space Map as an imaging device, and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
  • the pull-up module pulls up all the faulty virtual machines on the faulty host; the first determination module determines the target hidden space corresponding to the faulty virtual machine, and obtains the virtual machine configuration data in the target hidden space; start The module selects a host in the cluster corresponding to the shared storage pool as the target host, and starts the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  • the second determination module determines the disk to be deleted according to the disk delete command; the delete module deletes the imaging device and the access path corresponding to the disk to be deleted.
  • FIG. 5 is a structural diagram of a disk processing device provided by an embodiment of the application.
  • the disk processing device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 522 (for example, one or more processors) and a memory 532, one or more More than one storage medium 530 for storing application programs 542 or data 544 (for example, one or one storage device with a large amount of storage).
  • the memory 532 and the storage medium 530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the device.
  • the processor 522 may be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the disk processing device 500.
  • the disk processing device 500 may also include one or more power supplies 525, one or more wired or wireless network interfaces 550, one or more input and output interfaces 558, and/or one or more operating systems 541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
  • the steps in the disk processing method described in FIGS. 1 to 2 are implemented by the disk processing device based on the structure shown in FIG. 5.
  • the disclosed devices, equipment, and methods can be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of modules is only a logical function division, and there may be other divisions in actual implementation, for example, multiple modules or components can be combined or integrated To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may be in electrical, mechanical or other forms.
  • the modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a function calling device, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

A magnetic disk processing method, system, and device, and a readable storage medium, the method comprising: acquiring a magnetic disk processing command; when the magnetic disk processing command is a magnetic disk adding command, processing a target magnetic disk as a raw device magnetic disk; dividing the storage space of the raw device magnetic disk into hidden space and data space; mapping the data space to an image device, and generating an access path for the image device, such that a virtual machine accesses the image device by means of the access path. The present application enables the raw device magnetic disk to store virtual machine configuration data, and thereby support the high availability of the virtual machine; in addition, by means of mapping the data space to an image device and generating an access path for the image device, such that the virtual machine can access the image device by means of the access path, the reliability of the system is increased whilst the IO performance of the virtual machine is improved.

Description

一种磁盘处理的方法、系统、设备及可读存储介质Method, system, equipment and readable storage medium for disk processing
本申请要求于2019年11月22日提交中国专利局、申请号为201911157820.0、发明名称为“一种磁盘处理的方法、系统、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on November 22, 2019, the application number is 201911157820.0, and the invention title is "a method, system, equipment and readable storage medium for disk processing", all of which The content is incorporated in this application by reference.
技术领域Technical field
本申请涉及磁盘处理领域,特别涉及一种磁盘处理的方法、系统、设备及可读存储介质。This application relates to the field of disk processing, and in particular to a method, system, device, and readable storage medium for disk processing.
背景技术Background technique
在服务器虚拟化领域,为了保证企业级业务不间断运行,虚拟机高可用(High Available,HA)能够在用户虚拟机所在主机发生故障后,快速将虚拟机切换到其它主机并保持业务继续运行,将中断时间降至最低。常用的虚拟机HA方案是将虚拟机的虚拟磁盘以文件形式存放在共享存储池中,当集群中一个主机发生故障后,虚拟化管理软件迅速在共享存储池锁对应集群中挑选一台主机,并在其上将所有出问题虚拟机拉起。这里的一个前提是共享存储池作为一个容器,能够保存虚拟机磁盘镜像文件及配置文件,使得所有主机能够共享访问并启动虚拟机。In the field of server virtualization, in order to ensure the uninterrupted operation of enterprise-level services, High Available (HA) virtual machines can quickly switch the virtual machine to another host and keep the business running after the host where the user virtual machine is located fails. Minimize the interruption time. The commonly used virtual machine HA solution is to store the virtual disks of the virtual machines in the shared storage pool in the form of files. When a host in the cluster fails, the virtualization management software quickly selects a host in the cluster corresponding to the shared storage pool lock. And pull up all the problematic virtual machines on it. A premise here is that the shared storage pool is a container that can store virtual machine disk image files and configuration files, so that all hosts can share access and start virtual machines.
共享存储池底层一般采用集群文件系统或者NFS实现,其优势是可以存储异构的虚拟机数据,简单易用且能够在文件系统层面保证虚拟机文件的一致性;但其劣势也很明显,由于引入了文件系统这一抽象层,使得虚拟机的IO要首先经过文件系统层才能落入底层块设备,必然带来了性能损耗,对于IO负载较大的应用场景是不可接受的。The bottom layer of the shared storage pool is generally implemented by a cluster file system or NFS. Its advantage is that it can store heterogeneous virtual machine data, is easy to use, and can ensure the consistency of virtual machine files at the file system level; but its disadvantages are also obvious. The introduction of the file system abstraction layer allows the IO of the virtual machine to pass through the file system layer before it can fall into the underlying block device, which inevitably brings performance loss, which is unacceptable for application scenarios with heavy IO load.
为了提高虚拟机的IO性能,业界普遍做法是去掉文件系统层,直接让虚拟机直接访问裸设备磁盘。然而由于裸设备磁盘无法存储虚拟机配置文件等元数据,无法支持虚拟机HA,虽然提升了性能但降低了系统的可靠性。In order to improve the IO performance of the virtual machine, a common practice in the industry is to remove the file system layer and directly allow the virtual machine to directly access the raw device disk. However, raw device disks cannot store metadata such as virtual machine configuration files and cannot support virtual machine HA. Although the performance is improved, the reliability of the system is reduced.
因此,如何提高虚拟机IO性能的同时提升系统的可靠性是本领域技术人员目前需要解决的技术问题。Therefore, how to improve the IO performance of the virtual machine while improving the reliability of the system is a technical problem that needs to be solved by those skilled in the art.
发明内容Summary of the invention
本申请的目的是提供一种磁盘处理的方法、系统、设备及可读存储介质,用于提高虚拟机IO性能的同时提升系统的可靠性。The purpose of this application is to provide a method, system, device, and readable storage medium for disk processing, which are used to improve the IO performance of a virtual machine while improving the reliability of the system.
为解决上述技术问题,本申请提供一种磁盘处理的方法,该方法包括:In order to solve the above technical problems, this application provides a method for disk processing, which includes:
获取磁盘处理命令;Obtain disk processing commands;
当所述磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;When the disk processing command is a disk add command, the target disk is processed as a raw device disk;
将所述裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,所述隐藏空间用于保存虚拟机配置数据;Dividing the storage space of the bare device disk into a hidden space and a data space; wherein the hidden space is used to store virtual machine configuration data;
将所述数据空间映射为映像设备,并为所述映像设备生成访问路径,以使虚拟机通过所述访问路径对所述映像设备进行访问。The data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path.
可选的,其特征在于,还包括:Optionally, it is characterized in that it further includes:
当检测到存在故障主机时,将所述故障主机上的所有故障虚拟机拉起;When detecting that there is a faulty host, pull up all faulty virtual machines on the faulty host;
确定所述故障虚拟机对应的目标隐藏空间,并获取所述目标隐藏空间中的虚拟机配置数据;Determine the target hidden space corresponding to the failed virtual machine, and obtain virtual machine configuration data in the target hidden space;
在共享存储池对应集群中挑选一台主机作为目标主机,并根据所述虚拟机配置数据在所述目标主机上启动对应的故障虚拟机。Select a host from the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
可选的,所述将目标磁盘处理为裸设备磁盘,包括:Optionally, the processing the target disk as a raw device disk includes:
对所述目标磁盘进行格式化处理,并在所述目标磁盘的首部添加预设幻数,得到所述裸磁盘设备。The target disk is formatted, and a preset magic number is added to the header of the target disk to obtain the raw disk device.
可选的,当所述磁盘处理命令为磁盘删除命令时,还包括:Optionally, when the disk processing command is a disk delete command, it further includes:
根据所述磁盘删除命令确定待删除磁盘;Determine the disk to be deleted according to the disk delete command;
将所述待删除磁盘对应的映像设备及访问路径删除。The imaging device and access path corresponding to the disk to be deleted are deleted.
本申请还提供一种磁盘处理的系统,该系统包括:This application also provides a disk processing system, which includes:
获取模块,用于获取磁盘处理命令;Obtaining module for obtaining disk processing commands;
处理模块,用于当所述磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;A processing module, which is used to process the target disk as a raw device disk when the disk processing command is a disk add command;
划分模块,用于将所述裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,所述隐藏空间用于保存虚拟机配置数据;The dividing module is used to divide the storage space of the bare device disk into a hidden space and a data space; wherein the hidden space is used to store virtual machine configuration data;
映射模块,用于将所述数据空间映射为映像设备,并为所述映像设备生成访问路径,以使虚拟机通过所述访问路径对所述映像设备进行访问。The mapping module is configured to map the data space into an imaging device and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
可选的,还包括:Optionally, it also includes:
拉起模块,用于当检测到存在故障主机时,将所述故障主机上的所有故障虚拟机拉起;The pull-up module is used to pull up all the faulty virtual machines on the faulty host when a faulty host is detected;
第一确定模块,用于确定所述故障虚拟机对应的目标隐藏空间,并获取所述目标隐藏空间中的虚拟机配置数据;The first determining module is configured to determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
启动模块,用于在共享存储池对应集群中挑选一台主机作为目标主机,并根据所述虚拟机配置数据在所述目标主机上启动对应的故障虚拟机。The startup module is used to select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
可选的,所述处理模块包括:Optionally, the processing module includes:
处理子模块,用于对所述目标磁盘进行格式化处理,并在所述目标磁盘的首部添加预设幻数,得到所述裸磁盘设备。The processing sub-module is used to format the target disk and add a preset magic number to the header of the target disk to obtain the raw disk device.
可选的,还包括:Optionally, it also includes:
第二确定模块,用于当所述磁盘处理命令为磁盘删除命令时,根据所述磁盘删除命令确定待删除磁盘;The second determining module is configured to determine the disk to be deleted according to the disk delete command when the disk processing command is a disk delete command;
删除模块,用于将所述待删除磁盘对应的映像设备及访问路径删除。The deleting module is used to delete the imaging device and the access path corresponding to the disk to be deleted.
本申请还提供一种磁盘处理设备,该磁盘处理设备包括:This application also provides a disk processing device, which includes:
存储器,用于存储计算机程序;Memory, used to store computer programs;
处理器,用于执行所述计算机程序时实现如上述任一项所述磁盘处理的方法的步骤。The processor is used to implement the steps of any one of the above-mentioned disk processing methods when the computer program is executed.
本申请还提供一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任一项所述磁盘处理的方法的步骤。The present application also provides a readable storage medium having a computer program stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the disk processing method described in any one of the above are implemented.
本申请所提供磁盘处理的方法,包括:获取磁盘处理命令;当磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;将裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,隐藏空间用于保存虚拟机配置数据;将数据空间映射为映像设备,并为映像设备生成访问路径,以使虚拟机通过访问路径对映像设备进行访问。The method for disk processing provided by this application includes: obtaining a disk processing command; when the disk processing command is a disk adding command, processing the target disk as a raw device disk; dividing the storage space of the raw device disk into hidden space and data space; Among them, the hidden space is used to save the virtual machine configuration data; the data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path.
本申请所提供的技术方案,通过将目标磁盘处理为裸设备磁盘,然后将裸设备磁盘的存储空间划分为隐藏空间及数据空间,以使裸设备磁盘能够存储虚拟机配置数据,进而能够支持虚拟机的高可用;同时,通过将数据空间映射为映像设备,并为映像设备生成访问路径,使得虚拟机能够通过该访问路径对映像设备进行访问,在提高虚拟机IO性能的同时提升了系统的可靠性。本申请同时还提供了一种磁盘处理的系统、设备及可读存储介质,具有上述有益效果,在此不再赘述。The technical solution provided by this application treats the target disk as a raw device disk, and then divides the storage space of the raw device disk into hidden space and data space, so that the bare device disk can store virtual machine configuration data, thereby supporting virtual The high availability of the machine; at the same time, by mapping the data space to the imaging device and generating an access path for the imaging device, the virtual machine can access the imaging device through the access path, which improves the IO performance of the virtual machine while improving the system’s performance reliability. This application also provides a disk processing system, device and readable storage medium, which have the above-mentioned beneficial effects, and will not be repeated here.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work.
图1为本申请实施例所提供的一种磁盘处理的方法的流程图;FIG. 1 is a flowchart of a method for disk processing provided by an embodiment of the application;
图2为本申请实施例所提供的另一种磁盘处理的方法的流程图;FIG. 2 is a flowchart of another method for processing a disk provided by an embodiment of the application;
图3为本申请实施例所提供的一种磁盘处理的系统的结构图;FIG. 3 is a structural diagram of a disk processing system provided by an embodiment of the application;
图4为本申请实施例所提供的另一种磁盘处理的系统的结构图;4 is a structural diagram of another disk processing system provided by an embodiment of the application;
图5为本申请实施例所提供的一种磁盘处理设备的结构图。FIG. 5 is a structural diagram of a disk processing device provided by an embodiment of the application.
具体实施方式Detailed ways
本申请的核心是提供一种磁盘处理的方法、系统、设备及可读存储介质,用于提高虚拟机IO性能的同时提升系统的可靠性。The core of this application is to provide a method, system, device, and readable storage medium for disk processing, which are used to improve the IO performance of the virtual machine while enhancing the reliability of the system.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
请参考图1,图1为本申请实施例所提供的一种磁盘处理的方法的流程 图。Please refer to FIG. 1. FIG. 1 is a flowchart of a disk processing method provided by an embodiment of the application.
其具体包括如下步骤:It specifically includes the following steps:
S101:获取磁盘处理命令;S101: Obtain a disk processing command;
基于现有技术中,为了提高虚拟机的IO性能,去掉文件系统层,并直接让虚拟机直接访问裸设备磁盘。然而由于裸设备磁盘无法存储虚拟机配置文件等元数据,无法支持虚拟机HA,虽然提升了性能但降低了系统的可靠性;故本申请提供了一种磁盘处理的方法,用于解决上述问题;Based on the prior art, in order to improve the IO performance of the virtual machine, the file system layer is removed, and the virtual machine directly accesses the raw device disk. However, raw device disks cannot store metadata such as virtual machine configuration files and cannot support virtual machine HA, which improves performance but reduces system reliability; therefore, this application provides a disk processing method to solve the above problems ;
可选的,这里提到的磁盘处理命令可以包括但不限于磁盘添加命令、磁盘删除命令或磁盘变动命令,其中:Optionally, the disk processing commands mentioned here may include, but are not limited to, disk add commands, disk delete commands, or disk change commands, among which:
当磁盘处理命令为磁盘删除命令时,还可以根据磁盘删除命令确定待删除磁盘,并将待删除磁盘对应的映像设备及访问路径删除,以使用户能够在系统中将故障硬盘或老旧硬盘剔除;When the disk processing command is a disk delete command, you can also determine the disk to be deleted according to the disk delete command, and delete the corresponding imaging device and access path of the disk to be deleted, so that the user can eliminate the faulty hard disk or the old hard disk in the system ;
当磁盘处理命令为磁盘变动命令时,还可以根据磁盘变动命令确定待变动磁盘,并将待变动磁盘变更为映像设备,具体的,可以执行如下步骤:When the disk processing command is a disk change command, the disk to be changed can also be determined according to the disk change command, and the disk to be changed can be changed to an imaging device. Specifically, the following steps can be performed:
将待变动磁盘的存储空间划分为隐藏空间及数据空间,并将数据空间映射为映像设备,并为映像设备生成访问路径,以使虚拟机通过访问路径对映像设备进行访问,以使用户需要在系统中添加新磁盘,而是直接对原始的磁盘进行处理便能够得到虚拟机能够访问的映像设备。The storage space of the disk to be changed is divided into hidden space and data space, and the data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path, so that the user needs to access the imaging device through the access path. Add a new disk to the system, but directly process the original disk to get the image device that the virtual machine can access.
在一个具体实施例中,可以通过在主机上增加新的udev规则,来实现对磁盘处理命令的获取,使得主机能够感知到磁盘设备的增加、变动、删除事件,并调用rawdisk_manager工具来对原始磁盘进行处理。In a specific embodiment, a new udev rule can be added to the host to obtain disk processing commands, so that the host can perceive the addition, change, and deletion of disk devices, and call the rawdisk_manager tool to perform processing on the original disk. To process.
S102:当磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;S102: When the disk processing command is a disk adding command, process the target disk as a raw device disk;
这里提到的目标磁盘即为新添加到系统中的磁盘,需要将目标磁盘处理为虚拟机能够访问的映像设备;The target disk mentioned here is the disk newly added to the system, and the target disk needs to be processed as an imaging device that the virtual machine can access;
裸设备(raw device),也叫裸分区(原始分区),是一种不被Unix通过文件系统来读取的特殊块设备文件,由应用程序负责对它进行读写操作,不经过文件系统的缓冲,它是不被操作系统直接管理的设备。这种设备少了操作系统这一层,I/O效率更高,这里提到的裸设备磁盘即为不被Unix 通过文件系统来读取的磁盘;Raw device (raw device), also known as raw partition (raw partition), is a special block device file that is not read by Unix through the file system. The application is responsible for reading and writing operations on it, without going through the file system. Buffer, it is a device that is not directly managed by the operating system. This kind of device lacks the operating system layer and has higher I/O efficiency. The raw device disk mentioned here is the disk that is not read by Unix through the file system;
可选的,这里提到的,将目标磁盘处理为裸设备磁盘,其具体可以为:Optionally, as mentioned here, the target disk is treated as a raw device disk, which can be specifically:
对目标磁盘进行格式化处理,并在目标磁盘的首部添加预设幻数,得到裸磁盘设备。Format the target disk, and add a preset magic number to the head of the target disk to obtain a raw disk device.
S103:将裸设备磁盘的存储空间划分为隐藏空间及数据空间;S103: Divide the storage space of the raw device disk into a hidden space and a data space;
这里提到的隐藏空间用于保存虚拟机配置数据,基于现有的裸设备磁盘无法存储虚拟机配置文件等元数据,本申请创造性的将裸设备磁盘的存储空间划分为隐藏空间及数据空间,并在隐藏空间中保存虚拟机配置数据,以使该裸设备磁盘支持虚拟机的高可用。The hidden space mentioned here is used to store virtual machine configuration data. Based on the fact that existing raw device disks cannot store metadata such as virtual machine configuration files, this application creatively divides the storage space of the bare device disk into hidden space and data space. And save the virtual machine configuration data in the hidden space, so that the raw device disk supports the high availability of the virtual machine.
S104:将数据空间映射为映像设备,并为映像设备生成访问路径,以使虚拟机通过访问路径对映像设备进行访问。S104: Map the data space to the imaging device, and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
在一个具体实施例中,可以将裸设备磁盘分为两部分,前面32M空间和剩下空间;对剩下空间生成/dev/disk/by-id/rawdisk-<scsi id>路径供虚拟机访问,而前32M空间为隐藏空间,用于保留虚拟机配置数据等元数据。In a specific embodiment, the raw device disk can be divided into two parts, the front 32M space and the remaining space; the /dev/disk/by-id/rawdisk-<scsi id> path is generated for the remaining space for virtual machine access , And the first 32M space is a hidden space, used to retain metadata such as virtual machine configuration data.
基于上述技术方案,本申请所提供的一种磁盘处理的方法,通过将目标磁盘处理为裸设备磁盘,然后将裸设备磁盘的存储空间划分为隐藏空间及数据空间,以使裸设备磁盘能够存储虚拟机配置数据,进而能够支持虚拟机的高可用;同时,通过将数据空间映射为映像设备,并为映像设备生成访问路径,使得虚拟机能够通过该访问路径对映像设备进行访问,在提高虚拟机IO性能的同时提升了系统的可靠性。Based on the above technical solution, a disk processing method provided by this application is to process the target disk as a raw device disk, and then divide the storage space of the raw device disk into hidden space and data space, so that the raw device disk can store The virtual machine configuration data can support the high availability of the virtual machine. At the same time, by mapping the data space to the imaging device, and generating an access path for the imaging device, the virtual machine can access the imaging device through the access path, which improves the virtual The machine IO performance improves the reliability of the system at the same time.
基于上述实施例,本申请还提供了另一种磁盘处理的方法,下面结合图2进行说明。Based on the above-mentioned embodiments, the present application also provides another method for disk processing, which is described below with reference to FIG. 2.
请参考图2,图2为本申请实施例所提供的另一种磁盘处理的方法的流程图。Please refer to FIG. 2, which is a flowchart of another disk processing method provided by an embodiment of the application.
其具体包括以下步骤:It specifically includes the following steps:
S201:当检测到存在故障主机时,将故障主机上的所有故障虚拟机拉起;S201: When detecting that there is a faulty host, pull up all faulty virtual machines on the faulty host;
S202:确定故障虚拟机对应的目标隐藏空间,并获取目标隐藏空间中 的虚拟机配置数据;S202: Determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
S203:在共享存储池对应集群中挑选一台主机作为目标主机,并根据虚拟机配置数据在目标主机上启动对应的故障虚拟机。S203: Select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
基于上述技术方案,当检测到存在故障主机时,本申请实施例通过将故障主机上的所有故障虚拟机拉起,然后确定故障虚拟机对应的目标隐藏空间,并获取目标隐藏空间中的虚拟机配置数据,最后在共享存储池对应集群中挑选一台主机作为目标主机,并根据虚拟机配置数据在目标主机上启动对应的故障虚拟机,实现了虚拟机的高可用。Based on the above technical solution, when a faulty host is detected, the embodiment of the present application pulls up all faulty virtual machines on the faulty host, then determines the target hidden space corresponding to the faulty virtual machine, and obtains the virtual machine in the target hidden space Configure the data, and finally select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data, thereby realizing the high availability of the virtual machine.
请参考图3,图3为本申请实施例所提供的一种磁盘处理的系统的结构图。Please refer to FIG. 3, which is a structural diagram of a disk processing system provided by an embodiment of the application.
该系统可以包括:The system can include:
获取模块100,用于获取磁盘处理命令;The obtaining module 100 is used to obtain disk processing commands;
处理模块200,用于当磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;The processing module 200 is used to process the target disk as a raw device disk when the disk processing command is a disk add command;
划分模块300,用于将裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,隐藏空间用于保存虚拟机配置数据;The dividing module 300 is used to divide the storage space of the bare device disk into a hidden space and a data space; among them, the hidden space is used to store virtual machine configuration data;
映射模块400,用于将数据空间映射为映像设备,并为映像设备生成访问路径,以使虚拟机通过访问路径对映像设备进行访问。The mapping module 400 is used to map the data space to the imaging device and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
请参考图4,图4为本申请实施例所提供的另一种磁盘处理的系统的结构图。Please refer to FIG. 4, which is a structural diagram of another disk processing system provided by an embodiment of the application.
该系统还可以包括:The system can also include:
拉起模块,用于当检测到存在故障主机时,将故障主机上的所有故障虚拟机拉起;The pull-up module is used to pull up all the faulty virtual machines on the faulty host when a faulty host is detected;
第一确定模块,用于确定故障虚拟机对应的目标隐藏空间,并获取目标隐藏空间中的虚拟机配置数据;The first determining module is used to determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
启动模块,用于在共享存储池对应集群中挑选一台主机作为目标主机,并根据虚拟机配置数据在目标主机上启动对应的故障虚拟机。The startup module is used to select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
该处理模块200可以包括:The processing module 200 may include:
处理子模块,用于对目标磁盘进行格式化处理,并在目标磁盘的首部添加预设幻数,得到裸磁盘设备。The processing sub-module is used to format the target disk and add a preset magic number to the head of the target disk to obtain a raw disk device.
该系统还可以包括:The system can also include:
第二确定模块,用于根据磁盘删除命令确定待删除磁盘;The second determining module is used to determine the disk to be deleted according to the disk delete command;
删除模块,用于将待删除磁盘对应的映像设备及访问路径删除。The delete module is used to delete the imaging device and access path corresponding to the disk to be deleted.
以上系统中的各个组成部分可实际应用于以下的实施例中:Each component of the above system can be actually applied to the following embodiments:
获取模块获取磁盘处理命令;当磁盘处理命令为磁盘添加命令时,处理模块将目标磁盘处理为裸设备磁盘;划分模块将裸设备磁盘的存储空间划分为隐藏空间及数据空间;映射模块将数据空间映射为映像设备,并为映像设备生成访问路径,以使虚拟机通过访问路径对映像设备进行访问。The acquisition module acquires the disk processing command; when the disk processing command is a disk add command, the processing module processes the target disk as a raw device disk; the dividing module divides the storage space of the raw device disk into hidden space and data space; the mapping module divides the data space Map as an imaging device, and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
当检测到存在故障主机时,拉起模块将故障主机上的所有故障虚拟机拉起;第一确定模块确定故障虚拟机对应的目标隐藏空间,并获取目标隐藏空间中的虚拟机配置数据;启动模块在共享存储池对应集群中挑选一台主机作为目标主机,并根据虚拟机配置数据在目标主机上启动对应的故障虚拟机。When a faulty host is detected, the pull-up module pulls up all the faulty virtual machines on the faulty host; the first determination module determines the target hidden space corresponding to the faulty virtual machine, and obtains the virtual machine configuration data in the target hidden space; start The module selects a host in the cluster corresponding to the shared storage pool as the target host, and starts the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
当磁盘处理命令为磁盘删除命令时,第二确定模块根据磁盘删除命令确定待删除磁盘;删除模块将待删除磁盘对应的映像设备及访问路径删除。When the disk processing command is a disk delete command, the second determination module determines the disk to be deleted according to the disk delete command; the delete module deletes the imaging device and the access path corresponding to the disk to be deleted.
请参考图5,图5为本申请实施例所提供的一种磁盘处理设备的结构图。Please refer to FIG. 5, which is a structural diagram of a disk processing device provided by an embodiment of the application.
该磁盘处理设备500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)522(例如,一个或一个以上处理器)和存储器532,一个或一个以上存储应用程序542或数据544的存储介质530(例如一个或一个以上海量存储设备)。其中,存储器532和存储介质530可以是短暂存储或持久存储。存储在存储介质530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对装置中的一系列指令操作。更进一步地,处理器522可以设置为与存储介质530通信,在磁盘处理设备500上执行存储介质530中的一系列指令操作。The disk processing device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 522 (for example, one or more processors) and a memory 532, one or more More than one storage medium 530 for storing application programs 542 or data 544 (for example, one or one storage device with a large amount of storage). Among them, the memory 532 and the storage medium 530 may be short-term storage or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the device. Furthermore, the processor 522 may be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the disk processing device 500.
磁盘处理设备500还可以包括一个或一个以上电源525,一个或一个以上有线或无线网络接口550,一个或一个以上输入输出接口558,和/或,一 个或一个以上操作系统541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。The disk processing device 500 may also include one or more power supplies 525, one or more wired or wireless network interfaces 550, one or more input and output interfaces 558, and/or one or more operating systems 541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
上述图1至图2所描述的磁盘处理的方法中的步骤由磁盘处理设备基于该图5所示的结构实现。The steps in the disk processing method described in FIGS. 1 to 2 are implemented by the disk processing device based on the structure shown in FIG. 5.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and module can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of modules is only a logical function division, and there may be other divisions in actual implementation, for example, multiple modules or components can be combined or integrated To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may be in electrical, mechanical or other forms.
作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,功能调用装置,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器 (Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a function calling device, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上对本申请所提供的一种磁盘处理的方法、系统、设备及可读存储介质进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The method, system, device, and readable storage medium for disk processing provided by this application are described in detail above. Specific examples are used in this article to illustrate the principles and implementation of the application. The description of the above examples is only used to help understand the methods and core ideas of the application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. Without more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or equipment that includes the element.

Claims (10)

  1. 一种磁盘处理的方法,其特征在于,包括:A method for disk processing, characterized in that it comprises:
    获取磁盘处理命令;Obtain disk processing commands;
    当所述磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;When the disk processing command is a disk add command, the target disk is processed as a raw device disk;
    将所述裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,所述隐藏空间用于保存虚拟机配置数据;Dividing the storage space of the bare device disk into a hidden space and a data space; wherein the hidden space is used to store virtual machine configuration data;
    将所述数据空间映射为映像设备,并为所述映像设备生成访问路径,以使虚拟机通过所述访问路径对所述映像设备进行访问。The data space is mapped to the imaging device, and an access path is generated for the imaging device, so that the virtual machine can access the imaging device through the access path.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    当检测到存在故障主机时,将所述故障主机上的所有故障虚拟机拉起;When detecting that there is a faulty host, pull up all faulty virtual machines on the faulty host;
    确定所述故障虚拟机对应的目标隐藏空间,并获取所述目标隐藏空间中的虚拟机配置数据;Determine the target hidden space corresponding to the failed virtual machine, and obtain virtual machine configuration data in the target hidden space;
    在共享存储池对应集群中挑选一台主机作为目标主机,并根据所述虚拟机配置数据在所述目标主机上启动对应的故障虚拟机。Select a host from the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  3. 根据权利要求1所述的方法,其特征在于,所述将目标磁盘处理为裸设备磁盘,包括:The method according to claim 1, wherein the processing the target disk as a raw device disk comprises:
    对所述目标磁盘进行格式化处理,并在所述目标磁盘的首部添加预设幻数,得到所述裸磁盘设备。The target disk is formatted, and a preset magic number is added to the header of the target disk to obtain the raw disk device.
  4. 根据权利要求1所述的方法,其特征在于,当所述磁盘处理命令为磁盘删除命令时,还包括:The method according to claim 1, wherein when the disk processing command is a disk delete command, the method further comprises:
    根据所述磁盘删除命令确定待删除磁盘;Determine the disk to be deleted according to the disk delete command;
    将所述待删除磁盘对应的映像设备及访问路径删除。The imaging device and access path corresponding to the disk to be deleted are deleted.
  5. 一种磁盘处理的系统,其特征在于,包括:A disk processing system, which is characterized in that it comprises:
    获取模块,用于获取磁盘处理命令;Obtaining module for obtaining disk processing commands;
    处理模块,用于当所述磁盘处理命令为磁盘添加命令时,将目标磁盘处理为裸设备磁盘;A processing module, which is used to process the target disk as a raw device disk when the disk processing command is a disk add command;
    划分模块,用于将所述裸设备磁盘的存储空间划分为隐藏空间及数据空间;其中,所述隐藏空间用于保存虚拟机配置数据;The dividing module is used to divide the storage space of the bare device disk into a hidden space and a data space; wherein the hidden space is used to store virtual machine configuration data;
    映射模块,用于将所述数据空间映射为映像设备,并为所述映像设备生成访问路径,以使虚拟机通过所述访问路径对所述映像设备进行访问。The mapping module is configured to map the data space into an imaging device and generate an access path for the imaging device, so that the virtual machine can access the imaging device through the access path.
  6. 根据权利要求5所述的系统,其特征在于,还包括:The system according to claim 5, further comprising:
    拉起模块,用于当检测到存在故障主机时,将所述故障主机上的所有故障虚拟机拉起;The pull-up module is used to pull up all the faulty virtual machines on the faulty host when a faulty host is detected;
    第一确定模块,用于确定所述故障虚拟机对应的目标隐藏空间,并获取所述目标隐藏空间中的虚拟机配置数据;The first determining module is configured to determine the target hidden space corresponding to the faulty virtual machine, and obtain virtual machine configuration data in the target hidden space;
    启动模块,用于在共享存储池对应集群中挑选一台主机作为目标主机,并根据所述虚拟机配置数据在所述目标主机上启动对应的故障虚拟机。The startup module is used to select a host in the cluster corresponding to the shared storage pool as the target host, and start the corresponding failed virtual machine on the target host according to the virtual machine configuration data.
  7. 根据权利要求5所述的系统,其特征在于,所述处理模块包括:The system according to claim 5, wherein the processing module comprises:
    处理子模块,用于对所述目标磁盘进行格式化处理,并在所述目标磁盘的首部添加预设幻数,得到所述裸磁盘设备。The processing sub-module is used to format the target disk and add a preset magic number to the header of the target disk to obtain the raw disk device.
  8. 根据权利要求5所述的系统,其特征在于,还包括:The system according to claim 5, further comprising:
    第二确定模块,用于当所述磁盘处理命令为磁盘删除命令时,根据所述磁盘删除命令确定待删除磁盘;The second determining module is configured to determine the disk to be deleted according to the disk delete command when the disk processing command is a disk delete command;
    删除模块,用于将所述待删除磁盘对应的映像设备及访问路径删除。The deleting module is used to delete the imaging device and the access path corresponding to the disk to be deleted.
  9. 一种磁盘处理设备,其特征在于,包括:A disk processing device, characterized in that it comprises:
    存储器,用于存储计算机程序;Memory, used to store computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述磁盘处理的方法的步骤。The processor is configured to implement the steps of the disk processing method according to any one of claims 1 to 4 when the computer program is executed.
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述磁盘处理的方法的步骤。A readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the method for disk processing according to any one of claims 1 to 4 are realized .
PCT/CN2020/104004 2019-11-22 2020-07-24 Magnetic disk processing method, system, and device, and readable storage medium WO2021098267A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911157820.0A CN110908609B (en) 2019-11-22 2019-11-22 Method, system and equipment for processing disk and readable storage medium
CN201911157820.0 2019-11-22

Publications (1)

Publication Number Publication Date
WO2021098267A1 true WO2021098267A1 (en) 2021-05-27

Family

ID=69818936

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/104004 WO2021098267A1 (en) 2019-11-22 2020-07-24 Magnetic disk processing method, system, and device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN110908609B (en)
WO (1) WO2021098267A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467887A (en) * 2021-06-25 2021-10-01 深信服科技股份有限公司 Fault repairing method, host machine and readable storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908609B (en) * 2019-11-22 2021-09-17 苏州浪潮智能科技有限公司 Method, system and equipment for processing disk and readable storage medium
CN111988169B (en) * 2020-07-29 2022-12-06 苏州浪潮智能科技有限公司 Method, system, equipment and medium for cleaning and repairing abnormal disk of cloud platform
CN111984375B (en) * 2020-08-28 2022-05-24 苏州浪潮智能科技有限公司 Disaster recovery method, system, device and medium for bare device
CN112214165A (en) * 2020-09-11 2021-01-12 济南浪潮数据技术有限公司 Storage method and system of virtualization platform and related components
CN113740781B (en) * 2021-08-30 2022-05-24 广州文远知行科技有限公司 Interface looseness detection method and device, vehicle and storage medium
CN114443223B (en) * 2022-01-18 2023-11-17 苏州浪潮智能科技有限公司 Bare computer disk management method, device and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461687A (en) * 2014-11-20 2015-03-25 华为技术有限公司 Virtual machine configuration information storage method and device
CN205809860U (en) * 2016-06-15 2016-12-14 成都云祺科技有限公司 A kind of virtual machine backup and recovery system
CN108038384A (en) * 2017-11-29 2018-05-15 北京京航计算通讯研究所 A kind of cluster of high safety shares Storage Virtualization method
US20190354438A1 (en) * 2018-05-16 2019-11-21 Hewlett Packard Enterprise Development Lp Reconstruction of data of virtual machines
CN110908609A (en) * 2019-11-22 2020-03-24 苏州浪潮智能科技有限公司 Method, system and equipment for processing disk and readable storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2710486B1 (en) * 2011-05-20 2021-06-30 Citrix Systems, Inc. Shell integration on a mobile device for an application executing remotely on a server
CN106095524B (en) * 2011-12-22 2019-04-02 中国移动通信集团公司 A kind of virtual machine deployment method, system and device
CN104077199B (en) * 2014-06-06 2016-03-16 中标软件有限公司 Based on partition method and the system of the high-availability cluster of shared disk
CN106060013A (en) * 2016-05-18 2016-10-26 浪潮电子信息产业股份有限公司 Virtualization method based on iSCSI
CN106484328B (en) * 2016-09-23 2019-06-04 浪潮电子信息产业股份有限公司 It is a kind of based on kvm system operation virtual machine use multipath block device method
CN107193491B (en) * 2017-05-17 2020-11-03 浪潮云信息技术股份公司 Virtual environment disk operation method and device
US10606630B2 (en) * 2018-02-02 2020-03-31 Nutanix, Inc. System and method for preserving entity identifiers
CN108363608B (en) * 2018-02-06 2021-12-14 广东睿江云计算股份有限公司 Virtual machine configuration method and system
CN110198329B (en) * 2018-03-26 2022-05-13 腾讯科技(深圳)有限公司 Database deployment method, device and system, electronic equipment and readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461687A (en) * 2014-11-20 2015-03-25 华为技术有限公司 Virtual machine configuration information storage method and device
CN205809860U (en) * 2016-06-15 2016-12-14 成都云祺科技有限公司 A kind of virtual machine backup and recovery system
CN108038384A (en) * 2017-11-29 2018-05-15 北京京航计算通讯研究所 A kind of cluster of high safety shares Storage Virtualization method
US20190354438A1 (en) * 2018-05-16 2019-11-21 Hewlett Packard Enterprise Development Lp Reconstruction of data of virtual machines
CN110908609A (en) * 2019-11-22 2020-03-24 苏州浪潮智能科技有限公司 Method, system and equipment for processing disk and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIN, YUEXIN: "Creating a Failover Cluster with RDM", INDUSTRIAL TECHNOLOGY INNOVATION, no. 5, 31 March 2013 (2013-03-31), pages 56 - 58, XP009528167, ISSN: 2095-8412 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467887A (en) * 2021-06-25 2021-10-01 深信服科技股份有限公司 Fault repairing method, host machine and readable storage medium
CN113467887B (en) * 2021-06-25 2024-02-23 深信服科技股份有限公司 Fault repairing method, host machine and readable storage medium

Also Published As

Publication number Publication date
CN110908609A (en) 2020-03-24
CN110908609B (en) 2021-09-17

Similar Documents

Publication Publication Date Title
WO2021098267A1 (en) Magnetic disk processing method, system, and device, and readable storage medium
US11099769B1 (en) Copying data without accessing the data
US10389852B2 (en) Method and system for providing a roaming remote desktop
US9880773B2 (en) Non-homogeneous disk abstraction for data oriented applications
CN101650660B (en) Booting a computer system from central storage
US11693789B2 (en) System and method for mapping objects to regions
US20150134929A1 (en) Load Balancing Logical Units in an Active/Passive Storage System
US20200310859A1 (en) System and method for an object layer
US11262916B2 (en) Distributed storage system, data processing method, and storage node
US9436494B2 (en) Preserving an independent virtual disk
US10146454B1 (en) Techniques for performing data storage copy operations in an integrated manner
WO2017201984A1 (en) Data processing method, associated apparatus, and data storage system
JP5547814B2 (en) Computer system, volume allocation method to virtual server, and computer-readable storage medium
US20200142628A1 (en) Data reduction reporting in storage systems
US9032402B2 (en) Managing an independent virtual disk
WO2016101662A1 (en) Data processing method and relevant server
US20150169233A1 (en) Balancing Traffic Through Logical Unit Range Partitioning
CN107329798B (en) Data replication method and device and virtualization system
WO2021120843A1 (en) Cloud host memory allocation method, cloud host, device, and storage medium
US20150356108A1 (en) Storage system and storage system control method
CN111767169A (en) Data processing method and device, electronic equipment and storage medium
WO2017054539A1 (en) Data snapshot method and storage device
US11200253B2 (en) Providing instant and distributed access to a source blob via copy-on-read blobs and link blobs
US10530870B2 (en) Direct volume migration in a storage area network
US11704334B2 (en) System and method for hyperconvergence at the datacenter

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20889196

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20889196

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20889196

Country of ref document: EP

Kind code of ref document: A1