+

CN114168074B - Mirror image storage method, apparatus, storage medium and electronic device - Google Patents

Mirror image storage method, apparatus, storage medium and electronic device

Info

Publication number
CN114168074B
CN114168074B CN202111415476.8A CN202111415476A CN114168074B CN 114168074 B CN114168074 B CN 114168074B CN 202111415476 A CN202111415476 A CN 202111415476A CN 114168074 B CN114168074 B CN 114168074B
Authority
CN
China
Prior art keywords
image
storage space
target
mirror
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111415476.8A
Other languages
Chinese (zh)
Other versions
CN114168074A (en
Inventor
薛治芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202111415476.8A priority Critical patent/CN114168074B/en
Publication of CN114168074A publication Critical patent/CN114168074A/en
Application granted granted Critical
Publication of CN114168074B publication Critical patent/CN114168074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a mirror image storage method, a mirror image storage device, a storage medium and electronic equipment. The method comprises the steps of receiving a mirror image uploading request of a client, wherein the mirror image uploading request is used for requesting uploading of a target mirror image, sending a creating request to a cloud disk management module, wherein the creating request is used for requesting the cloud disk management module to create a first storage space for storing the target mirror image in a storage area network, after the cloud disk management module creates the first storage space, locally connecting the first storage space with the client, writing mirror image data of the target mirror image local to the client into the first storage space, after the mirror image data writing is completed, disconnecting the first storage space from the local of the client, and writing mirror image metadata of the target mirror image into a database. The invention solves the technical problem of low storage mirror image efficiency.

Description

Mirror image storage method, apparatus, storage medium and electronic device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and apparatus for storing images, a storage medium, and an electronic device.
Background
In the prior art, when uploading the mirror image to the storage space, the mirror image is generally stored in a distributed memory or stored in a third party memory, and in the prior art, a method for uploading the mirror image in a storage area network is not available, so that the efficiency of storing the mirror image is low.
Disclosure of Invention
The embodiment of the invention provides a mirror image storage method, a device, a storage medium and electronic equipment, which are used for at least solving the technical problem of low storage mirror image efficiency.
According to one aspect of the embodiment of the invention, a mirror image storage method of a storage area network is provided, which comprises the steps of receiving a mirror image uploading request of a client, wherein the mirror image uploading request is used for requesting uploading of a target mirror image, sending a creation request to a cloud disk management module, wherein the creation request is used for requesting the cloud disk management module to create a first storage space for storing the target mirror image in the storage area network, connecting the first storage space with the client after the cloud disk management module creates the first storage space, writing mirror image data of the target mirror image of the client into the first storage space, disconnecting the first storage space from the client after the mirror image data writing is completed, and writing mirror image metadata of the target mirror image into a database.
According to another aspect of the embodiment of the invention, a mirror image storage device of a storage area network is provided, which comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a mirror image uploading request of a client, the mirror image uploading request is used for requesting to upload a target mirror image, the sending module is used for sending a creating request to a cloud disk management module, the creating request is used for requesting the cloud disk management module to create a first storage space for storing the target mirror image in the storage area network, the first creating module is used for locally connecting the first storage space with the client after the cloud disk management module creates the first storage space, the writing module is used for writing mirror image data of the target mirror image of the local client into the first storage space, and the processing module is used for disconnecting the first storage space from the local client after the mirror image data writing is completed and writing mirror image metadata of the target mirror image into a database.
As an optional example, the processing module includes a first processing unit configured to disconnect the connection and write the mirror metadata of the mirror data into the database when the writing of the last byte of the mirror data is completed, or a second processing unit configured to disconnect the connection and write the mirror metadata of the mirror data into the database after a predetermined period of time after the writing of the last byte of the mirror data is completed.
As an optional example, the creation module includes an identification unit configured to identify a target field in the image upload request, where the target field is used to mark creation of a target object in the first storage space, and a sending unit configured to send the creation request to the cloud disk management module when the target field indicates that the target object is the cloud disk management module.
As an optional example, the apparatus further includes a configuration module configured to configure a correspondence between fields and objects in a configuration file;
The storage module is used for storing the newly added corresponding relation into the configuration file under the condition of receiving the newly added instruction for newly adding the corresponding relation, or the deletion module is used for deleting the corresponding relation indicated by the deletion instruction in the configuration file under the condition of receiving the deletion instruction for deleting the corresponding relation.
As an optional example, the device further comprises an acquisition module, a determination module and a second creation module, wherein the acquisition module is used for acquiring a creation request after the image data of the target image local to the client is written into the first storage space, the creation request is used for requesting to create a virtual machine, the determination module is used for determining a first image used for creating the virtual machine in all images in the storage area network, and the second creation module is used for creating the virtual machine by using the first image.
As an alternative example, the determining module includes a searching unit configured to search for the mirror image whose mirror image flag is identical to the target flag among all the mirror images in the storage area network according to the target flag of the mirror image included in the creation request, and a determining unit configured to determine the searched mirror image as the first mirror image.
As an optional example, the second creating module includes a mapping unit configured to map the first image in the first storage space into a second storage space, thereby creating the virtual machine.
The method for storing the target mirror image comprises the steps of receiving a mirror image uploading request of a client side, wherein the mirror image uploading request is used for requesting to upload the target mirror image, sending a creation request to a cloud disk management module, wherein the creation request is used for requesting the cloud disk management module to create a first storage space for storing the target mirror image in a storage area network, after the cloud disk management module creates the first storage space, the first storage space is locally connected with the client side, mirror image data of the target mirror image of the client side are written into the first storage space, after mirror image data writing is completed, the first storage space is disconnected from the client side, mirror image metadata of the target mirror image are written into a database, and when the mirror image is stored in the method, the cloud disk management module sends the creation request to the cloud disk management module, the first storage space in the storage area network is locally connected with the client side, and the first storage space is connected with the client side, so that the mirror image storage efficiency is improved, and the storage mirror image storage efficiency is further achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of an alternative storage area network mirrored storage method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative storage area network mirrored storage method according to an embodiment of the present invention;
FIG. 3 is an uploaded mirror schematic of an alternative storage area network mirror storage method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a virtual machine being generated by an alternative storage area network mirrored storage method in accordance with an embodiment of the present invention;
Fig. 5 is a schematic diagram of the structure of an alternative storage area network mirrored storage device according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of an embodiment of the present invention, there is provided a mirror image storage method of a storage area network, optionally, as shown in fig. 1, the method includes:
S102, receiving a mirror image uploading request of a client, wherein the mirror image uploading request is used for requesting to upload a target mirror image;
S104, sending a creation request to the cloud disk management module, wherein the creation request is used for requesting the cloud disk management module to create a first storage space for storing the target image in the storage area network;
S106, after the cloud disk management module creates the first storage space, the first storage space is locally connected with the client;
S108, mirror image data of a target mirror image of the local client side is written into the first storage space;
s110, after the mirror image data writing is completed, the connection between the first storage space and the local client is disconnected, and the mirror image metadata of the target mirror image is written into the database.
Alternatively, the present embodiment may be applied, but not limited to, in the process of storing images. The mirror image in this embodiment may be a template in which an operating system has been installed for creating virtual machines, and virtual machines may be created in batch by the mirror image.
Optionally, the storage area network (Storage Area Network, abbreviated as SAN) in this embodiment uses Fibre Channel (Fibre Channel) technology, and connects the storage array and the server host through a Fibre Channel switch, so as to establish an area network dedicated to data storage.
Optionally, in this embodiment, when the client uploads the image, the image upload request of the client may be received, then a create request is sent to the cloud disk management module, a first storage space is created in the storage area network by the cloud disk management module, then the first storage space is connected with the client, and after connection, image data of the client may be written into the first storage space. After the writing is completed, the connection is disconnected, and the mirror metadata is written into the database.
In the method, when the mirror image is stored, the creation request is sent to the cloud disk management module, the cloud disk management module sends the creation request to open up a first storage space in the storage area network, connection is established between the first storage space and the client, and the mirror image is written into the first storage space to store the mirror image, so that the purpose of improving the storage mirror image efficiency is achieved.
As an optional example, after the mirror data writing is completed, disconnecting the first storage space from the client locally, and writing the mirror metadata of the target mirror into the database includes:
Disconnecting when the last byte of the mirror data is written, writing the mirror metadata of the mirror data into the database, or
After the last byte of the mirror data is written for a preset time, the connection is disconnected, and the mirror metadata of the mirror data are written into the database.
Alternatively, in this embodiment, if the target image is uploaded to the first storage space, the connection relationship may be disconnected immediately, or may be disconnected after a predetermined period of time. The immediate disconnection can reduce the bandwidth occupation, and the disconnection after a preset time can improve the accuracy of uploading the target image.
As an alternative example, sending the creation request to the cloud disk management module includes:
identifying a target field in the mirror image uploading request, wherein the target field is used for marking a target object creating the first storage space;
And sending a creation request to the cloud disk management module when the target field indicates that the target object is the cloud disk management module.
In this embodiment, the storage location where the first storage space is to be allocated may be marked by a character flag in the allocation statement. For example, the allocation statement is parsed, character flags in the allocation statement are parsed, and if the character flags are target character flags, a first storage space is allocated in the storage area network. If the character indicator is a further character indicator, for example a first character indicator, a first memory space is allocated in the distributed network. For example, the character flag is a second character flag, then the first memory space is allocated in the direct memory access memory, and so on. By setting different character flags in the allocation statement, it is determined where to allocate the first storage space storage target image.
Optionally, in this embodiment, the location of the first storage space in the storage area network or the size of the first storage space may be determined according to the characters in the allocation statement. Different characters correspond to different positions or sizes.
As an alternative example, the method further includes:
configuring the corresponding relation between the field and the object in the configuration file;
Under the condition of receiving a new instruction for adding the corresponding relation, storing the new corresponding relation into a configuration file, or
And deleting the corresponding relation indicated by the deleting instruction in the configuration file under the condition that the deleting instruction for deleting the corresponding relation is received.
Optionally, the configuration file in this embodiment includes an allocation statement, and the character flags in the allocation statement may be adjusted. In this embodiment, before the first storage space is allocated, the character flag in the allocation statement may be adjusted to be the target character flag, so that the adjusted allocation statement may be used to allocate the first storage space for the target image. The content in the configuration file may be modified according to the new instruction and the delete instruction.
As an optional example, after writing the image data of the target image local to the client into the first storage space, the method further includes:
acquiring a creation request, wherein the creation request is used for requesting to create a virtual machine;
determining a first image for creating a virtual machine in all images in the storage area network;
a virtual machine is created using the first image.
Alternatively, in this embodiment, after storing the target image in the first storage space, a creation request may be received, the creation request being for requesting creation of the virtual machine. After receiving a creation request to create a virtual machine, a corresponding image of the virtual machine to be created may be determined. Different images correspond to creating different virtual machines. And determining a first image to be created of the virtual machine according to the creation request, and then creating the virtual machine through the first image.
As an alternative example, determining the first image for creating the virtual machine among all the images in the storage area network includes:
searching mirror images with the same mirror image mark as the target mark in all the mirror images in the storage area network according to the target mark of the mirror image contained in the creation request;
and determining the searched image as a first image.
Alternatively, in this embodiment, the first image to be used for creating the virtual machine may be determined according to the target flag of the image included in the creation request. After the creation request is acquired, acquiring a target mark of the mirror image in the creation request, comparing the mark with the mirror image marks of all the mirror images, determining the mirror image with the same mark as the target mark from all the mirror images, and creating the virtual machine as a first mirror image.
As an alternative example, creating a virtual machine using a first image includes:
the first image in the first storage space is mapped into the second storage space, thereby creating a virtual machine.
Optionally, in this embodiment, after determining to create the first image of the virtual machine, the first image is stored in the first storage space. The first image may be mapped into the second storage space to create a virtual machine.
Optionally, in this embodiment, the management system includes glance services, which is used to manage the image, and cinder components, which are used to manage the cloud disk. Yun Cipan (volume) is a hard disk device that can provide storage space for virtual machines.
Fig. 2 is a flowchart of the present embodiment. As shown in S202 to S212 in fig. 2, after receiving a request for uploading an image sent by a client, glance reads the store configuration to cinder according to the above-mentioned glance. Conf file, sends a request for creating a volume to cinder, waits cinder for completion of creating the volume, glance connects the volume to the local, then writes the image file data to the volume, and when the writing is completed, disconnects the volume connection and writes the image metadata to the database. The image metadata stores attribute information of the image file written into the volume, and the attribute information may include various attributes such as the size, storage location, storage date, and the like of the image file.
In this embodiment, a glance. Conf file may be configured, default_store= cinder. The glance. Conf file is a file for determining a storage space, that is, the above configuration file, the default_store= cinder statement is the above allocation statement, and cinder is the target character mark.
The configuration code is as follows:
[glance_store]
#Which backend scheme should glance use by default is not
#in a request to add a new image to glanceKnown schemes
#by the stores option below
#Default:‘file’
default_store=cinder
the character mark can be configured as a target character mark through the codes.
FIG. 3 is a diagram of a storage target image receiving an upload request according to the present embodiment. In fig. 3, a client 1 and a client 2 both send a mirror image upload request to a server, the server receives the mirror image upload request, allocates first storage spaces for the client 1 and the client 2 in a storage area network, establishes a connection between the storage area network and the client, and uploads the mirror image to the storage area network.
Fig. 4 is a schematic diagram of a creation virtual machine that receives a creation request according to the present embodiment. In fig. 4, when a creation request is received, a first image for creating a virtual machine is determined from a plurality of images, and the virtual machine is created using the first image map.
In this embodiment, the cinder component may be used as a storage mirror driver of glance, the storage driver of cinder is SAN storage, each time an image glance is uploaded, a request for creating a volume is sent to cinder, then image data is written to cinder, the method implements that glance and cinder use the same storage at the back end, cinder can select an image to store a corresponding volume at the bottom layer of SAN according to a user when creating a virtual machine, and a virtual machine system disk can directly map a new volume from SAN storage image volume, so that the difficulty of storing an image storage is solved, and meanwhile, creation of a virtual machine is implemented in second level.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
According to another aspect of the embodiment of the present application, there is also provided a mirror storage apparatus of a storage area network, as shown in fig. 5, including:
The receiving module 502 is configured to receive a mirror image upload request of a client, where the mirror image upload request is used to request uploading of a target mirror image;
a sending module 504, configured to send a creation request to the cloud disk management module, where the creation request is used to request the cloud disk management module to create a first storage space for storing the target image in the storage area network;
The first creating module 506 is configured to locally connect the first storage space with the client after the cloud disk management module creates the first storage space;
a writing module 508, configured to write mirror data of a target mirror local to the client into the first storage space;
And the processing module 510 is configured to disconnect the first storage space from the client after the image data is written, and write the image metadata of the target image into the database.
Alternatively, the present embodiment may be applied, but not limited to, in the process of storing images. The mirror image in this embodiment may be a template in which an operating system has been installed for creating virtual machines, and virtual machines may be created in batch by the mirror image.
Optionally, the storage area network (Storage Area Network, abbreviated as SAN) in this embodiment uses Fibre Channel (Fibre Channel) technology, and connects the storage array and the server host through a Fibre Channel switch, so as to establish an area network dedicated to data storage.
Optionally, in this embodiment, when the client uploads the image, the image upload request of the client may be received, then a create request is sent to the cloud disk management module, a first storage space is created in the storage area network by the cloud disk management module, then the first storage space is connected with the client, and after connection, image data of the client may be written into the first storage space. After the writing is completed, the connection is disconnected, and the mirror metadata is written into the database.
In the method, when the mirror image is stored, the creation request is sent to the cloud disk management module, the cloud disk management module sends the creation request to open up a first storage space in the storage area network, connection is established between the first storage space and the client, and the mirror image is written into the first storage space to store the mirror image, so that the purpose of improving the storage mirror image efficiency is achieved.
As an alternative embodiment, the processing module includes:
A first processing unit for disconnecting and writing the mirror metadata of the mirror data into the database when the writing of the last byte of the mirror data is completed, or
And the second processing unit is used for disconnecting after the writing of the last byte of the mirror image data is finished for a preset time period, and writing the mirror image metadata of the mirror image data into the database.
Alternatively, in this embodiment, if the target image is uploaded to the first storage space, the connection relationship may be disconnected immediately, or may be disconnected after a predetermined period of time. The immediate disconnection can reduce the bandwidth occupation, and the disconnection after a preset time can improve the accuracy of uploading the target image.
As an optional embodiment, the creating module includes:
The identifying unit is used for identifying a target field in the mirror image uploading request, wherein the target field is used for marking a target object for creating the first storage space;
And the sending unit is used for sending a creation request to the cloud disk management module when the target field indicates that the target object is the cloud disk management module.
In this embodiment, the storage location where the first storage space is to be allocated may be marked by a character flag in the allocation statement. For example, the allocation statement is parsed, character flags in the allocation statement are parsed, and if the character flags are target character flags, a first storage space is allocated in the storage area network. If the character indicator is a further character indicator, for example a first character indicator, a first memory space is allocated in the distributed network. For example, the character flag is a second character flag, then the first memory space is allocated in the direct memory access memory, and so on. By setting different character flags in the allocation statement, it is determined where to allocate the first storage space storage target image.
Optionally, in this embodiment, the location of the first storage space in the storage area network or the size of the first storage space may be determined according to the characters in the allocation statement. Different characters correspond to different positions or sizes.
As an alternative embodiment, the above device further comprises:
the configuration module is used for configuring the corresponding relation between the field and the object in the configuration file;
a storage module for storing the newly added corresponding relation in the configuration file when receiving the newly added instruction of the newly added corresponding relation, or
And the deleting module is used for deleting the corresponding relation indicated by the deleting instruction in the configuration file under the condition that the deleting instruction for deleting the corresponding relation is received.
Optionally, the configuration file in this embodiment includes an allocation statement, and the character flags in the allocation statement may be adjusted. In this embodiment, before the first storage space is allocated, the character flag in the allocation statement may be adjusted to be the target character flag, so that the adjusted allocation statement may be used to allocate the first storage space for the target image. The content in the configuration file may be modified according to the new instruction and the delete instruction.
As an alternative embodiment, the above device further comprises:
The system comprises an acquisition module, a storage module and a virtual machine management module, wherein the acquisition module is used for acquiring a creation request after mirror image data of a target mirror image of a local client is written into a first storage space, wherein the creation request is used for requesting to create the virtual machine;
A determining module, configured to determine a first image for creating a virtual machine from all images in the storage area network;
and the second creation module is used for creating the virtual machine by using the first image.
Alternatively, in this embodiment, after storing the target image in the first storage space, a creation request may be received, the creation request being for requesting creation of the virtual machine. After receiving a creation request to create a virtual machine, a corresponding image of the virtual machine to be created may be determined. Different images correspond to creating different virtual machines. And determining a first image to be created of the virtual machine according to the creation request, and then creating the virtual machine through the first image.
As an optional embodiment, the determining module includes:
The searching unit is used for searching the mirror image mark of the mirror image from all the mirror images in the storage area network according to the target mark of the mirror image contained in the creation request, and the mirror image mark of the mirror image is the same as the target mark;
and the determining unit is used for determining the searched image as a first image.
Alternatively, in this embodiment, the first image to be used for creating the virtual machine may be determined according to the target flag of the image included in the creation request. After the creation request is acquired, acquiring a target mark of the mirror image in the creation request, comparing the mark with the mirror image marks of all the mirror images, determining the mirror image with the same mark as the target mark from all the mirror images, and creating the virtual machine as a first mirror image.
As an optional embodiment, the second creating module includes:
And the mapping unit is used for mapping the first mirror image in the first storage space into the second storage space, thereby creating the virtual machine.
Optionally, in this embodiment, after determining to create the first image of the virtual machine, the first image is stored in the first storage space. The first image may be mapped into the second storage space to create a virtual machine.
According to a further aspect of embodiments of the present invention, there is also provided an electronic device for implementing the above-described storage area network mirror storage method, the electronic device may include a memory having a computer program stored therein, and a processor configured to execute the steps of the storage area network mirror storage method described above by the computer program.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps in the above-described storage area network mirrored storage method when run.
Alternatively, in this embodiment, all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing the terminal device related hardware, and the program may be stored in a computer readable storage medium, where the storage medium may include a flash disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (8)

1.一种镜像存储方法,其特征在于,包括:1. A mirror storage method, characterized by comprising: 接收客户端的镜像上传请求,其中,所述镜像上传请求用于请求上传目标镜像;Receiving an image upload request from a client, wherein the image upload request is used to request uploading of a target image; 向云磁盘管理模块发送创建请求,其中,所述创建请求用于请求所述云磁盘管理模块在存储区域网络中创建用于存储所述目标镜像的第一存储空间,所述第一存储空间在存储区域网络的位置或大小根据所述创建请求中的分配语句的字符确定;Sending a creation request to a cloud disk management module, wherein the creation request is used to request the cloud disk management module to create a first storage space in a storage area network for storing the target image, and the location or size of the first storage space in the storage area network is determined according to the characters of the allocation statement in the creation request; 在所述云磁盘管理模块创建所述第一存储空间后,将所述第一存储空间与所述客户端本地连接;After the cloud disk management module creates the first storage space, locally connecting the first storage space to the client; 将客户端本地的所述目标镜像的镜像数据写入到所述第一存储空间中;Writing the image data of the target image locally on the client into the first storage space; 在所述镜像数据写入完成后,断开所述第一存储空间与所述客户端本地的连接,将所述目标镜像的镜像元数据写入到数据库中;After the mirror data is written, disconnect the first storage space from the local client, and write the mirror metadata of the target mirror into the database; 其中,在将客户端本地的所述目标镜像的镜像数据写入到所述第一存储空间中之后,所述方法还包括:获取创建请求,其中,所述创建请求用于请求创建虚拟机;在所述存储区域网络中的所有镜像中,确定用于创建所述虚拟机的第一镜像;使用所述第一镜像创建所述虚拟机;After writing the image data of the target image locally on the client into the first storage space, the method further comprises: obtaining a creation request, wherein the creation request is used to request the creation of a virtual machine; determining a first image for creating the virtual machine from among all images in the storage area network; and creating the virtual machine using the first image; 所述使用所述第一镜像创建所述虚拟机包括:将所述第一存储空间中的所述第一镜像映射到第二存储空间中,从而创建所述虚拟机。The using the first image to create the virtual machine includes: mapping the first image in the first storage space to a second storage space, thereby creating the virtual machine. 2.根据权利要求1所述的方法,其特征在于,所述在所述镜像数据写入完成后,断开所述第一存储空间与所述客户端本地的连接,将所述目标镜像的镜像元数据写入到数据库中包括:2. The method according to claim 1, wherein after the mirror data is written, disconnecting the first storage space from the local client and writing the mirror metadata of the target mirror into the database comprises: 在所述镜像数据的最后一个字节写入完成时,断开所述连接,将所述镜像数据的镜像元数据写入到数据库中;或者When the writing of the last byte of the mirror data is completed, disconnect the connection and write the mirror metadata of the mirror data into the database; or 在所述镜像数据的最后一个字节写入完成后的预定时长后,断开所述连接,将所述镜像数据的镜像元数据写入到数据库中。After a predetermined time period after the last byte of the mirror data is written, the connection is disconnected, and the mirror metadata of the mirror data is written into the database. 3.根据权利要求1所述的方法,其特征在于,所述向云磁盘管理模块发送创建请求包括:3. The method according to claim 1, wherein sending a creation request to the cloud disk management module comprises: 识别所述镜像上传请求中的目标字段,其中,所述目标字段用于标志创建所述第一存储空间的目标对象;Identifying a target field in the image upload request, wherein the target field is used to mark a target object for creating the first storage space; 在所述目标字段指示所述目标对象为所述云磁盘管理模块的情况下,向所述云磁盘管理模块发送所述创建请求。In a case where the target field indicates that the target object is the cloud disk management module, the creation request is sent to the cloud disk management module. 4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. The method according to claim 3, characterized in that the method further comprises: 在配置文件中配置字段与对象的对应关系;Configure the correspondence between fields and objects in the configuration file; 在接收到新增所述对应关系的新增指令的情况下,将新增的对应关系保存到所述配置文件中;或者When receiving a new instruction for adding the corresponding relationship, saving the newly added corresponding relationship into the configuration file; or 在接收到删除所述对应关系的删除指令的情况下,将所述配置文件中删除指令所指示的对应关系删除。When a deletion instruction for deleting the corresponding relationship is received, the corresponding relationship indicated by the deletion instruction in the configuration file is deleted. 5.根据权利要求1所述的方法,其特征在于,所述在所述存储区域网络中的所有镜像中,确定用于创建所述虚拟机的第一镜像包括:5. The method according to claim 1, wherein determining the first image for creating the virtual machine among all images in the storage area network comprises: 根据所述创建请求中所包含的镜像的目标标志,在所述存储区域网络中的所有镜像中,查找镜像的镜像标志与所述目标标志相同的镜像;According to the target mark of the image included in the creation request, searching for an image whose image mark is the same as the target mark among all the images in the storage area network; 将查找到的镜像确定为所述第一镜像。The found image is determined as the first image. 6.一种镜像存储装置,其特征在于,包括:6. A mirror storage device, comprising: 接收模块,用于接收客户端的镜像上传请求,其中,所述镜像上传请求用于请求上传目标镜像;A receiving module, used to receive an image upload request from a client, wherein the image upload request is used to request uploading of a target image; 发送模块,用于向云磁盘管理模块发送创建请求,其中,所述创建请求用于请求所述云磁盘管理模块在存储区域网络中创建用于存储所述目标镜像的第一存储空间,所述第一存储空间在存储区域网络的位置或大小根据所述创建请求中的分配语句的字符确定;a sending module, configured to send a creation request to a cloud disk management module, wherein the creation request is used to request the cloud disk management module to create a first storage space in a storage area network for storing the target image, and a position or size of the first storage space in the storage area network is determined according to characters of an allocation statement in the creation request; 第一创建模块,用于在所述云磁盘管理模块创建所述第一存储空间后,将所述第一存储空间与所述客户端本地连接;A first creation module, configured to locally connect the first storage space to the client after the cloud disk management module creates the first storage space; 写入模块,用于将客户端本地的所述目标镜像的镜像数据写入到所述第一存储空间中;A writing module, used for writing the image data of the target image locally on the client into the first storage space; 处理模块,用于在所述镜像数据写入完成后,断开所述第一存储空间与所述客户端本地的连接,将所述目标镜像的镜像元数据写入到数据库中;A processing module, configured to disconnect the first storage space from the local client after the mirror data is written, and write the mirror metadata of the target mirror into a database; 其中,在将客户端本地的所述目标镜像的镜像数据写入到所述第一存储空间中之后,还包括:获取创建请求,其中,所述创建请求用于请求创建虚拟机;在所述存储区域网络中的所有镜像中,确定用于创建所述虚拟机的第一镜像;使用所述第一镜像创建所述虚拟机;After writing the image data of the target image locally on the client into the first storage space, the method further includes: obtaining a creation request, wherein the creation request is used to request the creation of a virtual machine; determining a first image for creating the virtual machine from among all the images in the storage area network; and creating the virtual machine using the first image; 所述使用所述第一镜像创建所述虚拟机包括:将所述第一存储空间中的所述第一镜像映射到第二存储空间中,从而创建所述虚拟机。The using the first image to create the virtual machine includes: mapping the first image in the first storage space to a second storage space, thereby creating the virtual machine. 7.一种计算机可读的存储介质,所述计算机可读的存储介质存储有计算机程序,其特征在于,所述计算机程序运行时执行所述权利要求1至5任一项中所述的方法。7. A computer-readable storage medium storing a computer program, wherein the computer program executes the method according to any one of claims 1 to 5 when the computer program is run. 8.一种电子设备,包括存储器和处理器,其特征在于,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述权利要求1至5任一项中所述的方法。8. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the method described in any one of claims 1 to 5 through the computer program.
CN202111415476.8A 2021-11-25 2021-11-25 Mirror image storage method, apparatus, storage medium and electronic device Active CN114168074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111415476.8A CN114168074B (en) 2021-11-25 2021-11-25 Mirror image storage method, apparatus, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111415476.8A CN114168074B (en) 2021-11-25 2021-11-25 Mirror image storage method, apparatus, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN114168074A CN114168074A (en) 2022-03-11
CN114168074B true CN114168074B (en) 2025-07-25

Family

ID=80480628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111415476.8A Active CN114168074B (en) 2021-11-25 2021-11-25 Mirror image storage method, apparatus, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114168074B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955219B (en) * 2023-09-13 2024-01-19 新华三信息技术有限公司 Data mirroring method, device, host and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101784990A (en) * 2007-08-14 2010-07-21 思科技术公司 Fast write operations to mirrored volumes in a volume manager
CN109634718A (en) * 2018-12-13 2019-04-16 无锡华云数据技术服务有限公司 The method and system of cloud platform creation mirror image

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7389312B2 (en) * 1997-04-28 2008-06-17 Emc Corporation Mirroring network data to establish virtual storage area network
US20090259817A1 (en) * 2001-12-26 2009-10-15 Cisco Technology, Inc. Mirror Consistency Checking Techniques For Storage Area Networks And Network Based Virtualization
CN1305265C (en) * 2003-11-07 2007-03-14 清华大学 Asynchronous remote mirror image method based on load selfadaption in SAN system
US20060218360A1 (en) * 2005-03-22 2006-09-28 Burkey Todd R Method, apparatus and program storage device for providing an optimized read methodology for synchronously mirrored virtual disk pairs
US7831750B2 (en) * 2007-01-31 2010-11-09 Hewlett-Packard Development Company, L.P. Method, apparatus and software for processing input or output requests for a mirrored storage volume

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101784990A (en) * 2007-08-14 2010-07-21 思科技术公司 Fast write operations to mirrored volumes in a volume manager
CN109634718A (en) * 2018-12-13 2019-04-16 无锡华云数据技术服务有限公司 The method and system of cloud platform creation mirror image

Also Published As

Publication number Publication date
CN114168074A (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN105933376B (en) A data manipulation method, server and storage system
US11157445B2 (en) Indexing implementing method and system in file storage
JP2012089094A5 (en)
CN107911461B (en) Object processing method in cloud storage system, storage server and cloud storage system
CN110688201B (en) Log management method and related equipment
CN106294352A (en) A kind of document handling method, device and file system
CN113853778A (en) Cloning method and device of file system
CN111355791A (en) File transmission method and device, computer equipment and storage medium
CN108205504A (en) Terminal USB mapping methods, virtual machine USB mapping methods and system
CN111803917B (en) Resource processing method and device
CN113918519A (en) A kind of folder mounting method, device and terminal device
CN114168074B (en) Mirror image storage method, apparatus, storage medium and electronic device
CN119441169B (en) Processing method and device for server log document
CN115840731A (en) File processing method, computing device and computer storage medium
CN114237806B (en) Page information display method and device, electronic equipment and storage medium
CN116821102B (en) Data migration method, device, computer equipment and storage medium
CN113905252B (en) Data storage method and device for live broadcasting room, electronic equipment and storage medium
CN107580038B (en) Expert recommendation method and system
CN117331890A (en) File mounting method and device
CN114675776B (en) Resource storage method and device, storage medium and electronic device
CN112347046B (en) Method for acquiring creation time of file in distributed system
CN111399759A (en) Method for reading data and writing data and object file system
CN114356674B (en) Card opening method, card opening device and computer readable storage medium
CN113419687B (en) Object storage method, system, equipment and storage medium
CN112464099B (en) Method, device, electronic equipment and medium for generating document based on query data

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
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载