CN112988468A - Method for virtualizing operating system using Ceph and computer-readable storage medium - Google Patents
Method for virtualizing operating system using Ceph and computer-readable storage medium Download PDFInfo
- Publication number
- CN112988468A CN112988468A CN202110456613.6A CN202110456613A CN112988468A CN 112988468 A CN112988468 A CN 112988468A CN 202110456613 A CN202110456613 A CN 202110456613A CN 112988468 A CN112988468 A CN 112988468A
- Authority
- CN
- China
- Prior art keywords
- ceph
- storage pool
- operating system
- logical volume
- virtual disk
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method for using Ceph by a virtualized operating system and a computer readable storage medium. The method comprises the following steps: storage pool association step: creating a storage pool in the Ceph, and then creating a corresponding storage pool in the virtualization operating system to enable the storage pool in the virtualization operating system to be related to the storage pool of the Ceph; a logical volume association step: creating a logical volume in a Ceph storage pool, then creating a virtual disk for a virtual machine in a corresponding storage pool of a virtualized operating system, and enabling the virtual disk to be associated with the logical volume; and a logical volume mapping step: mapping the logical volume as a block device to a host of the virtualized operating system; virtual disk mounting: and mounting the virtual disk associated with the logical volume to the virtual machine. The method can shorten the access path of the virtual machine for reading and writing operation, is convenient for a user to distinguish Ceph from local storage, and can automatically manage Ceph.
Description
Technical Field
The present invention relates to the field of virtualization technologies, and in particular, to a method for using Ceph by a virtualized operating system and a computer-readable storage medium.
Background
WinServer is a domestic virtualization operating system with proprietary intellectual property rights and realizes bottom layer virtualization for a cloud computing data center. WinServer is capable of managing and using multiple types of storage systems, such as: local disk, FC storage (storage using fibre channel protocol as bearer protocol), ISCSI storage (storage using TCP/IP protocol (ISCSI protocol) as bearer protocol), NFS (network file system). Ceph is a distributed storage system that has gained popularity in recent years and may provide block devices, object, file storage. Currently, the way that WinServer uses Ceph is: the Ceph storage administrator creates a logical volume in the storage pool of Ceph and maps the logical volume to the WinServer host. The WinServer host identifies the logical volume as a local disk, creates a local storage pool according to the local disk, creates a virtual disk in the local storage pool, and mounts the virtual disk to a virtual machine for use.
The following problems exist with the above approach:
(1) because the logical volume of the Ceph is mapped to the local disk of the WinServer host, and then the WinServer host creates the local storage pool for use according to the logical volume, the logical volume of the Ceph used by the virtual machine needs to pass through the file system of the WinServer host, the access path is longer, and the read-write performance is poorer;
(2) after the logical volume of the Ceph is mapped to the local disk of the WinServer host, the WinServer host creates the local storage pool according to the logical volume for use, so that a user cannot distinguish whether the back-end storage of the local storage pool is from the Ceph storage or from the built-in disk of the host, and troubles are brought to the user for classified storage of data;
(3) the Ceph storage administrator needs to log in the Ceph to create the logical volume and map the logical volume to the WinServer host, and the WinServer cannot automatically manage the storage pool and the logical volume of the Ceph and the mapping relation between the logical volume and the host, so that the difficulty of management and maintenance is increased.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method for using Ceph by a virtualization operating system and a computer readable storage medium for storing a computer program for realizing the method, wherein the method can shorten the access path of the virtual machine for reading and writing operation, is convenient for a user to distinguish Ceph from local storage, and can automatically manage the Ceph.
In order to solve the above technical problem, the method for using Ceph by a virtualized operating system of the present invention comprises the following steps:
storage pool association step: creating a storage pool in the Ceph, and then creating a corresponding storage pool in the virtualization operating system to enable the storage pool in the virtualization operating system to be related to the storage pool of the Ceph;
a logical volume association step: creating a logical volume in a Ceph storage pool, then creating a virtual disk for a virtual machine in a corresponding storage pool of a virtualized operating system, and enabling the virtual disk to be associated with the logical volume;
and a logical volume mapping step: mapping the logical volume as a block device to a host of the virtualized operating system;
virtual disk mounting: and mounting the virtual disk associated with the logical volume to the virtual machine.
Optionally, in the storage pool association step, the librados library is specifically called to create the storage pool in the Ceph.
Optionally, in the logical volume association step, specifically, a librbd library is called to create the logical volume in the storage pool of Ceph; in the logical volume mapping step, a librbd library is called to map the logical volume as the block device to a host of the virtualized operating system.
Optionally, in the storage pool association step, said "create storage pool in Ceph" specifically: determining the capacity of the storage pool according to the storage pool creation request, generating an identification code of the storage pool, and then creating the storage pool in the Ceph according to the capacity of the storage pool and the identification code.
Optionally, comprising:
and a storage pool deleting step: deleting the target storage pool in the Ceph, and then deleting the target storage pool in the virtualized operating system;
virtual disk deletion: the target logical volume in Ceph is deleted, and then the target virtual disk in the virtualized operating system is deleted.
Optionally, in the step of deleting the storage pool, a librados library is called to delete the target storage pool in the Ceph; in the virtual disk deleting step, the librbd library is called to delete the target logical volume in the Ceph.
Optionally, comprising:
a snapshot creating step: creating a corresponding snapshot logical volume for the logical volume associated with the virtual disk in a storage pool in a Ceph according to a virtual disk snapshot creation request, and then creating a snapshot of the virtual disk in a virtualization operating system;
and (3) snapshot recovery step: and recovering the corresponding logical volume according to the snapshot logical volume in the Ceph in response to the virtual disk snapshot recovery request, and then recovering the virtual disk in the virtualization operating system according to the snapshot of the virtual disk.
Optionally, in the snapshot creating step, a librbd library is specifically called to create a snapshot logical volume corresponding to the logical volume associated with the virtual disk in a storage pool in the Ceph; in the snapshot recovery step, the librbd library is called to recover the corresponding logical volume according to the snapshot logical volume in the Ceph.
Alternatively, WinServer specifically uses the Ceph method.
A computer readable storage medium having stored thereon an executable computer program which when executed implements a method of virtualizing an operating system using Ceph as described above.
The virtualized operating system adopts the method to use the Ceph, and has the following advantages:
(1) because the virtual disk is directly associated with the Ceph logical volume, the virtual machine uses the Ceph logical volume without passing through a file system of a WinServer host, the access path is shortened, and the read-write performance is better;
(2) because the logical volume of the Ceph does not need to be mapped into a local disk of a WinServer host but is directly associated with the virtual disk, a user can know that the virtual disk corresponds to the Ceph but not the local storage through the virtual disk, so that the user can conveniently distinguish the virtual disks corresponding to the Ceph and the local storage respectively, and effective information is provided for the user to classify and store data;
(3) the virtualized operating system can directly manage the storage pool and the logical volume of the Ceph and the mapping relation between the logical volume and the host, and a Ceph storage administrator does not need to log in the Ceph for management, so that automatic management of the Ceph is realized.
Drawings
FIG. 1 is an architecture diagram of a virtualized operating system using Ceph.
FIG. 2 is a logical view of virtual disk management when Ceph is used by a virtualized operating system.
FIG. 3 is a logical diagram of snapshot management when Ceph is used by a virtualized operating system.
FIG. 4 is a flow diagram illustrating a method for virtualizing an operating system using Ceph.
Detailed Description
The invention is described in further detail below with reference to specific embodiments.
The storage management module in the WinServer in the virtualized operating system shown in fig. 1 includes a control unit and a computer-readable storage medium, where an executable computer program is stored in the computer-readable storage medium, and when the control unit executes the computer program, the control unit implements the method for using Ceph in the virtualized operating system shown in fig. 4, and an execution flow of the method is described below by using a specific example:
in order to provide a logical volume of Ceph for a virtual machine VM as shown in fig. 1, a user first sends a storage pool creation request to a storage management module of a virtualized operating system. After receiving a storage Pool creation request, a storage management module determines the format and the capacity of a storage Pool SR to be created according to the request, generates a unique identifier UUID for the storage Pool SR, and judges that the storage Pool SR is a storage Pool provided with storage service by the Ceph according to the format of the storage Pool SR, so that a library of librados is called to create a storage Pool Pool with the name of UUID and the capacity of corresponding size in the distributed storage system Ceph according to the capacity of the storage Pool SR and the unique identifier UUID of the storage Pool SR. After receiving a successful creation message returned by the library, the storage management module creates a corresponding storage Pool SR in the system according to the storage Pool creation request, and associates the storage Pool SR in the virtualized operating system with the storage Pool of Ceph. After creating the storage pool SR, the user sends a virtual disk creation request to the storage management module. After receiving a virtual disk creation request, the storage management module determines the disk format and the capacity of a virtual disk VDI to be created according to the request. As is well known, the disk format of the virtual disk served by Ceph is an AIO format, and therefore, according to the AIO format of the VDI, it can be determined that the virtual disk is a virtual disk served by Ceph, and the librbd library is called to create a logical volume RBD in the storage pool of Ceph. After receiving a successful creation message returned by the librbd library, the storage management module creates a corresponding virtual disk VDI in the system according to the virtual disk creation request, associates the virtual disk VDI with a logical volume RBD, calls the librbd library to map the logical volume RBD serving as the block device to a host of a virtualization operating system, and mounts a virtual disk associated with the logical volume RBD to a virtual machine VM, so that the logical volume of Ceph is provided for the virtual machine VM to use. Having provided the logical volume for the virtual machine, the virtual disk management logic of the virtualized operating system is shown in FIG. 2.
The method provides the logical volume for the virtual machine, the virtual machine uses the Ceph logical volume without passing through a file system of a WinServer host, an access path is shortened, the read-write performance is good, the Ceph logical volume is directly associated with the virtual disk, a user can know that the virtual disk corresponds to the Ceph but not the local storage through the virtual disk, the user can conveniently distinguish the virtual disks corresponding to the Ceph and the local storage, and effective information is provided for the user to store data in a classified mode.
After creating the storage pool SR, the user may issue a storage pool delete request to the storage management module, if not desired. After receiving the storage Pool deletion request, the storage management module determines the format of the target storage Pool SR to be deleted according to the deletion request, further determines that the target storage Pool SR is a storage Pool provided with storage service by Ceph, and calls the librados library to delete the corresponding target storage Pool in the Ceph according to the deletion request. After receiving the deletion success message returned by the library, the storage management module deletes the target storage pool SR in the virtualized operating system according to the deletion request. Similarly, after the virtual disk VDI is created, if the user does not want the VDI, a virtual disk deletion request may be sent to the storage management module. After receiving the virtual disk deletion request, the storage management module determines the format of a target virtual disk VDI to be deleted according to the deletion request, further determines that the target virtual disk VDI is a virtual disk with storage service provided by Ceph, and calls a librbd library to delete a corresponding target logical volume RBD in the Ceph according to the deletion request. After receiving the deletion success message returned by the librbd library, the storage management module deletes the target virtual disk VDI in the virtualized operating system according to the deletion request.
The virtualized operating system may use Ceph to perform virtual disk snapshot management, and the specific management process is as follows:
as shown in fig. 3, if a user wants to create a snapshot (pop VDI) of a virtual disk, a virtual disk snapshot creation request is issued to the storage management module. The storage management module calls the librbd library to create a corresponding snapshot logical volume (snp RBD) for the logical volume RBD associated with the virtual disk VDI in the storage Pool in the Ceph according to the virtual disk snapshot creation request. After receiving a creation success message returned by the librbd library, the storage management module creates a snapshot of the virtual disk VDI in the virtualized operating system. After creating the snapshot, assuming that the data state of the virtual disk changes, and the user wants to restore the virtual disk to the state when the snapshot is created, a virtual disk snapshot restoration request is sent to the storage management module. And calling the librbd library to restore the corresponding logical volume according to the snapshot logical volume in the Ceph by the storage management module in response to the virtual disk snapshot restoration request. After receiving a recovery success message returned by the librbd library, the storage management module recovers the virtual disk in the virtualized operating system according to the snapshot of the virtual disk.
After creating the snapshot, the user may send a virtual disk snapshot deletion request to the storage management module if the user does not want the snapshot. The storage management module calls the librbd library to delete the target snapshot logical volume in the Ceph in response to the virtual disk snapshot deletion request, and after receiving a deletion success message returned by the librbd library, the storage management module deletes the target virtual disk snapshot in the virtualized operating system.
The above description is only the embodiments of the present invention, and the scope of protection is not limited thereto. The insubstantial changes or substitutions will now be made by those skilled in the art based on the teachings of the present invention, which fall within the scope of the claims.
Claims (10)
1. The method for using Ceph by the virtualized operating system is characterized by comprising the following steps of:
storage pool association step: creating a storage pool in the Ceph, and then creating a corresponding storage pool in the virtualization operating system to enable the storage pool in the virtualization operating system to be related to the storage pool of the Ceph;
a logical volume association step: creating a logical volume in a Ceph storage pool, then creating a virtual disk for a virtual machine in a corresponding storage pool of a virtualized operating system, and enabling the virtual disk to be associated with the logical volume;
and a logical volume mapping step: mapping the logical volume as a block device to a host of the virtualized operating system;
virtual disk mounting: and mounting the virtual disk associated with the logical volume to the virtual machine.
2. The method of claim 1 for virtualizing an operating system using Ceph, wherein: in the storage pool association step, a library librados is called to create a storage pool in the Ceph.
3. The method of claim 2 for virtualizing an operating system using Ceph, wherein: in the step of associating the logical volumes, specifically, a librbd library is called to create the logical volumes in a storage pool of Ceph; in the logical volume mapping step, a librbd library is called to map the logical volume as the block device to a host of the virtualized operating system.
4. The method of claim 1 for virtualizing an operating system using Ceph, wherein: in the storage pool association step, "create storage pool in Ceph" specifically: determining the capacity of the storage pool according to the storage pool creation request, generating an identification code of the storage pool, and then creating the storage pool in the Ceph according to the capacity of the storage pool and the identification code.
5. The method of claim 1 for virtualizing an operating system using Ceph, comprising:
and a storage pool deleting step: deleting the target storage pool in the Ceph, and then deleting the target storage pool in the virtualized operating system;
virtual disk deletion: the target logical volume in Ceph is deleted, and then the target virtual disk in the virtualized operating system is deleted.
6. The method of claim 5 for virtualizing an operating system using Ceph, wherein: in the step of deleting the storage pool, a librados library is called to delete a target storage pool in the Ceph; in the virtual disk deleting step, the librbd library is called to delete the target logical volume in the Ceph.
7. The method of claim 1 for virtualizing an operating system using Ceph, comprising:
a snapshot creating step: creating a corresponding snapshot logical volume for the logical volume associated with the virtual disk in a storage pool in a Ceph according to a virtual disk snapshot creation request, and then creating a snapshot of the virtual disk in a virtualization operating system;
and (3) snapshot recovery step: and recovering the corresponding logical volume according to the snapshot logical volume in the Ceph in response to the virtual disk snapshot recovery request, and then recovering the virtual disk in the virtualization operating system according to the snapshot of the virtual disk.
8. The method of claim 7 for virtualizing an operating system using Ceph, wherein: in the snapshot creating step, a librbd library is called to create a snapshot logical volume corresponding to the logical volume associated with the virtual disk in a storage pool in a Ceph; in the snapshot recovery step, the librbd library is called to recover the corresponding logical volume according to the snapshot logical volume in the Ceph.
9. The method for using Ceph by a virtualized operating system as claimed in any of claims 1 to 8, wherein: in particular to a method for using Ceph by WinServer.
10. A computer-readable storage medium having stored thereon an executable computer program, characterized by: the computer program when executed implements a method for a virtualized operating system using Ceph as claimed in any of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110456613.6A CN112988468A (en) | 2021-04-27 | 2021-04-27 | Method for virtualizing operating system using Ceph and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110456613.6A CN112988468A (en) | 2021-04-27 | 2021-04-27 | Method for virtualizing operating system using Ceph and computer-readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112988468A true CN112988468A (en) | 2021-06-18 |
Family
ID=76340264
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110456613.6A Pending CN112988468A (en) | 2021-04-27 | 2021-04-27 | Method for virtualizing operating system using Ceph and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112988468A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113886027A (en) * | 2021-12-07 | 2022-01-04 | 广州锦和科技有限公司 | Virtual machine template creation method, virtual machine access method, virtual machine template creation device and storage medium |
CN115576743A (en) * | 2022-10-17 | 2023-01-06 | 广州鼎甲计算机科技有限公司 | Operating system recovery method and device, computer equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8909829B1 (en) * | 2013-09-26 | 2014-12-09 | Emc Corporation | Methods and apparatus for storage pool selection |
CN105808157A (en) * | 2014-12-31 | 2016-07-27 | 中兴通讯股份有限公司 | Storage architecture creating method, storage access method and storage system |
CN109496296A (en) * | 2016-07-26 | 2019-03-19 | 微软技术许可有限责任公司 | Remote metering system is set to be shown as local hardware in virtualized environment |
CN109814946A (en) * | 2018-12-29 | 2019-05-28 | 创新科存储技术(深圳)有限公司 | A kind of method and apparatus for realizing distributed storage in XenServer |
US20200034179A1 (en) * | 2018-07-30 | 2020-01-30 | Vmware, Inc. | Storage reservation pools for virtual infrastructure |
CN111290712A (en) * | 2020-01-22 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Block device creating method and device, cloud computing management system and storage medium |
US20200257546A1 (en) * | 2014-03-08 | 2020-08-13 | Diamanti, Inc. | Methods and Systems for Converged Networking and Storage |
-
2021
- 2021-04-27 CN CN202110456613.6A patent/CN112988468A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8909829B1 (en) * | 2013-09-26 | 2014-12-09 | Emc Corporation | Methods and apparatus for storage pool selection |
US20200257546A1 (en) * | 2014-03-08 | 2020-08-13 | Diamanti, Inc. | Methods and Systems for Converged Networking and Storage |
CN105808157A (en) * | 2014-12-31 | 2016-07-27 | 中兴通讯股份有限公司 | Storage architecture creating method, storage access method and storage system |
CN109496296A (en) * | 2016-07-26 | 2019-03-19 | 微软技术许可有限责任公司 | Remote metering system is set to be shown as local hardware in virtualized environment |
US20200034179A1 (en) * | 2018-07-30 | 2020-01-30 | Vmware, Inc. | Storage reservation pools for virtual infrastructure |
CN109814946A (en) * | 2018-12-29 | 2019-05-28 | 创新科存储技术(深圳)有限公司 | A kind of method and apparatus for realizing distributed storage in XenServer |
CN111290712A (en) * | 2020-01-22 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Block device creating method and device, cloud computing management system and storage medium |
Non-Patent Citations (1)
Title |
---|
管增辉 等: "《OpenStack架构分析与实践》", 31 December 2018 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113886027A (en) * | 2021-12-07 | 2022-01-04 | 广州锦和科技有限公司 | Virtual machine template creation method, virtual machine access method, virtual machine template creation device and storage medium |
CN115576743A (en) * | 2022-10-17 | 2023-01-06 | 广州鼎甲计算机科技有限公司 | Operating system recovery method and device, computer equipment and storage medium |
CN115576743B (en) * | 2022-10-17 | 2023-08-15 | 广州鼎甲计算机科技有限公司 | Operating system recovery method, operating system recovery device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7343465B2 (en) | Storage system | |
US7849282B2 (en) | Filesystem building method | |
EP2239655B1 (en) | Storage controller and storage control method | |
US9747036B2 (en) | Tiered storage device providing for migration of prioritized application specific data responsive to frequently referenced data | |
US8161321B2 (en) | Virtual machine-based on-demand parallel disaster recovery system and the method thereof | |
KR100615794B1 (en) | Method and system for accessing tape devices in a computer system | |
US11880578B2 (en) | Composite aggregate architecture | |
US20110022811A1 (en) | Information backup/restoration processing apparatus and information backup/restoration processing system | |
US20100211547A1 (en) | File sharing system, file server, and method for managing files | |
US20060020664A1 (en) | Method of managing storage capacity, server and recording medium therefor | |
JP2005501317A (en) | External data storage management system and method | |
US8024532B2 (en) | Data management method for erasing data in computer system | |
US20090019223A1 (en) | Method and systems for providing remote strage via a removable memory device | |
KR20070015185A (en) | Dynamic loading of virtual volume data in a virtual tape server | |
CN103037004A (en) | Implement method and device of cloud storage system operation | |
US11221785B2 (en) | Managing replication state for deleted objects | |
US20240045807A1 (en) | Methods for managing input-output operations in zone translation layer architecture and devices thereof | |
US10789007B2 (en) | Information processing system, management device, and control method | |
CN112988468A (en) | Method for virtualizing operating system using Ceph and computer-readable storage medium | |
US20210232458A1 (en) | Logical backup using a storage system | |
CN109857519A (en) | The processing method and relevant apparatus of virtual disk | |
US20050223180A1 (en) | Accelerating the execution of I/O operations in a storage system | |
US20240184470A1 (en) | Composite aggregate architecture | |
US8447945B2 (en) | Storage apparatus and storage system including storage media having different performances |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210618 |