CN114443229A - Mirror image file mounting method and device, electronic equipment and storage medium - Google Patents

Mirror image file mounting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114443229A
CN114443229A CN202210111974.1A CN202210111974A CN114443229A CN 114443229 A CN114443229 A CN 114443229A CN 202210111974 A CN202210111974 A CN 202210111974A CN 114443229 A CN114443229 A CN 114443229A
Authority
CN
China
Prior art keywords
target
file
mounting
control command
image file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210111974.1A
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210111974.1A priority Critical patent/CN114443229A/en
Publication of CN114443229A publication Critical patent/CN114443229A/en
Pending legal-status Critical Current

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/45537Provision of facilities of other operating environments, e.g. WINE

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a mounting method and device of an image file, electronic equipment and a storage medium. The method comprises the following steps: acquiring a file mounting request, and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation; inquiring target file information corresponding to the target image file by using the target identification code; extracting the host type of the target host corresponding to the target image file based on the target file information; and generating a control command corresponding to the host type, and sending the control command to a virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command. The method provided by the application can generate different control commands according to the host type of the host corresponding to the target image file, so that the aim of mounting the ISO images on various different types of hosts is achieved, and the problem that the image mounting cannot be achieved under a mixed framework in the prior art is solved.

Description

Mirror image file mounting method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for mounting an image file, an electronic device, and a storage medium.
Background
When the hypervisor mounts the iso image to the virtual machine, it needs to simulate an optical drive controller for the virtual machine, and on the platform of x86 architecture, the type of the optical drive controller is IDE. But on the arm architecture platform, hypervisor cannot emulate IDE devices. Therefore, the virtual machine on the arm architecture platform cannot be suitable for the ISO mirror mount function, and cannot realize mirror mount under the hybrid architecture.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present application provides a method and an apparatus for mounting an image file, an electronic device, and a storage medium.
According to an aspect of an embodiment of the present application, there is provided a method for mounting an image file, including:
acquiring a file mounting request, and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation;
inquiring target file information corresponding to the target image file by using the target identification code;
extracting the host type of the target host corresponding to the target image file based on the target file information;
and generating a control command corresponding to the host type, and sending the control command to a virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command.
Further, the analyzing the file mount request to obtain a target identification code corresponding to a target image file to be mounted includes:
analyzing the file mounting request, and determining a file format corresponding to a target mirror image file to be subjected to mounting operation;
and under the condition that the file format is the ISO format, calling a file mounting interface corresponding to the ISO format, and reading the target identification code corresponding to the target image file from the file mounting request based on the file mounting interface.
Further, the querying, by using the target identification code, file information corresponding to the target image file includes:
generating a query request based on the target identification code;
and sending the query request to image management equipment so that the image management equipment queries target file information corresponding to the target identification code based on the target identification code carried in the query request, wherein the image management equipment stores the corresponding relation between the identification code and the file information.
Further, the extracting the host type of the target host corresponding to the target image file based on the target file information includes:
analyzing the target file information to obtain a storage address corresponding to the target image file;
determining a target host corresponding to the target image file based on the storage address, and determining a host type corresponding to the target host, wherein the host type comprises: x86 type and SCSI type.
Further, the generating a control command corresponding to the host type includes:
determining a first file format corresponding to the X86 type when the host type is the X86 type;
and generating a control command corresponding to the IDE controller based on the first file format and the target file information.
Further, the generating the control command corresponding to the host type includes:
determining a second file format corresponding to the SCSI type under the condition that the host type is the SCSI type;
and generating a control command corresponding to the SCSI controller based on the second file format and the target file information.
Further, the sending the control command to a virtual machine monitor to enable the virtual machine monitor to perform a mount operation based on the control command includes:
sending the control command to a virtualization engine so that the virtualization engine analyzes the control command to obtain a target mounting command in a target format, transmitting the target mounting command in the target format to the virtual machine monitor, and executing mounting operation according to the target mounting command in the target format through the virtual machine monitor, wherein the target format is a format supported by the virtual machine monitor.
According to still another aspect of the embodiments of the present application, there is provided an apparatus for mounting an image file, including:
the acquisition module is used for acquiring a file mounting request and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation;
the query module is used for querying file information corresponding to the target image file by using the target identification code;
the extraction module is used for extracting the host type of the target host corresponding to the target mirror image file based on the file information;
and the generating module is used for generating a control command corresponding to the host type and sending the control command to a virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the method provided by the application can generate different control commands according to the host type of the host corresponding to the target image file, so that the aim of mounting the ISO images on various different types of hosts is achieved, and the problem that the image mounting cannot be achieved under a mixed framework in the prior art is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flowchart of a method for mounting an image file according to an embodiment of the present application;
fig. 2 is a frame diagram of mounting an image file according to an embodiment of the present application;
fig. 3 is a block diagram of an apparatus for mounting an image file according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments, and the illustrative embodiments and descriptions thereof of the present application are used for explaining the present application and do not constitute a limitation to the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another similar entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the application provides a mounting method and device of an image file, electronic equipment and a storage medium. The method provided by the embodiment of the invention can be applied to any required electronic equipment, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and the method is not particularly limited herein, and is hereinafter simply referred to as electronic equipment for convenience in description.
According to an aspect of an embodiment of the present application, an embodiment of a method for mounting an image file is provided. Fig. 1 is a flowchart of a method for mounting an image file according to an embodiment of the present application, and as shown in fig. 1, the method includes:
and step S11, acquiring the file mounting request, and analyzing the file mounting request to obtain the target identification code corresponding to the target image file to be mounted.
The method provided by the embodiment of the application is applied to a cloud platform, and the cloud platform can be a platform which is used for managing a cluster formed by bottom nodes and providing cloud computing service to the outside on the basis. Specifically, a requesting device in communication connection with the cloud platform may initiate a file mount request to the cloud platform, where the file mount request may carry a file format and a target identification code and the like corresponding to a target image file to be subjected to mount operation.
In the embodiment of the present application, the target id may be a Universal Unique Identifier (UUID), which is a standard for software construction and is also a part of the field of distributed computing environment organized by the open software foundation. The aim is to enable all elements in the distributed system to have unique identification information without specifying the identification information through a central control end.
In the embodiment of the application, analyzing the file mount request to obtain the target identification code corresponding to the target image file to be subjected to the mount operation includes the following steps a1-a 2:
step A1, the file mount request is analyzed, and the file format corresponding to the target image file to be mounted is determined.
In this embodiment of the present application, the file mount request is analyzed, and a file format can be obtained from the file mount request, where the file format may be: qcow2, raw, and ISO format, among others.
Step A2, under the condition that the file format is ISO format, calling a file mount interface corresponding to the ISO format, and reading the target identification code corresponding to the target image file from the file mount request based on the file mount interface.
In the embodiment of the application, because the cloud platform does not have an interface for mounting an image file in an ISO format as a cdrom, and only supports interfaces in qcow2 and raw formats, the embodiment of the application needs to extend one interface for the image file in the ISO format to interface with skyline (the interface form can be designed as POST/servers/cloud host uuid/cdrom-attributes).
In the embodiment of the application, the iso image file mount interface is called through skyline, and the parameter format is as follows:
Figure BDA0003495068470000071
Figure BDA0003495068470000081
and step S12, inquiring the target file information corresponding to the target image file by using the target identification code.
In the embodiment of the present application, the step S12 of querying file information corresponding to the target image file by using the target identification code includes the following steps B1-B2:
and step B1, generating a query request based on the target identification code.
In the embodiment of the application, after the file mount request is preliminarily analyzed, the cloud platform generates the query request according to the analyzed target identification code. The query request is used for querying detailed information of the target image file to be subjected to mounting operation.
And step B2, sending the query request to the image management device so that the image management device queries the target file information corresponding to the target identification code based on the target identification code carried in the query request, wherein the image management device stores the corresponding relationship between the identification code and the file information.
In the embodiment of the application, the mirror image management device stores the corresponding relationship between the identification code and the file information, so that the target file information corresponding to the target identification code can be determined based on the corresponding relationship.
It should be noted that, before sending the file mount request, the requesting device sends the target image file to be mounted to the image management device, and the image management device authenticates the target image file and feeds back the target identification code corresponding to the target image file to the requesting device after the target image file passes the authentication. Meanwhile, after the image management device generates the identification code each time, the corresponding relationship between the identification code and the file information of the image file is established, and the file information may include: the protocol to which the file corresponds, the storage location, etc.
As an example, a requesting device prepares a standard ISO image, may log in to a cloud platform through skyline, uploads an ISO image to an image management device in the cloud platform, and may obtain a UUID corresponding to the ISO image after successful uploading. Wherein, the mirror image management device may be a Glance. The Glance enables a user to discover, register and retrieve the mirror image of the virtual machine, and provides a REST API capable of inquiring the mirror image data of the virtual machine and retrieving the real mirror image.
And step S13, extracting the host type of the target host corresponding to the target image file based on the target file information.
In this embodiment of the application, the step S13, extracting the host type of the target host corresponding to the target image file based on the target file information, includes the following steps C1-C2:
and step C1, analyzing the target file information to obtain a storage address corresponding to the target image file.
In the embodiment of the application, after the target file information is acquired from the mirror image management device, the target file information is analyzed, so that the storage address corresponding to the target mirror image file is extracted from the target file information.
Step C2, determining a target host corresponding to the target image file based on the storage address, and determining a host type corresponding to the target host, wherein the host type comprises: x86 type and SCSI type.
In the embodiment of the application, the target host where the target mirror image file is located can be determined through the storage address corresponding to the target mirror image file, and after the target host is determined, the host type corresponding to the target host can be obtained. The host types include: x86 type and SCSI type. The X86 type host is an Intel X86, a 16-bit microprocessor available from Intel corporation. SCSI type Small Computer System Interface (Small Computer System Interface) is a standard for independent processors used as System level interfaces between computers and their peripherals (hard disks, floppy drives, optical drives, printers, scanners, etc.).
And step S14, generating a control command corresponding to the host type, and sending the control command to the virtual machine monitor so that the virtual machine monitor can execute the mounting operation based on the control command.
In the embodiment of the present application, the step S14 of generating the control command corresponding to the host type includes the following steps D1-D2:
and D1, determining a first file format corresponding to the X86 type under the condition that the host type is the X86 type.
And D2, generating a control command corresponding to the IDE controller based on the first file format and the target file information.
In this embodiment, as shown in fig. 2, when the host type is the X86 type, the first file format corresponding to the X86 type is determined, and a control command corresponding to the IDE controller is generated according to the first file format and the target file information, where the control command is: < controller type ═ ide'/>, wherein, ide (integrated Development environment) controller. After receiving the control command, the IDE controller executes the control command to complete the file mount operation.
In this embodiment of the application, the step S14 of generating the control command corresponding to the host type includes the following steps E1-E2:
and E1, determining a second file format corresponding to the SCSI type under the condition that the host type is the SCSI type.
Step E2, a control command corresponding to the SCSI controller is generated based on the second file format and the target file information.
In this embodiment of the application, as shown in fig. 2, when the host type is the SCSI type, the second file format corresponding to the SCSI type is determined. Generating a control command corresponding to the SCSI controller based on the second file format and the target file information, wherein the control command is as follows: < controller type ═ scsi 'model ═ virtio-scsi'/>.
In an embodiment of the present application, sending a control command to a virtual machine monitor to enable the virtual machine monitor to perform a mount operation based on the control command includes: and sending the control command to a virtualization engine so that the virtualization engine analyzes the control command to obtain a target mounting command in a target format, transmitting the target mounting command in the target format to the virtual machine monitor, and executing mounting operation according to the target mounting command in the target format through the virtual machine monitor, wherein the target format is a format supported by the virtual machine monitor.
It should be noted that the cloud platform sends the control command to the virtualization engine libvirt, where the virtualization engine is capable of parsing the command in the form of Xml sent by the cloud platform and converting the command into a command and a parameter understood by the underlying virtual machine monitor. Acting as a translator between the cloud platform and the virtual machine monitor.
The method provided by the application can generate different control commands according to the host type of the host corresponding to the target image file, so that the aim of mounting the ISO images on various different types of hosts is achieved, and the problem that the image mounting cannot be achieved under a mixed framework in the prior art is solved.
Fig. 3 is a block diagram of an apparatus for mounting an image file according to an embodiment of the present disclosure, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 3, the apparatus includes:
the obtaining module 31 is configured to obtain a file mount request, where the file mount request includes a target identification code corresponding to a target image file to be mounted;
the query module 32 is used for querying file information corresponding to the target image file by using the target identification code;
the extraction module 33 is configured to extract a host type of the target host corresponding to the target image file based on the file information;
and the generating module 34 is configured to generate a control command corresponding to the host type and send the control command to the virtual machine monitor, so that the virtual machine monitor performs a mount operation based on the control command.
In this embodiment of the present application, the obtaining module 31 is configured to analyze a file mount request, and determine a file format corresponding to a target image file to be mounted; and under the condition that the file format is the ISO format, calling a file mounting interface corresponding to the ISO format, and reading the target identification code corresponding to the target image file from the file mounting request based on the file mounting interface.
In the embodiment of the present application, the query module 32 is configured to generate a query request based on the target identification code; and sending the query request to the image management device so that the image management device queries the target file information corresponding to the target identification code based on the target identification code carried in the query request, wherein the image management device stores the corresponding relation between the identification code and the file information.
In this embodiment of the present application, the extracting module 33 is configured to analyze information of a target file to obtain a storage address corresponding to a target image file; determining a target host corresponding to the target image file based on the storage address, and determining a host type corresponding to the target host, wherein the host type comprises: x86 type and SCSI type.
In this embodiment of the present application, the generating module 34 is configured to determine, when the host type is an X86 type, a first file format corresponding to an X86 type; and generating a control command corresponding to the IDE controller based on the first file format and the target file information.
In this embodiment of the present application, the generating module 34 is configured to determine, when the host type is an SCSI type, a second file format corresponding to the SCSI type; and generating a control command corresponding to the SCSI controller based on the second file format and the target file information.
In an embodiment of the present application, sending a control command to a virtual machine monitor to enable the virtual machine monitor to perform a mount operation based on the control command includes:
and sending the control command to a virtualization engine so that the virtualization engine analyzes the control command to obtain a target control command, transmitting the target control command to a virtual machine monitor, and executing mounting operation according to the target control command through the virtual machine monitor.
An embodiment of the present application further provides an electronic device, as shown in fig. 4, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above embodiments when executing the computer program stored in the memory 1503.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the method for mounting an image file according to any one of the above embodiments.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute a method for mounting an image file according to any one of the above embodiments.
Acquiring a file mounting request, and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation;
inquiring target file information corresponding to the target image file by using the target identification code;
extracting the host type of the target host corresponding to the target image file based on the target file information;
and generating a control command corresponding to the host type, and sending the control command to the virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command.
Further, analyzing the file mount request to obtain a target identification code corresponding to a target image file to be subjected to mount operation, including:
analyzing the file mounting request, and determining a file format corresponding to a target mirror image file to be subjected to mounting operation;
and under the condition that the file format is the ISO format, calling a file mounting interface corresponding to the ISO format, and reading the target identification code corresponding to the target image file from the file mounting request based on the file mounting interface.
Further, querying file information corresponding to the target image file by using the target identification code includes:
generating a query request based on the target identification code;
and sending the query request to the image management device so that the image management device queries the target file information corresponding to the target identification code based on the target identification code carried in the query request, wherein the image management device stores the corresponding relation between the identification code and the file information.
Further, extracting the host type of the target host corresponding to the target image file based on the target file information includes:
analyzing the target file information to obtain a storage address corresponding to the target image file;
determining a target host corresponding to the target image file based on the storage address, and determining a host type corresponding to the target host, wherein the host type comprises: x86 type and SCSI type.
Further, generating a control command corresponding to the host type includes:
under the condition that the type of the host is X86 type, determining a first file format corresponding to X86 type;
and generating a control command corresponding to the IDE controller based on the first file format and the target file information.
Further, generating a control command corresponding to the host type includes:
determining a second file format corresponding to the SCSI type under the condition that the host type is the SCSI type;
and generating a control command corresponding to the SCSI controller based on the second file format and the target file information.
Further, sending the control command to the virtual machine monitor to enable the virtual machine monitor to execute a mount operation based on the control command, including:
and sending the control command to a virtualization engine so that the virtualization engine analyzes the control command to obtain a target mounting command in a target format, transmitting the target mounting command in the target format to the virtual machine monitor, and executing mounting operation according to the target mounting command in the target format through the virtual machine monitor, wherein the target format is a format supported by the virtual machine monitor.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for mounting an image file is characterized by comprising the following steps:
acquiring a file mounting request, and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation;
inquiring target file information corresponding to the target image file by using the target identification code;
extracting the host type of the target host corresponding to the target image file based on the target file information;
and generating a control command corresponding to the host type, and sending the control command to a virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command.
2. The method according to claim 1, wherein the analyzing the file mount request to obtain a target identification code corresponding to a target image file to be mounted comprises:
analyzing the file mounting request, and determining a file format corresponding to a target mirror image file to be subjected to mounting operation;
and under the condition that the file format is the ISO format, calling a file mounting interface corresponding to the ISO format, and reading the target identification code corresponding to the target image file from the file mounting request based on the file mounting interface.
3. The method of claim 1, wherein the querying the file information corresponding to the target image file by using the target identification code comprises:
generating a query request based on the target identification code;
and sending the query request to image management equipment so that the image management equipment queries target file information corresponding to the target identification code based on the target identification code carried in the query request, wherein the image management equipment stores the corresponding relation between the identification code and the file information.
4. The method according to claim 1, wherein the extracting the host type of the target host corresponding to the target image file based on the target file information comprises:
analyzing the target file information to obtain a storage address corresponding to the target image file;
determining a target host corresponding to the target image file based on the storage address, and determining a host type corresponding to the target host, wherein the host type comprises: x86 type and SCSI type.
5. The method according to claim 4, wherein the generating the control command corresponding to the host type includes:
determining a first file format corresponding to the X86 type when the host type is the X86 type;
and generating a control command corresponding to the IDE controller based on the first file format and the target file information.
6. The method according to claim 4, wherein the generating the control command corresponding to the host type includes:
determining a second file format corresponding to the SCSI type under the condition that the host type is the SCSI type;
and generating a control command corresponding to the SCSI controller based on the second file format and the target file information.
7. The method of claim 1, wherein sending the control command to a virtual machine monitor to cause the virtual machine monitor to perform a mount operation based on the control command comprises:
sending the control command to a virtualization engine so that the virtualization engine analyzes the control command to obtain a target mounting command in a target format, transmitting the target mounting command in the target format to the virtual machine monitor, and executing mounting operation according to the target mounting command in the target format through the virtual machine monitor, wherein the target format is a format supported by the virtual machine monitor.
8. An apparatus for mounting an image file, comprising:
the acquisition module is used for acquiring a file mounting request and analyzing the file mounting request to obtain a target identification code corresponding to a target image file to be subjected to mounting operation;
the query module is used for querying file information corresponding to the target image file by using the target identification code;
the extraction module is used for extracting the host type of the target host corresponding to the target mirror image file based on the file information;
and the generating module is used for generating a control command corresponding to the host type and sending the control command to a virtual machine monitor so that the virtual machine monitor executes mounting operation based on the control command.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 7.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1-7 by executing a program stored on a memory.
CN202210111974.1A 2022-01-29 2022-01-29 Mirror image file mounting method and device, electronic equipment and storage medium Pending CN114443229A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111974.1A CN114443229A (en) 2022-01-29 2022-01-29 Mirror image file mounting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111974.1A CN114443229A (en) 2022-01-29 2022-01-29 Mirror image file mounting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114443229A true CN114443229A (en) 2022-05-06

