CN112035219A - Virtual machine data access method, device, equipment and storage medium - Google Patents

Virtual machine data access method, device, equipment and storage medium Download PDF

Info

Publication number
CN112035219A
CN112035219A CN202010947086.4A CN202010947086A CN112035219A CN 112035219 A CN112035219 A CN 112035219A CN 202010947086 A CN202010947086 A CN 202010947086A CN 112035219 A CN112035219 A CN 112035219A
Authority
CN
China
Prior art keywords
virtual machine
disk
data access
machine disk
access operation
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.)
Granted
Application number
CN202010947086.4A
Other languages
Chinese (zh)
Other versions
CN112035219B (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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202010947086.4A priority Critical patent/CN112035219B/en
Publication of CN112035219A publication Critical patent/CN112035219A/en
Application granted granted Critical
Publication of CN112035219B publication Critical patent/CN112035219B/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • G06F11/143Reconfiguring to eliminate the error with loss of software functionality
    • 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/45595Network integration; Enabling network access in virtual machine instances

Landscapes

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

Abstract

The application discloses a virtual machine data access method, a virtual machine data access device, a virtual machine data access equipment and a storage medium. The method is applied to a host machine running with a virtual machine, and comprises the following steps: acquiring the running state of the virtual machine; judging whether the running state is a downtime state or not; if the running state is the downtime state, executing data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process. According to the method, when the virtual machine cannot be accessed due to the abnormality, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the file data in the virtual machine with abnormal operation. In addition, the application also provides a virtual machine data access device, equipment and a storage medium, and the beneficial effects are as described above.

Description

Virtual machine data access method, device, equipment and storage medium
Technical Field
The present application relates to the field of virtualization, and in particular, to a method, an apparatus, a device, and a storage medium for accessing data of a virtual machine.
Background
The Hyper Converged Infrastructure (or HCI for short) means that resources and technologies such as computing, network, storage, and server virtualization are not only provided in the same set of unit devices, but also elements such as backup software, snapshot technology, data de-duplication, online data compression, and the like are included, and multiple sets of unit devices can be aggregated through the network to realize modular seamless lateral expansion (scale-out) to form a uniform resource pool.
When different operation services are realized in the super-convergence infrastructure, a physical host in the super-convergence infrastructure is often required to be virtualized to process and create a virtual machine, and the virtual machine runs corresponding operation services. When the virtual machine cannot be started due to an abnormal condition, an operation and maintenance worker often needs to perform abnormal recovery on the virtual machine through a state file generated when the virtual machine operates, but how to acquire file data in the abnormal-operation virtual machine is a current technical difficulty.
Therefore, it is a technical problem to be solved by those skilled in the art to provide a virtual machine data access method to access file data in a virtual machine with abnormal operation.
Disclosure of Invention
The application aims to provide a virtual machine data access method, a virtual machine data access device and a virtual machine data access storage medium, so that access to file data in a virtual machine with abnormal operation is realized.
In order to solve the above technical problem, the present application provides a virtual machine data access method, which is applied to a host machine running a virtual machine, and includes:
acquiring the running state of the virtual machine;
judging whether the running state is a downtime state or not;
if the running state is the downtime state, executing data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process.
Preferably, the mount relationship established with the virtual machine disk includes:
and the mounting relation is established between the virtual machine disk and the mounting request sent to the virtual machine disk corresponding to the virtual machine.
Preferably, the data access operation is performed on the virtual machine disk based on the mount relationship established with the virtual machine disk, and includes:
and executing data access operation on the virtual machine disk based on the mounting relation established with the target folder path in the virtual machine disk.
Preferably, the obtaining the running state of the virtual machine includes:
acquiring the running state of a corresponding virtual machine according to a virtual machine access request transmitted by a front-end page;
before performing a data access operation on the virtual machine disk based on the mount relationship established with the virtual machine disk, the method further includes:
feeding back a folder path in a virtual machine disk to a front-end page, and receiving an access operation request transmitted by the front-end page;
the method for performing data access operation on the virtual machine disk based on the mount relation established with the virtual machine disk comprises the following steps:
and executing data access operation corresponding to the access operation request on the virtual machine disk based on the mounting relation established with the virtual machine disk.
Preferably, before performing the data access operation corresponding to the access operation request on the virtual machine disk based on the mount relationship established with the virtual machine disk, the method further includes:
feeding back a verification window to a front-end page;
receiving verification information transmitted through a front-end page;
judging whether the verification information is target verification information with access authority or not;
and if the verification information is the target verification information with the access authority, executing a data access operation corresponding to the access operation request to the virtual machine disk based on the mounting relation established with the virtual machine disk.
Preferably, if the verification information is not the target verification information with the access right, the method further includes:
and feeding back a verification exception prompt to the front-end page.
Preferably, if the operating status is not the down status, the method further includes:
and stopping executing the data access operation of the virtual machine.
In addition, this application still provides a virtual machine data access device, is applied to the host computer that has the virtual machine of operation, includes:
the state acquisition module is used for acquiring the running state of the virtual machine;
the state judgment module is used for judging whether the running state is the downtime state or not, and if so, the mounting access module is called;
the mounting access module is used for executing data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process.
In addition, this application still provides a host computer equipment, has run virtual machine and has established communication connection with the virtual machine disk that virtual machine corresponds, includes:
a memory for storing a computer program;
a processor for implementing the steps of the virtual machine data access method as described above when executing the computer program.
Furthermore, the present application also provides a computer readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the virtual machine data access method as described above.
The method for accessing the data of the virtual machine is applied to a host machine running the virtual machine, firstly, the running state of the virtual machine is obtained, whether the operation state is a downtime state or not is further judged, if the running state of the virtual machine is the downtime state, data access operation is performed on the virtual machine disk based on a mounting relation established with the virtual machine disk, wherein the virtual machine disk is a disk called by the virtual machine in the running process. According to the method, when the virtual machine cannot be accessed due to the abnormality, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the file data in the virtual machine with abnormal operation. In addition, the application also provides a virtual machine data access device, equipment and a storage medium, and the beneficial effects are as described above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a virtual machine data access method disclosed in an embodiment of the present application;
fig. 2 is a flowchart of a specific virtual machine data access method disclosed in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a virtual machine data access device disclosed in an embodiment of the present application;
fig. 4 is a schematic diagram of a hardware composition structure of a host device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
When different operation services are realized in the super-convergence infrastructure, a physical host in the super-convergence infrastructure is often required to be virtualized to process and create a virtual machine, and the virtual machine runs corresponding operation services. When the virtual machine cannot be started due to an abnormal condition, an operation and maintenance worker often needs to perform abnormal recovery on the virtual machine through a state file generated when the virtual machine operates, but how to acquire file data in the abnormal-operation virtual machine is a current technical difficulty.
Therefore, the core of the application is to provide a virtual machine data access method to realize the access to the file data in the virtual machine with abnormal operation.
Referring to fig. 1, an embodiment of the present application discloses a virtual machine data access method, which is applied to a host machine running a virtual machine, and includes:
step S10: and acquiring the running state of the virtual machine.
It should be noted that the execution subject of this embodiment is a host running a virtual machine, the host is a host relative to the virtual machine, and the virtual machine is installed and run in the host, and further the host in this embodiment may be a physical host device or a virtual machine, and should be determined according to actual needs, and is not limited specifically herein.
In addition, the purpose of this embodiment is to still be able to normally access data in a virtual machine when the virtual machine running in the host machine is abnormal, so this step first obtains the running state of the virtual machine, and what the running state can represent is whether the virtual machine currently has an abnormal state. The method for acquiring the running state of the virtual machine includes, but is not limited to, initiating an access request to the virtual machine, and then generating the running state of the virtual machine according to the content of the response information fed back by the virtual machine, or determining the current running state of the virtual machine according to whether the virtual machine feeds back the response information.
Step S11: and judging whether the running state is the downtime state, if so, executing the step S12.
Step S12: and executing data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk.
The virtual machine disk is a disk called by the virtual machine in the running process.
After the running state of the virtual machine is obtained, whether the running state is a downtime state is further judged, and if the running state is the downtime state, the host machine further executes data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk.
It should be noted that, when the manner of obtaining the running state of the virtual machine is to initiate an access request to the virtual machine, and then generate the running state of the virtual machine according to the content of the response information fed back by the virtual machine, it may be determined whether the response information fed back by the virtual machine is consistent with the response information fed back by default when the virtual machine is down, and if so, the running state is the down state; when the mode of acquiring the running state of the virtual machine is to judge the current running state of the virtual machine according to whether the virtual machine feeds back the response information or not, if the virtual machine does not feed back the response information, the running state is the downtime state.
In addition, the mount relationship in the present embodiment refers to a communication relationship in which a folder path in a storage device or a data file in the folder path can be accessed by a file system. The host machine establishes a mounting relation with the virtual machine disk, and aims to access a folder path or a data file in the folder path in the virtual machine disk through a file system in the host machine. The virtual machine disk referred to herein is a disk that provides data support to the virtual machine during the running of the virtual machine and stores running data generated by the virtual machine.
In addition, the mount relationship in this embodiment may be established before the host determines the running state of the virtual machine, or may be established with the virtual machine disk when the host determines that the running state of the virtual machine is in a down state.
After the host machine establishes the mounting relationship with the virtual machine disk, the host machine further executes data access operation on the virtual machine disk based on the mounting relationship, so as to access data in the abnormal virtual machine.
The method for accessing the data of the virtual machine is applied to a host machine running the virtual machine, firstly, the running state of the virtual machine is obtained, whether the operation state is a downtime state or not is further judged, if the running state of the virtual machine is the downtime state, data access operation is performed on the virtual machine disk based on a mounting relation established with the virtual machine disk, wherein the virtual machine disk is a disk called by the virtual machine in the running process. According to the method, when the virtual machine cannot be accessed due to the abnormality, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the file data in the virtual machine with abnormal operation.
On the basis of the above embodiment, as a preferred implementation, the mount relationship established with the virtual machine disk includes:
and the mounting relation is established between the virtual machine disk and the mounting request sent to the virtual machine disk corresponding to the virtual machine.
It should be noted that, the important point of the present embodiment is that when the host establishes a mount relationship with the virtual machine disk, specifically, a mount request is sent to the virtual machine disk by the host, the virtual machine disk is requested to be used as a block device, and a folder path of the virtual machine disk is mounted to a specific path in a file system of the host. According to the embodiment, the mounting relation between the host machine and the virtual machine disk is established by sending the mounting request to the virtual machine disk corresponding to the virtual machine, so that the reliability of the mounting relation established between the host machine and the virtual machine disk is further ensured.
On the basis of the foregoing embodiment, as a preferred implementation, the performing, on the virtual machine disk, a data access operation based on a mount relationship established with the virtual machine disk includes:
and executing data access operation on the virtual machine disk based on the mounting relation established with the target folder path in the virtual machine disk.
It should be noted that the important point of the present embodiment is to establish a mount relationship between the host and the virtual machine disk, specifically, to establish a mount relationship with a specific folder path in the virtual machine disk, that is, a target folder path. The target folder path in this embodiment may be a folder path in which a specific type of file is stored in a disk of the virtual machine, where the target folder path includes, but is not limited to, a folder path in which a memory image file or a log file of running of the virtual machine is stored, and then the host can obtain the memory image file or the log file of running of the virtual machine in the target folder path based on the mount relationship, so as to analyze the cause of the abnormality of the virtual machine and eliminate the abnormality in the virtual machine.
In this embodiment, the host can relatively efficiently acquire the file in the path of the target folder based on the mount relationship, thereby further improving the access efficiency of the virtual machine data.
Referring to fig. 2, an embodiment of the present application discloses a virtual machine data access method, which is applied to a host running a virtual machine, and includes:
step S20: and acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the front-end page.
It should be noted that the main point of this embodiment is to initiate access to the virtual machine data from the front-end page to the host, where the front-end page refers to a page for responding to the operation of the user and transmitting the request or data generated by the operation to the host, so as to establish an interactive relationship between the user and the host. The front-end page includes, but is not limited to, a World Wide WEB (WEB) page or an application page, and should be determined according to actual needs.
Furthermore, in this embodiment, the front-end page initiates a virtual machine access request for performing data access on a certain virtual machine to the host, so that the host first responds to the virtual machine access request transmitted from the front-end page, and further obtains the running state of the virtual machine, which the user needs to perform data access, according to the access request.
Step S21: and judging whether the running state is the downtime state, if so, calling the step S22.
Step S22: and feeding back the folder path in the disk of the virtual machine to the front-end page, and receiving an access operation request transmitted by the front-end page.
The method comprises the steps of feeding back a folder path in a virtual machine disk to a front-end page, and aims to ensure that a user of the front-end page can initiate an access operation request in a targeted manner according to the folder path, and further receive an access operation request transmitted from a whole page after feeding back the folder path in the virtual machine disk to the front-end page, wherein the access operation request refers to a request for accessing and operating a specific data file in the virtual machine disk.
Step S23: and executing data access operation corresponding to the access operation request on the virtual machine disk based on the mounting relation established with the virtual machine disk.
The virtual machine disk is a disk called by the virtual machine in the running process.
After receiving the access operation request transmitted by the front-end page, the step further executes a data access operation corresponding to the access operation request on the virtual machine disk based on the mount relationship, so as to implement data access to the virtual machine, where the data access operation includes, but is not limited to, adding, deleting, modifying, and reading a data file in the virtual machine disk.
On the basis of the foregoing embodiment, as a preferred implementation manner, before performing a data access operation corresponding to an access operation request on a virtual machine disk based on a mount relationship established with the virtual machine disk, the method further includes:
feeding back a verification window to a front-end page;
receiving verification information transmitted through a front-end page;
judging whether the verification information is target verification information with access authority or not;
and if the verification information is the target verification information with the access authority, executing a data access operation corresponding to the access operation request to the virtual machine disk based on the mounting relation established with the virtual machine disk.
It should be noted that, in order to further ensure the reliability of the front-end page in performing data access on the virtual machine, in this embodiment, before performing a data access operation corresponding to the access operation request on the virtual machine disk based on the mount relationship established with the virtual machine disk, an authentication window is fed back to the front-end page, so as to provide corresponding authentication information for the user of the front-end page through the authentication window, thereby proving that the user has a legal access right to the virtual machine. The host further determines whether the verification information is target verification information with access authority after receiving the verification information transmitted through the front-end page, specifically, whether the verification information is the target verification information with access authority is determined by searching the target verification information consistent with the verification information transmitted through the front-end page in a list of the verification information recorded with the access authority, and if the verification information is the target verification information with access authority, executing a step of executing a data access operation corresponding to the access operation request on the virtual machine disk based on a mount relationship established with the virtual machine disk. The embodiment further ensures the data security of the virtual machine data access process.
Furthermore, if the verification information is not the target verification information with the access right, the method further comprises:
and feeding back a verification exception prompt to the front-end page.
It should be noted that, in this embodiment, when the result of determining whether the verification information is the target verification information with the access right is that the verification information is not the target verification information with the access right, the verification exception question is fed back to the front-end page to inform that the user of the front-end page has a verification information error, on this basis, a verification window may be further fed back to the front-end page for the user to input the verification information again, until the number of times of the error of inputting the verification information by the user reaches the preset number of times. The embodiment further ensures the overall reliability of the virtual machine data access process.
On the basis of the above series of embodiments, as a preferred implementation, if the operating status is not the downtime status, the method further includes:
and stopping executing the data access operation of the virtual machine.
According to the embodiment, when the running state is judged not to be the downtime state, the data access operation on the virtual machine is stopped, so that the data in the virtual machine can be accessed in a mode that the host machine mounts the disk of the virtual machine only when the virtual machine is in the downtime state, and the data can be accessed only through the virtual machine when the virtual machine is not in the downtime state, so that the safety of the data in the virtual machine is further ensured.
Referring to fig. 3, an embodiment of the present application discloses a virtual machine data access apparatus, which is applied to a host running a virtual machine, and includes:
a state obtaining module 10, configured to obtain an operating state of a virtual machine;
the state judgment module 11 is used for judging whether the running state is the downtime state, and if so, the mounting access module is called;
the mount access module 12 is configured to perform a data access operation on the virtual machine disk based on a mount relationship established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process.
In a specific embodiment, the mount relationship established with the virtual machine disk by the mount access module 12 includes:
and the mounting relation is established between the virtual machine disk and the mounting request sent to the virtual machine disk corresponding to the virtual machine.
In a specific embodiment, the data access operation performed by the mount access module 12 on the virtual machine disk based on the mount relationship established with the virtual machine disk includes:
and executing data access operation on the virtual machine disk based on the mounting relation established with the target folder path in the virtual machine disk.
In one embodiment, the status obtaining module 10 includes:
the page acquisition module is used for acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the front-end page;
the device still includes:
the page path feedback module is used for feeding back a folder path in the virtual machine disk to the front-end page and receiving an access operation request transmitted by the front-end page;
the mount access module 12 performs data access operations on the virtual machine disk based on the mount relationship established with the virtual machine disk, including:
and executing data access operation corresponding to the access operation request on the virtual machine disk based on the mounting relation established with the virtual machine disk.
In a specific embodiment, the apparatus further comprises:
the verification window feedback module is used for feeding back the verification window to the front-end page;
the verification information receiving module is used for receiving verification information transmitted through the front-end page;
and the authority judgment module is used for judging whether the verification information is target verification information with access authority, and if so, the mounting access module 12 is called.
In a specific implementation mode, if the result of the permission judging module is negative, the abnormal question module is executed;
and the abnormity prompting module is used for feeding back a verification abnormity prompt to the front-end page.
In one embodiment, if the result of the status determination module is negative, the execution operation stop module:
and the operation stopping module is used for stopping executing the data access operation of the virtual machine.
The virtual machine data access device provided by the application is applied to a host machine running a virtual machine, firstly, the running state of the virtual machine is obtained, and then whether the operation state is a downtime state is judged, if the running state of the virtual machine is the downtime state, data access operation is executed on the virtual machine disk based on a mounting relation established with the virtual machine disk, wherein the virtual machine disk is a disk called by the virtual machine in the running process. When the device cannot access due to the fact that the virtual machine is abnormal, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the virtual machine disk, and accordingly the access of the host machine to the file data in the virtual machine with abnormal operation is achieved.
Based on the hardware implementation of the program module, and in order to implement the virtual machine data access method according to the embodiment of the present application, an embodiment of the present application further provides a host device, where a virtual machine runs and a communication connection is established with a virtual machine disk corresponding to the virtual machine, fig. 4 is a schematic diagram of a hardware composition structure of the host device according to the embodiment of the present application, and as shown in fig. 4, the host device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
and the processor 2 is connected with the communication interface 1 to realize information interaction with other equipment, and is used for executing the virtual machine data access method provided by one or more technical schemes when running a computer program. And the computer program is stored on the memory 3.
Of course, in practice, the various components in the host device are coupled together by the bus system 4. It will be appreciated that the bus system 4 is used to enable connection communication between these components. The bus system 4 comprises, in addition to a data bus, a power bus, a control bus and a status signal bus. For the sake of clarity, however, the various buses are labeled as bus system 4 in fig. 4.
The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the host device. Examples of such data include: any computer program for operating on a host device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 2 described in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The virtual machine data access method disclosed in the embodiment of the present application may be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the virtual machine data access method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 2. The processor 2 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or execute the virtual machine data access methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the virtual machine data access method disclosed in the embodiments of the present application may be directly implemented as the execution of a hardware decoding processor, or implemented by the combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing virtual machine data access method in combination with its hardware.
When the processor 2 executes the program, the corresponding processes in the data access method of each virtual machine according to the embodiment of the present application are implemented, and for brevity, are not described herein again.
In an exemplary embodiment, the present application further provides a storage medium, specifically a computer storage medium, for example, a memory 3 storing a computer program, where the computer program is executable by a processor 2 to perform the steps of the foregoing virtual machine data access method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, terminal and virtual machine data access method may be implemented in other ways. The above-described device embodiments are only illustrative, for example, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the virtual machine data access method embodiment may be completed by hardware related to program instructions, where the program may be stored in a computer-readable storage medium, and when executed, the program performs the steps including the virtual machine data access method embodiment; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially implemented in the form of a software product, which is stored in a storage medium and includes several instructions to enable a host device (which may be a personal computer, a server, or a network device) to execute all or part of the virtual machine data access methods of the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The virtual machine data access equipment provided by the application firstly acquires the running state of the virtual machine, and then judges whether the operation state is the downtime state, if the running state of the virtual machine is the downtime state, data access operation is performed on the virtual machine disk based on the mounting relation established with the virtual machine disk, wherein the virtual machine disk is a disk called by the virtual machine in the running process. When the device cannot access due to the fact that the virtual machine is abnormal, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the virtual machine disk, and accordingly the access of the host machine to the file data in the virtual machine with abnormal operation is achieved.
In addition, the embodiment of the application also discloses a computer readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the virtual machine data access method are realized.
The computer-readable storage medium provided by the application is applied to a host machine running with a virtual machine, firstly, the running state of the virtual machine is obtained, and then whether the operation state is a downtime state is judged, if the running state of the virtual machine is the downtime state, data access operation is executed on the virtual machine disk based on a mounting relation established with the virtual machine disk, wherein the virtual machine disk is a disk called by the virtual machine in the running process. When the computer readable storage medium cannot be accessed due to the fact that the virtual machine is abnormal, the host machine of the virtual machine mounts the virtual machine disk corresponding to the virtual machine, and then the host machine can access the virtual machine disk, so that the host machine can access the virtual machine disk, and accordingly the host machine can access the virtual machine disk which is abnormally operated.
The foregoing details a method, an apparatus, a device, and a storage medium for accessing data of a virtual machine provided by the present application. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another 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.

Claims (10)

1. A virtual machine data access method is applied to a host machine running a virtual machine, and comprises the following steps:
acquiring the running state of the virtual machine;
judging whether the running state is a downtime state or not;
if the running state is the downtime state, executing data access operation on the virtual machine disk based on the mounting relation established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process.
2. The virtual machine data access method according to claim 1, wherein the mount relationship established with the virtual machine disk includes:
and the mounting relation is established with the virtual machine disk in a mode of sending a mounting request to the virtual machine disk corresponding to the virtual machine.
3. The method for accessing data of a virtual machine according to claim 1, wherein the performing the data access operation on the virtual machine disk based on the mount relationship established with the virtual machine disk includes:
and executing the data access operation on the virtual machine disk based on the mounting relation established with the target folder path in the virtual machine disk.
4. The method for accessing data of a virtual machine according to claim 1, wherein the obtaining the running state of the virtual machine includes:
acquiring the running state of the corresponding virtual machine according to a virtual machine access request transmitted by a front-end page;
before the data access operation is performed on the virtual machine disk based on the mount relationship established with the virtual machine disk, the method further includes:
feeding back a folder path in the virtual machine disk to the front-end page, and receiving an access operation request transmitted by the front-end page;
the data access operation is executed on the virtual machine disk based on the mounting relation established with the virtual machine disk, and the data access operation comprises the following steps:
and executing data access operation corresponding to the access operation request on the virtual machine disk based on the mounting relation established with the virtual machine disk.
5. The virtual machine data access method according to claim 4, wherein before the performing, on the virtual machine disk based on the mount relationship established with the virtual machine disk, the data access operation corresponding to the access operation request, the method further comprises:
feeding back a verification window to the front-end page;
receiving verification information transmitted through the front-end page;
judging whether the verification information is target verification information with access authority or not;
and if the verification information is target verification information with access authority, executing the step of executing data access operation corresponding to the access operation request on the virtual machine disk based on the mounting relation established with the virtual machine disk.
6. The method for accessing data of a virtual machine according to claim 5, wherein if the verification information is not the target verification information with access right, the method further comprises:
and feeding back a verification exception prompt to the front-end page.
7. The method according to any one of claims 1 to 6, wherein if the operating status is not down, the method further comprises:
stopping executing data access operations to the virtual machine.
8. A virtual machine data access device is applied to a host machine running a virtual machine, and comprises:
the state acquisition module is used for acquiring the running state of the virtual machine;
the state judgment module is used for judging whether the running state is a downtime state or not, and if so, the mounting access module is called;
the mount access module is used for executing data access operation on the virtual machine disk based on the mount relation established with the virtual machine disk; the virtual machine disk is a disk called by the virtual machine in the running process.
9. A host device, running a virtual machine and establishing a communication connection with a virtual machine disk corresponding to the virtual machine, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the virtual machine data access method of any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the virtual machine data access method according to any one of claims 1 to 7.
CN202010947086.4A 2020-09-10 2020-09-10 Virtual machine data access method, device, equipment and storage medium Active CN112035219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010947086.4A CN112035219B (en) 2020-09-10 2020-09-10 Virtual machine data access method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010947086.4A CN112035219B (en) 2020-09-10 2020-09-10 Virtual machine data access method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112035219A true CN112035219A (en) 2020-12-04
CN112035219B CN112035219B (en) 2024-04-09

Family

ID=73584641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010947086.4A Active CN112035219B (en) 2020-09-10 2020-09-10 Virtual machine data access method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112035219B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656146A (en) * 2021-08-18 2021-11-16 爱尚游(北京)科技股份有限公司 Method, device and equipment for loading data during starting of virtual machine and storage medium
CN114443229A (en) * 2022-01-29 2022-05-06 苏州浪潮智能科技有限公司 Mirror image file mounting method and device, electronic equipment and storage medium
CN114443229B (en) * 2022-01-29 2024-10-22 苏州浪潮智能科技有限公司 Image file mounting method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080307259A1 (en) * 2007-06-06 2008-12-11 Dell Products L.P. System and method of recovering from failures in a virtual machine
CN105630577A (en) * 2015-12-23 2016-06-01 深圳市深信服电子科技有限公司 Virtual machine data exchange method and apparatus
CN107391224A (en) * 2017-06-09 2017-11-24 华为技术有限公司 A kind of creation method of virtual volume, hanging method and device
CN107466397A (en) * 2015-04-07 2017-12-12 微软技术许可有限责任公司 The virtual machine supported by host virtual storage
CN107463427A (en) * 2017-06-29 2017-12-12 北京北信源软件股份有限公司 The acquisition methods and device of a kind of VME operating system type and version
CN109684029A (en) * 2018-11-02 2019-04-26 新华三云计算技术有限公司 Storage content access method, device, electronic equipment and computer storage medium
US20190138350A1 (en) * 2017-11-07 2019-05-09 Fujitsu Limited Information processing apparatus and information processing system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080307259A1 (en) * 2007-06-06 2008-12-11 Dell Products L.P. System and method of recovering from failures in a virtual machine
CN107466397A (en) * 2015-04-07 2017-12-12 微软技术许可有限责任公司 The virtual machine supported by host virtual storage
CN105630577A (en) * 2015-12-23 2016-06-01 深圳市深信服电子科技有限公司 Virtual machine data exchange method and apparatus
CN107391224A (en) * 2017-06-09 2017-11-24 华为技术有限公司 A kind of creation method of virtual volume, hanging method and device
CN107463427A (en) * 2017-06-29 2017-12-12 北京北信源软件股份有限公司 The acquisition methods and device of a kind of VME operating system type and version
US20190138350A1 (en) * 2017-11-07 2019-05-09 Fujitsu Limited Information processing apparatus and information processing system
CN109684029A (en) * 2018-11-02 2019-04-26 新华三云计算技术有限公司 Storage content access method, device, electronic equipment and computer storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656146A (en) * 2021-08-18 2021-11-16 爱尚游(北京)科技股份有限公司 Method, device and equipment for loading data during starting of virtual machine and storage medium
CN114443229A (en) * 2022-01-29 2022-05-06 苏州浪潮智能科技有限公司 Mirror image file mounting method and device, electronic equipment and storage medium
CN114443229B (en) * 2022-01-29 2024-10-22 苏州浪潮智能科技有限公司 Image file mounting method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112035219B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
US7574627B2 (en) Memory dump method, memory dump program and computer system
CN104281520B (en) Tracking and method, the apparatus and system of debugging
US11182253B2 (en) Self-healing system for distributed services and applications
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
CN110058920B (en) Virtual machine performance detection method and device, electronic equipment and storage medium
CN106656927B (en) Method and device for adding Linux account into AD domain
CN107370622B (en) Method and system for multiplexing host machine MAC and IP by virtual machine
WO2021121407A1 (en) Capacity changing method and apparatus for virtual machine
CN112003895B (en) Cloud host evacuation method, device, equipment and storage medium in OpenStack cloud platform
CN110972497A (en) Disaster recovery method and device for virtualization platform
CN110990124A (en) Cloud host recovery method and device
CN112035219B (en) Virtual machine data access method, device, equipment and storage medium
US11354107B2 (en) Communicating a data image for installing an operating system
CN111475335B (en) Method, system, terminal and storage medium for quickly recovering database
CN105824622B (en) Data processing method and electronic equipment
CN110134546B (en) Batch restarting windows system method, electronic device and storage medium
CN114465902B (en) Method, system, equipment and medium for managing bond by cloud host multi-network card
CN113360172B (en) Application deployment method, device, computer equipment and storage medium
GB2532076A (en) Backup method, pre-testing method for environment updating and system thereof
CN113656146A (en) Method, device and equipment for loading data during starting of virtual machine and storage medium
CN110908725B (en) Application program starting method and device, electronic equipment and readable medium
CN106354602A (en) Service monitoring method and equipment
CN111970286A (en) User login method and device and web server
CN113157394B (en) Mirror image backup method and device, electronic equipment and storage medium
CN114205231B (en) Method, system and readable storage medium for starting hadoop clusters in batches

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