CN114911580B - Mirror image state processing method and device and computing equipment - Google Patents

Mirror image state processing method and device and computing equipment Download PDF

Info

Publication number
CN114911580B
CN114911580B CN202210807419.2A CN202210807419A CN114911580B CN 114911580 B CN114911580 B CN 114911580B CN 202210807419 A CN202210807419 A CN 202210807419A CN 114911580 B CN114911580 B CN 114911580B
Authority
CN
China
Prior art keywords
mirror image
identification code
unique identification
mirror
task
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
CN202210807419.2A
Other languages
Chinese (zh)
Other versions
CN114911580A (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.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software 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 Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202210807419.2A priority Critical patent/CN114911580B/en
Publication of CN114911580A publication Critical patent/CN114911580A/en
Application granted granted Critical
Publication of CN114911580B publication Critical patent/CN114911580B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances

Abstract

The invention discloses a mirror image state processing method, a mirror image state processing device and computing equipment, relates to the technical field of virtual machine mirror images, and aims to solve the problems that the existing mirror image state processing technology is low in operation efficiency and prone to misoperation. The mirror image state processing method comprises the following steps: in response to receiving a mirror image query command of a client, querying whether a mirror image uploading task exists, wherein the mirror image uploading task is in a state of uploading failure and the mirror image cannot be deleted; if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code for the mirror image uploading task; and displaying the query result and the universal unique identification code to the client. The other mirror image state processing method further comprises the following steps on the basis of the mirror image state processing method: and deleting the mirror image file and the mirror image uploading task. The invention can inquire or delete the mirror image in the killed state by one key through two newly added CLI commands, thereby not only having high operation efficiency, but also not generating misoperation. The invention is used for inquiring and deleting the mirror image.

Description

Mirror image state processing method and device and computing equipment
Technical Field
The invention relates to the technical field of virtual machine mirror images, in particular to a mirror image state processing method, a mirror image state processing device and computing equipment.
Background
The OpenStack is an open-source cloud computing management platform project, and the company is an Image Service (Image Service) of the OpenStack, and is used for providing services of discovering, registering and acquiring a virtual machine Image and also providing a centralized storage function of the virtual machine Image. Representation state Transfer (REST) refers to representing resources by Uniform Resource Identifiers (URIs), representing operations on the resources by a hypertext Transfer Protocol (HTTP) method, and a company web of Newton version supports both REST style APIs of v1 and v2 (i.e., RESTful APIs), and mirror image data can be queried and images can be downloaded through the RESTful APIs.
Normally, the user directly enters the deleted state when the image uploading fails, for example, the system detects that the size of the image file is 0kb before the image uploading, which indicates that the file has a problem, and then directly enters the deleted state. However, in the Glance v1/v2 interface, when uploading images fails due to problems such as insufficient system space or network interruption, the system enters a killed state, in the killed state, programs cannot automatically enter a deleted state, and a user cannot search a Universal Unique Identifier (UUID) of the images through a Glance list command and then manually delete the images which fail to be uploaded by using a Glance list command, but only can search an ID of an image uploading task in a database, manually add the UUID to an image file, manually modify the state of the image uploading task into an active state, and then delete the images by using a delete command. The mirror image task deleting process in the killed state is complicated, and misoperation easily occurs in the two steps of manually adding the UUID and manually modifying the task state, so that the deletion of the current mirror image file is influenced, and the uploaded mirror image can be deleted successfully, and the usability of other mirror image files is influenced.
In summary, for the image uploading task in the deleted state, the existing image state processing technology needs manual operation to delete the image file which fails to be uploaded, so that not only is the operation efficiency low, but also misoperation is easy to occur.
Disclosure of Invention
To this end, the present invention provides a mirror state processing method, apparatus and computing device in an effort to solve or at least alleviate at least one of the problems identified above.
According to an aspect of the present invention, there is provided a mirror state processing method, including: in response to receiving a mirror image query command of a client, querying whether a mirror image uploading task exists, wherein the mirror image uploading task is in a state of uploading failure and the mirror image cannot be deleted; if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code to the mirror image uploading task; and displaying the query result and the universal unique identification code to the client.
Optionally, in the mirror image state processing method according to the present invention, adding a universal unique identifier to the mirror image upload task includes: generating a universal unique identification code for each mirror image uploading task which fails to upload and cannot be deleted by the mirror image; and adding the universal unique identification code to a database field corresponding to the universal unique identification code.
According to another aspect of the present invention, there is provided another mirror state processing method, including: in response to receiving a mirror image deleting command of a client, inquiring whether a mirror image uploading task with a state of uploading failure and a mirror image incapable of being deleted exists; if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code for the mirror image uploading task; and deleting the mirror image file and the mirror image uploading task.
Optionally, in the mirror image state processing method according to the present invention, adding a universal unique identifier to the mirror image upload task includes: generating a universal unique identification code for each mirror image uploading task which fails to upload and cannot be deleted by the mirror image; and adding the universally unique identification code to a database field corresponding to the universally unique identification code.
Optionally, in the mirror image state processing method according to the present invention, the generating a universal unique identifier for each mirror image upload task that fails to upload and cannot be deleted by a mirror image includes: and sequentially generating a universal unique identification code for each image uploading task which fails to upload and cannot be deleted according to the current time.
Optionally, in the mirror image state processing method according to the present invention, deleting the mirror image file includes: inquiring the storage directory and the authority information of the mirror image file; releasing the authority of the mirror image file according to the authority information; and deleting the image file.
Optionally, in the mirror state processing method according to the present invention, further comprising: and displaying the deleted information to the client.
According to still another aspect of the present invention, there is provided a mirror state processing apparatus including: the first task query unit is suitable for responding to a received mirror image query command of the client and querying whether a mirror image uploading task with the state of uploading failure and the state of not deleting the mirror image exists or not; the first universal unique identification code adding unit is suitable for adding a universal unique identification code to a mirror image uploading task if the uploading fails and the mirror image uploading task cannot be deleted; and the first display unit is suitable for displaying the query result and the universal unique identification code to the client.
According to still another aspect of the present invention, there is provided a mirror state processing apparatus including: the second task query unit is suitable for responding to a received mirror image deletion command of the client and querying whether a mirror image uploading task with the state of uploading failure and the state of not deleting the mirror image exists; the second universal unique identification code adding unit is suitable for adding a universal unique identification code to a mirror image uploading task if the mirror image uploading task fails and the mirror image cannot be deleted; and the deleting unit is suitable for deleting the mirror image file and the mirror image uploading task.
According to yet another aspect of the present invention, there is also provided a computing device comprising: at least one processor and a memory storing program instructions; the program instructions, when read and executed by a processor, cause the computing device to perform any of the mirror state processing methods described above.
According to still another aspect of the present invention, there is also provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to execute any of the mirror state processing methods as described above.
After receiving a mirror image query command of a client, the mirror image state processing method directly queries a mirror image uploading task with a killed state in a database, and automatically adds a UUID to the queried mirror image uploading task; after receiving a mirror image deleting command of a client, directly inquiring a mirror image uploading task with a killed state in a database, and directly deleting the mirror image uploading task and a mirror image file.
According to the mirror image state processing method, the mirror image state processing device and the computing equipment, at least one of the following beneficial effects can be realized: through the newly added CLI command, when a user inquires and deletes the mirror image uploading task with the killed state, the user does not need to manually modify the task state attribute in the database, and only needs to execute a mirror image inquiring command to complete the inquiry, so that the user can delete the mirror image uploading task and the mirror image file through the glance delete command; when the user deletes the mirror image uploading task and the mirror image file in the killed state, the user only needs to execute a mirror image deleting command to complete the deletion of the mirror image task and the mirror image file, so that the operation efficiency is improved, the misoperation caused when the mirror image uploading task and the mirror image file in the killed state are manually deleted is avoided, and the operation safety is improved.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 illustrates a flow diagram of deleting a mirror in the prior art;
FIG. 2 illustrates a schematic diagram of a mirror upload system 200, according to one embodiment of the present invention;
FIG. 3 shows a schematic diagram of a computing device 300, according to one embodiment of the invention;
FIG. 4 illustrates a flow diagram of a mirror state processing method 400 according to one embodiment of the invention;
FIG. 5 illustrates a flow diagram of another mirror state processing method 500 according to one embodiment of the invention;
FIG. 6 illustrates a flowchart for using an OpenStack delete mirror with the addition of a create kill delete command and a create kill list command, according to one embodiment of the present invention;
FIG. 7 shows a schematic diagram of a mirror state processing apparatus 700 according to an embodiment of the invention;
fig. 8 shows a schematic diagram of another mirror state processing apparatus 800 according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The image uploading task in OpenStack includes the following 6 states: state 1: queue, indicating that the image ID has been reserved, but the image has not been uploaded; state 2: saving, indicating that the image is being uploaded; state 3: active, which indicates that the uploading action is in progress and is not completed yet, and the mirror image is fully available in the work; and 4: killed, which indicates that the mirror image is completely unavailable due to error in the process of uploading the mirror image; and state 5: delete, indicating that the angle already holds the information of the image but cannot be used continuously, and the image in this state will be automatically cleared later; and 6, state: pending _ delete, like deleted, differs from deleted in that the mirror data has not been removed by the angle, and the mirror in this state can be restored. When a user uploads the mirror image, a kill, deleted or pending _ deleted state represents that the mirror image uploading fails; while active status only indicates that the image is available and can be deleted via the angle delete command.
As shown in fig. 1, in the prior art, a user uploads a virtual mirror image, and first needs to input a mirror image creation command, that is, a work create command, after the system executes the work create command, a mirror image upload task is created and waits for uploading, and at this time, the mirror image upload task is in a queued state; then, waiting and checking whether the mirror image is created successfully, namely checking whether the mirror image uploading task is in a saving state; if the mirror image uploading task is in the saving state, the user can inquire the mirror image uploading task through the company list and then change the state of the mirror image uploading task into active; then, the user can use the uploaded image file normally, and can delete the image file through a gloss delete command; if the network is interrupted or the storage space is insufficient in the uploading process, the mirror image uploading is failed, the state of the mirror image uploading task is changed into killed, and the system cannot record attributes such as UUID (user identifier) and authority of the mirror image, so that the mirror image uploading task cannot be inquired by using a work list command, if a user needs to delete the mirror image file, a table field corresponding to the mirror image uploading task can only be searched in a database, one UUID is added into the table field, the state attribute is modified into active in the table field, and then the mirror image file is deleted by using a work delete command.
The invention provides a mirror image state processing method, which aims to solve the problems that the prior mirror image state processing technology can not directly delete the mirror image file of the mirror image uploading task in the deleted state by using a command, not only has low operation efficiency, but also is easy to cause misoperation.
FIG. 2 shows a schematic diagram of a mirror upload system 200, according to one embodiment of the present invention.
As shown in fig. 2, the image upload system 200 includes a server 210 and one or more clients 220. The server 210 is communicatively connected to one or more clients 220, respectively, for example, through a wired or wireless network connection.
It should be noted that the present invention is not limited to the specific categories of the server 210 and the client 220. For example, the server 210 may be implemented as a desktop computer, a notebook computer, a processor chip, a mobile phone, a tablet computer, or other computing devices, and at this time, the server 210 should be installed with an OpenStack; the server 210 may also be an application program residing on a computing device, in which case the server 210 is an OpenStack. The client 220 can also be implemented as a desktop computer, a notebook computer, a processor chip, a mobile phone, a tablet computer, or other computing devices, and at this time, the client 220 may or may not install OpenStack; client 220 may also be an application program residing on a computing device, in which case client 220 is an OpenStack.
In an embodiment of the present invention, the server 210 is adapted to execute two mirror state processing methods. The user uploads the mirror image through the OpenStack or the browser at the client 220, and if the mirror image uploading fails, the user inputs a mirror image query command or a mirror image deletion command at the client 220, and the server 210 executes corresponding operations to realize processing of the mirror image state. The mirror state processing method 400 and the mirror state processing method 500 of the present invention will be described in detail below.
In one embodiment, the server 210 of the present invention can be implemented as a computing device, so that the two mirror state processing methods of the present invention can be executed in the computing device. The computing device may be any device with storage and computing capabilities, and may be implemented as, for example, a server, a workstation, or the like, or may be implemented as a personal computer such as a desktop computer or a notebook computer, or may be implemented as a terminal device such as a mobile phone, a tablet computer, a smart wearable device, or an internet of things device, but is not limited thereto.
FIG. 3 shows a schematic diagram of a computing device 300, according to one embodiment of the invention. It should be noted that the computing device 300 shown in fig. 3 is only an example, and in practice, the computing device for implementing the image state processing method of the present invention may be any type of device, and the hardware configuration thereof may be the same as the computing device 300 shown in fig. 3 or different from the computing device 300 shown in fig. 3. In practice, the computing device for implementing the mirror state processing method of the present invention may add or delete hardware components of the computing device 300 shown in fig. 3, and the present invention does not limit the specific hardware configuration of the computing device.
As shown in fig. 3, the computing device 300 includes a memory 310 and a processor 320, with communication between the memory 310 and the processor 320 via a bus. Memory 310 includes OpenStack, program instructions to perform mirror state processing method 400 and mirror state processing method 500. Processor 320 reads these program instructions to perform mirror state processing method 400 and/or mirror state processing method 500.
Depending on the desired configuration, processor 320 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a digital information processor (DSP), or any combination thereof.
Computing device 300 may be implemented as a server, such as a file server, database server, application server, WEB server, and the like, or as a personal computer including desktop and notebook computer configurations. Of course, computing device 300 may also be implemented as part of a small-sized portable (or mobile) electronic device. In an embodiment in accordance with the invention, the computing device 300 is configured to perform the mirror state processing method 400 and/or the mirror state processing method 500 in accordance with the invention.
A mirror state processing method 400 according to an embodiment of the present invention includes: in response to receiving a mirror image query command from the client 220, querying whether a mirror image upload task exists, wherein the mirror image upload task is in a state of upload failure and cannot be deleted; if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code for the mirror image uploading task; and displaying the query result and the universal unique identification code to the client 220.
The method 400 may be written as a script, with the script name being a query script. After the user inputs the angle kill list command at the client 220, the server 210 runs the query script.
FIG. 4 illustrates a flow diagram of a mirror state processing method 400 according to one embodiment of the invention. Method 400 is performed in a computing device, such as computing device 300 described previously. As shown in fig. 4, the method 400 begins at step 410.
In step 410, in response to receiving the mirror image query command from the client, it is queried whether there is a mirror image upload task whose upload status is failure and the mirror image cannot be deleted.
It should be noted that the non-deletable means that the deletion cannot be performed by using the angle delete command, and the image upload task in which the upload fails and the image cannot be deleted refers to an image upload task in a kill state in the embodiment of the present invention.
The mirror query Command, the angle kill list, belongs to a Command-Line Interface (CLI), and is different from the angle kill list in that: the work list firstly queries the UUID of the mirror image uploading task, then queries other information of the mirror image uploading task, and if the UUID of the mirror image uploading task cannot be queried, any information of the mirror image uploading task cannot be queried; the gan killlist does not need to query the UUID of the image uploading task, but directly queries whether the image uploading task in the state of kille exists in all the image uploading tasks.
After the client 220 uploads the mirror image through the OpenStack or the browser, the user can input a work kill list command, at this time, the client 220 pushes the work kill list command to the server 210, the server 210 runs the work kill list command, and a database field is searched.
Next, in step 420, if there is a mirror image upload task that fails to upload and cannot be deleted by the mirror image, a universal unique identification code is added to the mirror image upload task.
If the query in step 410 is that there is an image upload task with a kill state, first, a UUID needs to be generated for each image upload task with a kill state, and then the generated UUID is added to the data row where the corresponding kill database field is located.
The generation mode of the UUID is not limited, and in principle, the requirement can be met as long as the repetition rate of the generated UUID and the existing UUID is low.
According to one implementation mode, for each mirror image uploading task with a kill state, a universal unique identification code is generated according to the current time, for example, a current timestamp is encrypted, and the encryption result is used as a UUID of the mirror image uploading task. In this implementation, a UUID is first generated for the image upload task with the first state of killed queried in step 410, and the generation method of the UUID is as follows: encrypting the current timestamp by adopting an MD5 encryption algorithm, taking an encryption result (namely an MD5 value) as a UUID, and then adding the UUID into the data row of the mirror image uploading task with the first state of killed in the database; next, taking the MD5 value of the current timestamp as a UUID, and adding the UUID into a data row of a second mirror image uploading task with a killed state in the database; by analogy, the UUID of each mirror image uploading task with the kill state corresponds to the time for generating the UUID one by one, and therefore each generated UUID is unique.
Next, in step 430, the query result and the universally unique identification code are displayed to the client. The server 210 pushes the query results of step 410 and the UUID corresponding to each query result to the client 220 for presentation to the user. Specifically, the mirror image upload task in the state of killed can be displayed on the client 220 by calling a related function of the work list command.
The method 400 can automatically add a UUID to the image uploading task in the killed state, so that the user can delete the image which fails to be uploaded through the work delete command.
Another mirror state processing method 500 is also provided by an embodiment of the present invention. The mirror state processing method 500 according to the embodiment of the present invention includes: in response to receiving a mirror image deleting command of a client, inquiring whether a mirror image uploading task with a state of uploading failure and a mirror image incapable of being deleted exists; if a mirror image uploading task which fails to upload and cannot be deleted by the mirror image exists, adding a universal unique identification code for the mirror image uploading task; and deleting the mirror image uploading task and the mirror image file.
The method 500 may be written as a script, with the script name being a delete script. After the user inputs the angle kill delete command at the client 220, the server 210 runs the delete script.
FIG. 5 illustrates a flow diagram of another mirror state processing method 500 according to one embodiment of the invention. Method 500 is performed in a computing device, such as computing device 300 described previously. As shown in fig. 5, the method 500 begins at step 510.
In step 510, in response to receiving the image deletion command from the client, it is queried whether there is an image upload task whose upload status is failure and the image cannot be deleted.
The mirror delete Command, the create kill delete, belongs to the Command-Line Interface (CLI). After the client 220 uploads the image through the OpenStack or the browser, the user may input a glance kill delete command, at this time, the client 220 pushes the glance kill delete command to the server 210, and the server 210 runs the glance kill delete command, which includes two functions of querying and deleting. Firstly, whether the mirror image uploading task with the kill state exists in all the mirror image uploading tasks is inquired.
Next, in step 520, if there is a mirror image upload task that fails to upload and cannot be deleted by the mirror image, a universal unique identification code is added to the mirror image upload task. That is, if the query in step 510 is that there is an image upload task with a kill state, a UUID needs to be generated for each image upload task with a kill state, and then the generated UUID is added to the data row where the corresponding kill database field is located.
The generation mode of the UUID is not limited, and in principle, the requirement can be met as long as the repetition rate of the generated UUID and the existing UUID is low.
According to one implementation mode, for each mirror image uploading task with a kill state, a universal unique identification code is generated according to the current time, for example, a current timestamp is encrypted, and the encryption result is used as a UUID of the mirror image uploading task. In this implementation, a UUID is first generated for the image upload task with the first state of kill queried in step 510, where the generation method of the UUID is as follows: encrypting the current timestamp by adopting an MD5 encryption algorithm, taking an encryption result (namely an MD5 value) as a UUID, and then adding the UUID into the data row of the mirror image uploading task with the first state of killed in the database; next, taking the MD5 value of the current timestamp as a UUID, and adding the UUID into a data row of a second mirror image uploading task with a killed state in the database; by analogy, the UUID of each mirror image uploading task with the kill state corresponds to the time for generating the UUID one by one, and therefore each generated UUID is unique.
In one embodiment, the query results and the universally unique identification code may also be displayed to the client 220. The server 210 pushes the query results of step 510 and the UUID corresponding to each query result to the client 220 for presentation to the user. Specifically, the mirror image upload task in the state of killed can be displayed on the client 220 by calling a related function of the work list command.
Next, in step 530, the image file and image upload task are deleted.
The process of searching the mirror image file is equivalent to comparing the file name, the storage directory and the authority information in a key value in a database so as to search a unique value. However, the file name of the mirror image file may be duplicated, and the UUID of the mirror image file is unique, so that the file name, the storage directory and the authority information of the mirror image file of the file are searched from the database by taking the UUID as an index.
According to one implementation, deleting the image file may be performed as follows: the method comprises the steps of firstly inquiring the file name, the storage directory and the authority information of an image file according to a UUID, wherein the authority information records which users can use the image file and which users can process (for example, delete) the image file, and the like, then releasing the authority of the image file, emptying data in the storage directory, deleting the storage directory, and completing the deletion of the image file.
And after the image file is deleted, deleting the image uploading task from the image uploading task table.
In one embodiment, the method 500 further comprises: the deleted information is displayed to the client 220. This step pushes the deleted state of the mirrored task, the mirrored UUID, the mirrored filename, and the mirrored storage directory together to the client 220 for presentation to the user.
The method 500 can inquire and automatically delete the mirror image uploading task and the mirror image file in the killed state, so that misoperation caused by manual modification operation in the deleting process of a user is avoided, and the operation safety is improved.
The flow of using OpenStack delete/query images with the addition of the work kill delete and work kill list commands is shown in FIG. 6. A user uploads a virtual mirror image, firstly, a work create command needs to be input, after the system executes the work create command, a mirror image uploading task is created and waits for uploading, and at the moment, the mirror image uploading task is in a queue state; then, waiting and checking whether the mirror image is created successfully, namely checking whether the mirror image uploading task is in a saving state; if the mirror image uploading task is in the saving state, the user can inquire the mirror image uploading task through the company list and then change the state of the mirror image uploading task into active; then, the user can use the uploaded image file normally, and can delete the image file through a gloss delete command; if the network is interrupted or the storage space is insufficient in the uploading process, the mirror image uploading is failed, the state of the mirror image uploading task is changed into killed, if the user needs to delete the mirror image file, only a glance killdelete command needs to be input, and if the user needs to inquire the mirror image uploading task, only a glance killlist command needs to be input.
In this embodiment, two new CLI commands are added to the work create command directory of OpenStack: the glance kill list command and the glance kill delete command. Through the gan killlist command, a user can directly inquire the mirror image uploading task with the kill state, and the gan killlist command can automatically add UUIDs to the inquired mirror image uploading task, so that the user can inquire or process the mirror image uploading tasks in the future. The work kill sale command is packaged on the basis of the work kill sale command, and through the work kill sale command, a user can directly delete the mirror image uploading task in the state of kill and the corresponding mirror image file. The two CLI commands can support all versions of openstack, can realize automatic deployment on an operating system, are suitable for open source Linux systems such as CentoS, Fedora, Ubuntu and the like, and are suitable for central processing units of x86_64, aarch64, sea lights, megacores, loons and the like.
Embodiments of the present invention also provide a mirror state processing apparatus 700 capable of performing the steps of the mirror state processing method 400 as described above. Next, the mirror state processing apparatus 700 described above is described with reference to fig. 7.
As shown in fig. 7, the mirror state processing apparatus 700 includes a first task query unit 710, a first universally unique identifier adding unit 720, and a first display unit 730.
The first task querying unit 710 is adapted to query whether there is a mirror image uploading task whose status is uploading failure and the mirror image cannot be deleted, in response to receiving the mirror image querying command of the client 220.
The first universal unique identification code adding unit 720 is adapted to add a universal unique identification code to the mirror image uploading task if there is a mirror image uploading task that fails to upload and the mirror image cannot be deleted.
The first display unit 730 is adapted to display the query result and the universally unique identification code to the client 220.
According to one implementation of the present invention, the first universally unique identification code adding unit 720 includes a first universally unique identification code generating subunit and a first universally unique identification code adding subunit.
The first universal unique identification code generation subunit is suitable for generating a universal unique identification code for each image uploading task which fails to upload and cannot delete the image if the image uploading task which fails to upload and cannot delete the image exists.
The first universally unique identification number adding subunit is adapted to add the universally unique identification number to the database field corresponding to the universally unique identification number.
Embodiments of the present invention also provide another mirror state processing apparatus 800 capable of performing the steps of the mirror state processing method 500 as described above. Next, the mirror state processing apparatus 800 described above is described with reference to fig. 8.
As shown in fig. 8, the mirror state processing apparatus 800 includes a second task inquiry unit 810, a second common unique identification code adding unit 820, and a deleting unit 830.
The second task querying unit 810 queries whether a mirror image uploading task whose uploading fails and the mirror image cannot be deleted exists in response to receiving a mirror image deleting command of the client.
The second universal unique identification code adding unit 820 is adapted to add a universal unique identification code to the mirror image uploading task if there is a mirror image uploading task which fails to upload and the mirror image cannot be deleted.
The deletion unit 830 is adapted to delete the image file and the image upload task.
According to one implementation of the present invention, the second universal unique identification code adding unit 820 includes a second universal unique identification code generating sub-unit and a second universal unique identification code adding sub-unit.
The second universal unique identification code generation subunit is suitable for generating a universal unique identification code for each image uploading task which fails to upload and cannot delete the image if the image uploading task which fails to upload and cannot delete the image exists.
The second universal unique identification code adding subunit is adapted to add the universal unique identification code to the database field corresponding to the universal unique identification code.
According to one implementation mode of the invention, the second universal unique identification code generation subunit generates the universal unique identification code for each image uploading task which fails to upload and the image cannot be deleted by the following modes: and sequentially generating a universal unique identification code for each image uploading task which fails to upload and cannot be deleted according to the current time.
According to one implementation manner of the present invention, the deletion unit 830 implements deletion of the image file by:
inquiring a storage directory and authority information of the mirror image file;
releasing the authority of the mirror image file according to the authority information; and
and deleting the mirror image file.
According to one implementation of the invention, the apparatus 800 further comprises a second display unit. The second display unit is adapted to display the deleted information to the client 220.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute any of the mirror state processing methods of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose preferred embodiments of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.

Claims (9)

1. A mirror state processing method includes:
responding to a mirror image query command received from a client, and querying whether a mirror image uploading task with a state of uploading failure and a mirror image incapable of being deleted exists, wherein the incapable of being deleted refers to the incapable of being deleted by using a angle delete command;
if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code for the mirror image uploading task;
displaying the query result and the universal unique identification code to the client;
the mirror image query command belongs to a command line tool, does not need to query a universal unique identification code of a mirror image uploading task, and directly queries whether a mirror image uploading task in a killed state exists in all the mirror image uploading tasks or not;
adding a universal unique identification code for the mirror image uploading task comprises:
generating a universal unique identification code for each mirror image uploading task which fails to upload and cannot be deleted by the mirror image; and
adding the universally unique identification code to a database field corresponding to the universally unique identification code.
2. A mirror state processing method includes:
in response to receiving a mirror image deleting command of a client, inquiring whether a mirror image uploading task with a state of uploading failure and a mirror image incapable of being deleted exists, wherein the incapable of being deleted refers to the incapable of being deleted by using a angle delete command;
if a mirror image uploading task which fails to upload and cannot be deleted by a mirror image exists, adding a universal unique identification code for the mirror image uploading task;
deleting the mirror image file and the mirror image uploading task;
the mirror image deleting command belongs to a command line tool, and comprises two functions of inquiring and deleting;
adding a universal unique identification code for the mirror image uploading task comprises:
generating a universal unique identification code for each mirror image uploading task which fails to upload and cannot be deleted by the mirror image; and
adding the universally unique identification code to a database field corresponding to the universally unique identification code.
3. The image state processing method according to claim 2, wherein the generating a universally unique identification code for each image upload task that has failed to upload and cannot be deleted by an image comprises:
and sequentially generating a universal unique identification code for each image uploading task which fails to upload and cannot be deleted according to the current time.
4. The mirror state processing method according to claim 2 or 3, wherein deleting the mirror file comprises:
inquiring the storage directory and the authority information of the mirror image file;
releasing the authority of the mirror image file according to the authority information; and
and deleting the mirror image file.
5. The mirror state processing method according to claim 2, further comprising:
and displaying the deleted information to the client.
6. A mirror state processing apparatus comprising:
the first task query unit is suitable for responding to a received mirror image query command of a client and querying whether a mirror image uploading task with the state of uploading failure and the state of not deleting a mirror image exists, wherein the not deleting refers to not deleting by using a pane delete command;
the first universal unique identification code adding unit is suitable for adding a universal unique identification code to a mirror image uploading task if the uploading fails and the mirror image uploading task cannot be deleted;
the first display unit is suitable for displaying the query result and the universal unique identification code to the client;
the mirror image query command belongs to a command line tool, does not need to query a universal unique identification code of a mirror image uploading task, and directly queries whether a mirror image uploading task in a killed state exists in all the mirror image uploading tasks or not;
the first universally unique identification code adding unit includes:
the first universal unique identification code generation subunit is suitable for generating a universal unique identification code for each image uploading task which fails to upload and cannot delete images if the image uploading tasks which fail to upload and cannot delete images exist; and
and the first universal unique identification code adding subunit is suitable for adding the universal unique identification code into the database field corresponding to the universal unique identification code.
7. A mirror state processing apparatus comprising:
the second task query unit is suitable for responding to a received mirror image deletion command of the client and querying whether a mirror image uploading task with the state of uploading failure and the state of not deleting the mirror image exists, wherein the not deleting refers to the not deleting by using a angle delete command;
the second universal unique identification code adding unit is suitable for adding a universal unique identification code to the mirror image uploading task if the mirror image uploading task fails and the mirror image cannot be deleted;
the deleting unit is suitable for deleting the mirror image file and the mirror image uploading task;
the mirror image deleting command belongs to a command line tool, and comprises two functions of inquiring and deleting;
the second universal unique identification code adding unit includes:
the second universal unique identification code generation subunit is suitable for generating a universal unique identification code for each image uploading task which fails to upload and cannot delete the image if the image uploading task which fails to upload and cannot delete the image exists; and
and the second universal unique identification code adding subunit is suitable for adding the universal unique identification code into the database field corresponding to the universal unique identification code.
8. A computing device, comprising:
at least one processor and a memory storing program instructions;
the program instructions, when read and executed by the processor, cause the computing device to perform the mirror state processing method of claim 1 or the mirror state processing method of any of claims 2-5.
9. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the mirror state processing method of claim 1 or the mirror state processing method of any of claims 2-5.
CN202210807419.2A 2022-07-11 2022-07-11 Mirror image state processing method and device and computing equipment Active CN114911580B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210807419.2A CN114911580B (en) 2022-07-11 2022-07-11 Mirror image state processing method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210807419.2A CN114911580B (en) 2022-07-11 2022-07-11 Mirror image state processing method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN114911580A CN114911580A (en) 2022-08-16
CN114911580B true CN114911580B (en) 2022-09-27

Family

ID=82772006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210807419.2A Active CN114911580B (en) 2022-07-11 2022-07-11 Mirror image state processing method and device and computing equipment

Country Status (1)

Country Link
CN (1) CN114911580B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111629058A (en) * 2020-05-27 2020-09-04 广东浪潮大数据研究有限公司 Mirror image uploading method, device and system and back-end equipment
CN113296888A (en) * 2021-04-27 2021-08-24 优刻得科技股份有限公司 Mirror image processing method and system
CN113411363A (en) * 2020-03-16 2021-09-17 华为技术有限公司 Uploading method of image file, related equipment and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060218010A1 (en) * 2004-10-18 2006-09-28 Bioveris Corporation Systems and methods for obtaining, storing, processing and utilizing immunologic information of individuals and populations

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113411363A (en) * 2020-03-16 2021-09-17 华为技术有限公司 Uploading method of image file, related equipment and computer storage medium
CN111629058A (en) * 2020-05-27 2020-09-04 广东浪潮大数据研究有限公司 Mirror image uploading method, device and system and back-end equipment
CN113296888A (en) * 2021-04-27 2021-08-24 优刻得科技股份有限公司 Mirror image processing method and system

Also Published As

Publication number Publication date
CN114911580A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
US11010240B2 (en) Tracking status and restarting distributed replication
US11349915B2 (en) Distributed replication and deduplication of an object from a source site to a destination site
US9311326B2 (en) Virtual file system for automated data replication and review
US9213607B2 (en) Systems, methods, and media for synthesizing views of file system backups
CA2933821C (en) System and method for uploading and management of contract-research-organization data to a sponsor company's electronic laboratory notebook
US10409694B2 (en) Data conversion method and backup server
US20100082713A1 (en) Method and system for attaching files to e-mail from backup copies remotely stored
CN104866391B (en) A kind of end message backup method and device based on increment information system
US9135266B1 (en) System and method for enabling electronic discovery searches on backup data in a computer system
US10467424B2 (en) File system content based security
US20140075301A1 (en) Information processing apparatus, control method, and recording medium
US20200356445A1 (en) Efficient backup, search and restore
CN109144785A (en) Method and apparatus for Backup Data
US8341127B1 (en) Client initiated restore
US10855750B2 (en) Centralized management of webservice resources in an enterprise
CN105227672A (en) The method and system that data store and access
CN116627721A (en) Cloud primary database recovery method, device and storage medium based on hybrid cloud
US20170140009A1 (en) Caching linked queries for optimized compliance management
CN114911580B (en) Mirror image state processing method and device and computing equipment
JP2006031608A (en) Computer, storage system, file management method which computer performs, and program
CN115277677B (en) Batch file hanging method and device, computer equipment and storage medium
CN105653566B (en) A kind of method and device for realizing database write access
TWI571754B (en) Method for performing file synchronization control, and associated apparatus
CN114443166B (en) Shared file processing method, device and medium
JP6568232B2 (en) Computer system and device management method

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