Family

ID=81371218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111974.1A Pending CN114443229A (en) 2022-01-29 2022-01-29 Mirror image file mounting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114443229A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048735A (en) * 2023-03-23 2023-05-02 阿里云计算有限公司 Information processing method and object sharing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048735A (en) * 2023-03-23 2023-05-02 阿里云计算有限公司 Information processing method and object sharing method
CN116048735B (en) * 2023-03-23 2023-08-29 阿里云计算有限公司 Information processing method and object sharing method

Similar Documents

Publication Publication Date Title
US8296251B1 (en) Method and apparatus for generating collective intelligence to automate resource recommendations for improving a computer
CN111314459B (en) Service request method, device, electronic equipment and storage medium
EP3425501B1 (en) Mirror image file conversion method and apparatus
US6971090B1 (en) Common Information Model (CIM) translation to and from Windows Management Interface (WMI) in client server environment
US10963370B2 (en) Default mock implementations at a server
EP3051455B1 (en) Cloud application activation and update service
WO2013152729A1 (en) Method and apparatus for providing software for terminal device
CN112995166B (en) Authentication method and device for resource access, storage medium and electronic equipment
EP4247020A2 (en) Profile based content and services
CN115080479B (en) Transmission method, server, device, bare metal instance and baseboard management controller
CN114443229A (en) Mirror image file mounting method and device, electronic equipment and storage medium
US9141321B1 (en) Configurable printer server device
CN112596956A (en) File system management method, device and related components
CN116126613A (en) Position detection method and device of PCIe (peripheral component interconnect express) equipment, electronic equipment and storage medium
CN112948733B (en) Interface maintenance method, device, computing equipment and medium
CN113486025B (en) Data storage method, data query method and device
CN115794821A (en) Method, system, equipment and medium for converging information of same asset on different platforms
CN116132625A (en) Supervision method and device for transaction flow
CN112087430B (en) System and method for accessing MCTP (multimedia broadcast multicast service) equipment through SMASH (simple multimedia application service) interface
JP3543683B2 (en) Automatic document creation system, automatic document creation method, and recording medium recording automatic document creation program
US20050132084A1 (en) Method and apparatus for providing server local SMBIOS table through out-of-band communication
US9489157B2 (en) Printable object processing
CN111651356A (en) Application program testing method, device and system
WO2023020511A1 (en) Device control method, apparatus, server and storage medium
US20240187315A1 (en) Device Control Method and Apparatus, Server, and Storage Medium

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