A method, device, electronic device and storage medium for mounting image files
By parsing and generating different types of control commands, the ISO image mounting of the virtual machine on the arm architecture platform is realized, which solves the image mounting problem caused by the hypervisor's inability to simulate IDE devices and realizes the image mounting capability under the hybrid architecture. .
Patent Information
- Application Number
- CN202210111974.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-01-29
AI Technical Summary
On the ARM architecture platform, the hypervisor cannot simulate IDE devices, resulting in the virtual machine being unable to mount the ISO image, and the image mounting cannot be achieved under the hybrid architecture.
By obtaining and parsing the file mounting request, the target identification code and host type of the target image file are determined, and the corresponding control command is generated and sent to the virtual machine monitor to realize ISO image mounting under different host types, including X86 and SCSI type generates IDE and SCSI controller commands.
The goal of mounting ISO images under a variety of different types of hosts is achieved, and the problem in the existing technology that image mounting cannot be achieved under a hybrid architecture is solved.
Smart Images

Figure CN114443229B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for mounting an image file. Background Art
[0002] When the hypervisor mounts an ISO image to a virtual machine, it needs to simulate an optical drive controller for the virtual machine first. On the x86 architecture platform, the optical drive controller type is IDE. However, on the arm architecture platform, the hypervisor cannot simulate IDE devices. This results in the virtual machine on the arm architecture platform not being able to use the ISO image mounting function, and image mounting cannot be achieved under a hybrid architecture. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method, device, electronic device and storage medium for mounting an image file.
[0004] According to one aspect of an embodiment of the present application, a method for mounting an image file is provided, comprising:
[0005] Obtaining a file mount request, parsing the file mount request, and obtaining a target identification code corresponding to a target image file to be mounted;
[0006] Querying the target file information corresponding to the target image file using the target identification code;
[0007] Extracting the host machine type of the target host machine corresponding to the target image file based on the target file information;
[0008] A control command corresponding to the host machine type is generated, and the control command is sent to a virtual machine monitor, so that the virtual machine monitor performs a mounting operation based on the control command.
[0009] Further, the parsing of the file mount request to obtain a target identification code corresponding to a target image file to be mounted includes:
[0010] Parsing the file mount request to determine the file format corresponding to the target image file to be mounted;
[0011] In the case where the file format is the ISO format, a file mount interface corresponding to the ISO format is called, and a target identification code corresponding to the target image file is read from the file mount request based on the file mount interface.
[0012] Further, the using the target identification code to query the file information corresponding to the target image file includes:
[0013] generating a query request based on the target identification code;
[0014] The query request is sent to an 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 correspondence between the identification code and the file information.
[0015] Further, extracting the host type of the target host corresponding to the target image file based on the target file information includes:
[0016] Parsing the target file information to obtain the storage address corresponding to the target image file;
[0017] A target host machine corresponding to the target image file is determined based on the storage address, and a host machine type corresponding to the target host machine is determined, wherein the host machine type includes: an X86 type and a SCSI type.
[0018] Further, the generating of the control command corresponding to the host type includes:
[0019] In the case where the host machine type is the X86 type, determining a first file format corresponding to the X86 type;
[0020] A control command corresponding to the IDE controller is generated based on the first file format and the target file information.
[0021] Further, the generating of the control command corresponding to the host type includes:
[0022] In the case where the host machine type is the SCSI type, determining a second file format corresponding to the SCSI type;
[0023] A control command corresponding to the SCSI controller is generated based on the second file format and the target file information.
[0024] Further, sending the control command to a virtual machine monitor so that the virtual machine monitor performs a mount operation based on the control command includes:
[0025] The control command is sent to a virtualization engine so that the virtualization engine parses the control command to obtain a target mount command in a target format, and passes the target mount command in the target format to the virtual machine monitor. The virtual machine monitor performs a mount operation according to the target mount command in the target format, and the target format is a format supported by the virtual machine monitor.
[0026] According to another aspect of the embodiment of the present application, there is also provided a device for mounting an image file, including:
[0027] An acquisition module, used to acquire a file mount request, and parse the file mount request to obtain a target identification code corresponding to a target image file to be mounted;
[0028] A query module, used to query file information corresponding to the target image file using the target identification code;
[0029] An extraction module, used for extracting the host type of the target host corresponding to the target image file based on the file information;
[0030] A generating module is used to generate a control command corresponding to the host machine type, and send the control command to a virtual machine monitor, so that the virtual machine monitor performs a mounting operation based on the control command.
[0031] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0032] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0033] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0034] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: the method provided by the present application can generate different control commands according to the host type of the host corresponding to the target image file, thereby achieving the goal of mounting ISO images under a variety of different types of host machines, solving the problem that the prior art cannot realize image mounting under a hybrid architecture. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] 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 present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of a method for mounting an image file provided in an embodiment of the present application;
[0038] Figure 2 A framework diagram of mounting an image file provided in an embodiment of the present application;
[0039] Figure 3 A block diagram of a device for mounting an image file provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0042] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0043] The embodiments of the present application provide a method, device, electronic device and storage medium for mounting an image file. The method provided by the embodiments of the present invention can be applied to any required electronic device, for example, it can be an electronic device such as a server or a terminal, which is not specifically limited here. For the convenience of description, it is referred to as an electronic device in the following.
[0044] According to one aspect of the embodiments of the present application, an embodiment of a method for mounting an image file is provided. Figure 1 A flowchart of a method for mounting an image file provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0045] Step S11, obtaining a file mount request, parsing the file mount request, and obtaining a target identification code corresponding to a target image file to be mounted.
[0046] The method provided in the embodiment of the present application is applied to a cloud platform, which can be a platform for managing a cluster composed of underlying nodes and providing cloud computing services to the outside world on this basis. Specifically, a requesting device connected to the cloud platform can initiate a file mount request to the cloud platform, and the file mount request will carry the file format corresponding to the target image file to be mounted and the target identification code, etc.
[0047] In the embodiment of the present application, the target identifier may be a Universally Unique Identifier (UUID), which is a software construction standard and is also part of the Open Software Foundation in the field of distributed computing environments. Its purpose is to allow all elements in a distributed system to have unique identification information without the need for a central control terminal to specify the identification information.
[0048] In the embodiment of the present application, parsing the file mount request to obtain the target identification code corresponding to the target image file to be mounted includes the following steps A1-A2:
[0049] Step A1, parsing a file mount request, and determining a file format corresponding to a target image file to be mounted.
[0050] In an embodiment of the present application, a file mount request is parsed and the file format can be obtained from the file mount request. The file format may be: qcow2, raw, ISO format, etc.
[0051] Step A2: when the file format is ISO format, call the file mount interface corresponding to the ISO format, and read the target identification code corresponding to the target image file from the file mount request based on the file mount interface.
[0052] In the embodiment of the present application, since the cloud platform itself does not have an interface for mounting ISO format image files as cdrom, and only supports qcow2 and raw format interfaces, the embodiment of the present application needs to extend an interface for ISO format image files to connect to the skyline (the interface format can be designed as: POST / servers / cloud host uuid / cdrom-attachments).
[0053] In the embodiment of the present application, the iso image file mounting interface is called through skyline, and the parameter format is as follows:
[0054]
[0055]
[0056] Step S12, using the target identification code to query the target file information corresponding to the target image file.
[0057] In the embodiment of the present application, step S12, using the target identification code to query the file information corresponding to the target image file, includes the following steps B1-B2:
[0058] Step B1, generating a query request based on the target identification code.
[0059] In the embodiment of the present application, after the cloud platform has preliminarily parsed the file mount request, it will generate a query request according to the parsed target identification code. The query request is used to query the detailed information of the target image file to be mounted.
[0060] 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 correspondence between the identification code and the file information.
[0061] In the embodiment of the present application, the image management device stores the correspondence between the identification code and the file information, so the target file information corresponding to the target identification code can be determined based on the correspondence.
[0062] It should be noted that before sending a file mount request, the requesting device will send the target image file to be mounted to the image management device, which will authenticate the target image file and feedback the target identification code corresponding to the target image file to the requesting device after the authentication is passed. At the same time, after each generation of the identification code, the image management device will establish a corresponding relationship between the identification code and the file information of the image file, which may include: the protocol corresponding to the file, the storage location, etc.
[0063] As an example, the requesting device prepares a standard ISO image file. The requesting device can log in to the cloud platform through Skyline and upload the ISO image to the image management device in the cloud platform. After the upload is successful, the UUID corresponding to the ISO image file can be obtained. The image management device can be Glance. Glance enables users to discover, register, and retrieve virtual machine images. Glance provides a REST API that can query virtual machine image metadata and retrieve real images.
[0064] Step S13: extracting the host type of the target host machine corresponding to the target image file based on the target file information.
[0065] In the embodiment of the present application, 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:
[0066] Step C1, parsing the target file information to obtain the storage address corresponding to the target image file.
[0067] In an embodiment of the present application, after the target file information is obtained from the image management device, the target file information is parsed to extract the storage address corresponding to the target image file from the target file information.
[0068] Step C2, determining the target host machine corresponding to the target image file based on the storage address, and determining the host machine type corresponding to the target host machine, wherein the host machine type includes: X86 type and SCSI type.
[0069] In the embodiment of the present application, the target host machine where the target image file is located can be determined by the storage address corresponding to the target image file. After the target host machine is determined, the host machine type corresponding to the target host machine can be obtained. The host machine types include: X86 type and SCSI type. The X86 type host machine is Intel x86, which is a 16-bit microprocessor launched by Intel. The SCSI type is Small Computer System Interface, which is an independent processor standard for system-level interfaces between computers and their peripheral devices (hard disks, floppy drives, optical drives, printers, scanners, etc.).
[0070] Step S14: Generate a control command corresponding to the host machine type, and send the control command to the virtual machine monitor, so that the virtual machine monitor performs the mounting operation based on the control command.
[0071] In the embodiment of the present application, step S14, generating a control command corresponding to the host type, includes the following steps D1-D2:
[0072] Step D1, when the host machine type is X86 type, determine the first file format corresponding to the X86 type.
[0073] Step D2: Generate a control command corresponding to the IDE controller based on the first file format and the target file information.
[0074] In the embodiments of the present application, Figure 2 As shown, when the host machine type is 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. The control command is:<controller type=’ide’ / > , wherein the IDE (Integrated Development Environment) controller. After receiving the control command, the IDE controller executes the control command to complete the file mounting operation.
[0075] In the embodiment of the present application, step S14, generating a control command corresponding to the host type, includes the following steps E1-E2:
[0076] Step E1: when the host machine type is a SCSI type, determine a second file format corresponding to the SCSI type.
[0077] Step E2: Generate a control command corresponding to the SCSI controller based on the second file format and the target file information.
[0078] In the embodiments of the present application, Figure 2 As shown, when the host type is SCSI type, the second file format corresponding to the SCSI type is determined. Based on the second file format and the target file information, a control command corresponding to the SCSI controller is generated. At this time, the control command is:<controller type=’scsi’model=‘virtio-scsi’ / > .
[0079] In an embodiment of the present application, a control command is sent to a virtual machine monitor so that the virtual machine monitor performs a mount operation based on the control command, including: sending the control command to a virtualization engine so that the virtualization engine parses the control command to obtain a target mount command in a target format, and passing the target mount command in the target format to the virtual machine monitor, and performing the mount operation according to the target mount command in the target format through the virtual machine monitor, where the target format is a format supported by the virtual machine monitor.
[0080] It should be noted that the cloud platform sends the control command to the virtualization engine libvirt, which can parse the command in the form of XML sent by the cloud platform and convert it into commands and parameters understood by the underlying virtual machine monitor, acting as a translator between the cloud platform and the virtual machine monitor.
[0081] The method provided in the present application can generate different control commands according to the host type of the target image file corresponding to the host machine, thereby achieving the goal of mounting ISO images under a variety of different types of host machines, solving the problem that the existing technology cannot realize image mounting under a hybrid architecture.
[0082] Figure 3 This is a block diagram of a device for mounting an image file provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 3 As shown, the device comprises:
[0083] The acquisition module 31 is used to acquire a file mount request, wherein the file mount request includes a target identification code corresponding to a target image file to be mounted;
[0084] A query module 32, used to query file information corresponding to a target image file using a target identification code;
[0085] An extraction module 33 is used to extract the host type of the target host corresponding to the target image file based on the file information;
[0086] The generating module 34 is used to generate a control command corresponding to the host machine type, and send the control command to the virtual machine monitor, so that the virtual machine monitor performs the mounting operation based on the control command.
[0087] In an embodiment of the present application, the acquisition module 31 is used to parse the file mount request and determine the file format corresponding to the target image file to be mounted; when the file format is ISO format, the file mount interface corresponding to the ISO format is called, and the target identification code corresponding to the target image file is read from the file mount request based on the file mount interface.
[0088] In an embodiment of the present application, the query module 32 is used to generate a query request based on the target identification code; send 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 correspondence between the identification code and the file information.
[0089] In an embodiment of the present application, the extraction module 33 is used to parse the target file information to obtain the storage address corresponding to the target image file; determine the target host machine corresponding to the target image file based on the storage address, and determine the host machine type corresponding to the target host machine, wherein the host machine type includes: X86 type and SCSI type.
[0090] In the embodiment of the present application, the generation module 34 is used to determine the first file format corresponding to the X86 type when the host machine type is the X86 type; and generate a control command corresponding to the IDE controller based on the first file format and the target file information.
[0091] In the embodiment of the present application, the generation module 34 is used to determine the second file format corresponding to the SCSI type when the host machine type is the SCSI type; and generate a control command corresponding to the SCSI controller based on the second file format and the target file information.
[0092] In an embodiment of the present application, sending a control command to a virtual machine monitor so that the virtual machine monitor performs a mount operation based on the control command includes:
[0093] The control command is sent to the virtualization engine, so that the virtualization engine parses the control command to obtain a target control command, and transmits the target control command to the virtual machine monitor, and the mount operation is performed according to the target control command through the virtual machine monitor.
[0094] The present application also provides an electronic device, such as Figure 4 As shown, the electronic device may include: 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 communicate with each other via the communication bus 1504 .
[0095] Memory 1503, used for storing computer programs;
[0096] The processor 1501 is used to implement the steps of the above embodiment when executing the computer program stored in the memory 1503.
[0097] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0098] The communication interface is used for communication between the above terminal and other devices.
[0099] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0100] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0101] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method for mounting an image file described in any of the above embodiments.
[0102] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the image file mounting methods in the above embodiments.
[0103] Obtain a file mount request, parse the file mount request, and obtain a target identification code corresponding to the target image file to be mounted;
[0104] Query the target file information corresponding to the target image file using the target identification code;
[0105] Extract the host type of the target host machine corresponding to the target image file based on the target file information;
[0106] A control command corresponding to the host machine type is generated, and the control command is sent to the virtual machine monitor, so that the virtual machine monitor performs the mounting operation based on the control command.
[0107] Further, the file mount request is parsed to obtain a target identification code corresponding to the target image file to be mounted, including:
[0108] Parse the file mount request and determine the file format corresponding to the target image file to be mounted;
[0109] When the file format is ISO format, a file mount interface corresponding to the ISO format is called, and a target identification code corresponding to the target image file is read from the file mount request based on the file mount interface.
[0110] Further, the target identification code is used to query the file information corresponding to the target image file, including:
[0111] generating a query request based on the target identification code;
[0112] The query request is sent 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.
[0113] Further, based on the target file information, the host type of the target host corresponding to the target image file is extracted, including:
[0114] Parse the target file information and obtain the storage address corresponding to the target image file;
[0115] The target host machine corresponding to the target image file is determined based on the storage address, and the host machine type corresponding to the target host machine is determined, wherein the host machine type includes: X86 type and SCSI type.
[0116] Furthermore, control commands corresponding to the host type are generated, including:
[0117] When the host machine type is X86 type, determining a first file format corresponding to the X86 type;
[0118] A control command corresponding to the IDE controller is generated based on the first file format and the target file information.
[0119] Furthermore, control commands corresponding to the host type are generated, including:
[0120] When the host machine type is a SCSI type, determining a second file format corresponding to the SCSI type;
[0121] A control command corresponding to the SCSI controller is generated based on the second file format and the target file information.
[0122] Further, sending the control command to the virtual machine monitor so that the virtual machine monitor performs the mounting operation based on the control command includes:
[0123] The control command is sent to the virtualization engine so that the virtualization engine parses the control command to obtain a target mount command in a target format, and passes the target mount command in the target format to the virtual machine monitor. The virtual machine monitor performs the mount operation according to the target mount command in the target format, and the target format is a format supported by the virtual machine monitor.
[0124] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can 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 the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk), etc.
[0125] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0126] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for mounting an image file, characterized in that: include: Obtaining a file mount request, parsing the file mount request, and obtaining a target identification code corresponding to a target image file to be mounted; Querying the target file information corresponding to the target image file using the target identification code; Extracting the host machine type of the target host machine corresponding to the target image file based on the target file information; Generate a control command corresponding to the host machine type, and send the control command to a virtual machine monitor, so that the virtual machine monitor performs a mounting operation based on the control command; The using the target identification code to query the file information corresponding to the target image file includes: Generate a query request based on the target identification code; send 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; The step of extracting the host type of the target host corresponding to the target image file based on the target file information includes: Parse the target file information to obtain a storage address corresponding to the target image file; determine a target host machine corresponding to the target image file based on the storage address, and determine a host machine type corresponding to the target host machine, wherein the host machine type includes: X86 type and SCSI type.
2. The method according to claim 1, characterized in that The step of parsing the file mount request to obtain a target identification code corresponding to a target image file to be mounted includes: Parsing the file mount request to determine the file format corresponding to the target image file to be mounted; In the case where the file format is the ISO format, a file mount interface corresponding to the ISO format is called, and a target identification code corresponding to the target image file is read from the file mount request based on the file mount interface.
3. The method according to claim 1, characterized in that The generating a control command corresponding to the host type includes: In the case where the host machine type is the X86 type, determining a first file format corresponding to the X86 type; A control command corresponding to the IDE controller is generated based on the first file format and the target file information.
4. The method according to claim 3, characterized in that The generating a control command corresponding to the host type includes: In the case where the host machine type is the SCSI type, determining a second file format corresponding to the SCSI type; A control command corresponding to the SCSI controller is generated based on the second file format and the target file information.
5. The method according to claim 1, characterized in that The step of sending the control command to a virtual machine monitor so that the virtual machine monitor performs a mount operation based on the control command includes: The control command is sent to a virtualization engine so that the virtualization engine parses the control command to obtain a target mount command in a target format, and passes the target mount command in the target format to the virtual machine monitor. The virtual machine monitor performs a mount operation according to the target mount command in the target format, and the target format is a format supported by the virtual machine monitor.
6. A device for mounting an image file, characterized in that: include: An acquisition module, used to acquire a file mount request, and parse the file mount request to obtain a target identification code corresponding to a target image file to be mounted; A query module, used to query file information corresponding to the target image file using the target identification code; An extraction module, used for extracting the host type of the target host corresponding to the target image file based on the file information; A generating module, configured to generate a control command corresponding to the host machine type, and send the control command to a virtual machine monitor, so that the virtual machine monitor performs a mounting operation based on the control command; The query module is used to generate a query request based on the target identification code; 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; The extraction module is used to parse the target file information to obtain the storage address corresponding to the target image file; determine the target host machine corresponding to the target image file based on the storage address, and determine the host machine type corresponding to the target host machine, wherein the host machine type includes: X86 type and SCSI type.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program implements the steps of the method according to any one of claims 1 to 5 when executed by a processor.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the method according to any one of claims 1 to 5 by running a program stored in a memory.
Citation Information
Patent Citations
CD-ROM mounting method and device and related equipment
CN111124603A
Virtual machine data access method, device and equipment and storage medium
CN112035219A
Method of creating mirror file in logical volume, method of initiating virtual machine, and server
WO2017067404A1
