CN113656146A - Method, device and equipment for loading data during starting of virtual machine and storage medium - Google Patents

Method, device and equipment for loading data during starting of virtual machine and storage medium Download PDF

Info

Publication number
CN113656146A
CN113656146A CN202110949171.9A CN202110949171A CN113656146A CN 113656146 A CN113656146 A CN 113656146A CN 202110949171 A CN202110949171 A CN 202110949171A CN 113656146 A CN113656146 A CN 113656146A
Authority
CN
China
Prior art keywords
virtual machine
storage devices
data
mapping
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110949171.9A
Other languages
Chinese (zh)
Inventor
刘杰
廖胜洪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aishangyou Beijing Technology Co ltd
Original Assignee
Aishangyou Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aishangyou Beijing Technology Co ltd filed Critical Aishangyou Beijing Technology Co ltd
Priority to CN202110949171.9A priority Critical patent/CN113656146A/en
Publication of CN113656146A publication Critical patent/CN113656146A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for loading data when a virtual machine is started, wherein the method comprises the following steps: acquiring the running state of the virtual machine; judging whether the running state is a downtime state or not; executing data loading operation on a plurality of storage devices of the virtual machine based on the mapping relation established between the plurality of storage devices of the virtual machine; the plurality of storage devices of the virtual machine are called storage devices in the running process of the virtual machine. The device includes: the system comprises a state acquisition module, a state judgment module and a mapping loading module; the apparatus includes a memory and a processor; the storage medium having stored thereon a computer program; the invention mainly aims to provide a method for loading data when a virtual machine is started, aims to load data from a plurality of storage devices to start the virtual machine to run, and is more convenient and intelligent to use and higher in safety.

Description

Method, device and equipment for loading data during starting of virtual machine and storage medium
Technical Field
The present invention relates to the field of virtual machine technologies, and in particular, to a method, an apparatus, a device, and a storage medium for loading data when a virtual machine is started.
Background
A VM (Virtual Machine) refers to a complete computer system having complete hardware system functions, which is simulated by software and runs in a completely isolated environment. The virtual machine generally executes the boot task by calling the script in the boot stage, however, each script needs to load the system module and the custom module when being started, which results in too long time consumption and slow boot of the virtual machine.
The virtual controller consists of different types of virtual machines and application software running on the virtual machines, and the cloud technology is utilized to dynamically adjust the number of the different types of virtual machines according to the load of the controller. The network management system is in communication connection with the virtualization controller, the network management system performs modeling according to a virtual machine of the virtualization controller, the network management system sends a related control instruction to the virtualization controller, and the virtualization controller performs related control on the virtual machine according to the related control instruction.
The virtualized Storage Pool (Cloud Storage Pool) refers to a plurality of sets of unit devices, and is aggregated through a network, so that modular seamless horizontal expansion is realized, and a uniform Storage resource Pool is formed; including elements such as backup software, snapshot techniques, online data error correction, online data compression, etc.
When the computing service is implemented by the virtualization technology, it is often necessary to virtualize a physical host to create a virtual machine, and the virtual machine runs the corresponding computing service. When the storage device fails, the virtual machine cannot be started, and the operation and maintenance personnel often need to repair the storage device to recover and start the data of the virtual machine, which is a difficult point of the current technology if the storage device is repaired.
Therefore, it is a technical problem to be solved by those skilled in the art to provide a data loading method during virtual machine startup to load data from multiple storage devices to start up a virtual machine to run.
The Chinese patent application numbers are: 201410758202.2, application date is 12/10/2014, publication date is: 2016 month 07, 06, with patent names: the invention discloses a virtual machine data loading method and a system, and the method comprises the following steps: when monitoring a virtual machine starting message notification sent by a virtualization controller, acquiring a virtual machine starting state message sent by the virtualization controller; analyzing the virtual machine starting state information to obtain a target virtual machine identifier needing to load virtual machine data; and searching and acquiring virtual machine data corresponding to the target virtual machine identifier from a preset virtual machine resource pool according to the target virtual machine identifier, and loading the virtual machine data into a network management system for persistence processing. The invention also discloses a virtual machine data loading device. The invention realizes the real-time synchronization of the virtual machine data of the virtualization control to the network management system, thereby the virtual machine data in the network management system and the virtual machine data in the virtualization controller are kept consistent in real time.
The above patent document discloses a method and a system for loading data in a virtual machine, but the system cannot load data from multiple storage devices to start the virtual machine to run, and the system has low security and reliability, and the user experience is yet to be further improved.
Disclosure of Invention
The invention mainly aims to provide a method for loading data when a virtual machine is started, aims to load data from a plurality of storage devices to start the virtual machine to run, and is more convenient and intelligent to use and higher in safety.
In order to achieve the above object, the present invention provides a method for loading data when a virtual machine is started, which includes the following steps:
s10: acquiring the running state of the virtual machine;
s11: judging whether the running state is a downtime state or not;
s12: executing data loading operation on a plurality of storage devices of the virtual machine based on the mapping relation established between the plurality of storage devices of the virtual machine; the plurality of storage devices of the virtual machine are called storage devices in the running process of the virtual machine.
The S10: and acquiring the running state of the virtual machine, including acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the client.
The method for acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the client comprises the following steps:
s20: acquiring a corresponding virtual machine running state according to a virtual machine access request transmitted by a front-end page;
s21: judging whether the running state is a downtime state or not;
s22: feeding back mapping rules mapped by a plurality of virtual machine disks to a front-end page, and receiving an access operation request transmitted by the front-end page;
s23: and executing data access operation corresponding to the access loading operation request on the virtual machine disk based on the mapping relation established by the plurality of virtual machine disks.
The establishing of the mapping relation with the plurality of storage devices of the virtual machine comprises establishing the mapping relation with the plurality of storage devices of the virtual machine in a mode of sending mapping requests to the plurality of storage devices corresponding to the virtual machine.
The executing the data loading operation on the plurality of storage devices based on the mapping relationship established with the plurality of storage devices comprises executing the data loading operation on the plurality of storage devices based on the mapping relationship established with the target snapshots in the plurality of storage devices.
The method before executing the data load operation corresponding to the data load operation request on the plurality of storage devices based on the mapping relationship established with the plurality of storage devices further comprises the following steps:
s30: providing authentication information to a plurality of storage devices;
s31: judging whether the verification information is target verification information with access authority or not;
s32: and if the verification information is the target verification information with the access right, executing a data loading operation corresponding to the loading operation request to the plurality of storage devices based on the mapping relation established between the plurality of storage devices.
The invention also provides a data loading device during the startup of the virtual machine, which comprises:
the state acquisition module is used for acquiring the running state of the virtual machine;
the state judging module is used for judging whether the running state of the virtual machine is a downtime state or not, and if so, the mapping loading module is called;
the mapping loading module is used for executing data loading operation on the plurality of storage devices based on the mapping relation established between the mapping loading module and the plurality of storage devices; the plurality of storage devices are called by the virtual machine in the running process.
The present invention further provides a host device, including: a memory for storing a computer program; and the processor is used for realizing the steps of the method for loading the data when the virtual machine is started when the computer program is executed.
The invention further provides a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program implements the steps of the method for loading data when the virtual machine is started.
The data loading method during the starting of the virtual machine is applied to a host machine running the virtual machine, firstly, the state of the virtual machine is obtained, and then whether the operation state is the downtime state is judged, if the operation state of the virtual machine is the downtime state, data loading operation is executed on a plurality of storage devices based on the mapping relation established between the data loading operation and the plurality of storage devices, wherein the plurality of storage devices are the storage devices called by the virtual machine in the operation process. When a certain storage device is abnormal and cannot be accessed, the virtual machine can access other storage devices which are not abnormal to load data, so that the data are loaded from the plurality of storage devices to start the virtual machine to run. In addition, the application also provides a virtual machine data loading 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 invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a flowchart of an embodiment of a method for loading data when a virtual machine is started according to the present invention;
FIG. 2 is a flowchart illustrating a method for loading data during startup of a virtual machine according to another embodiment of the present invention;
FIG. 3 is a block diagram of a data loading apparatus during the startup of a virtual machine according to the present invention;
fig. 4 is a system block diagram of a host device according to the present invention.
The reference numbers illustrate:
reference numerals Name (R) Reference numerals Name (R)
10 State acquisition module 11 State judging module
12 Mapping loading module 1 Communication interface
2 Processor with a memory having a plurality of memory cells 3 Memory device
4 Bus system
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that all the directional indicators (such as up, down, left, right, front, and rear … …) in the embodiment of the present invention are only used to explain the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indicator is changed accordingly.
In the present invention, unless otherwise expressly stated or limited, the terms "connected," "secured," and the like are to be construed broadly, and for example, "secured" may be a fixed connection, a removable connection, or an integral part; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In addition, the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
When different operation services are realized in the cloud computing infrastructure, it is often necessary to virtualize a physical host in the cloud computing infrastructure 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 enable the abnormal running virtual machine to affect normal starting of an original file of the virtual machine is a current technical difficulty.
Therefore, the core of the invention is to provide a data loading method during the startup of the virtual machine, so as to realize that the normal startup of the original file of the virtual machine is not influenced by the abnormal running virtual machine.
Referring to fig. 1, the present invention provides a data loading method during virtual machine startup, which is applied to a host machine running a virtual machine;
the method for loading data during the starting of the virtual machine comprises the following steps:
s10: acquiring the running state of the virtual machine;
s11: judging whether the running state is a downtime state or not;
s12: if the running state is the downtime state, executing data loading operation on the plurality of storage devices of the virtual machine based on the mapping relation established between the running state and the plurality of storage devices of the virtual machine; the plurality of storage devices of the virtual machine are called storage devices in the running process of the virtual machine.
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 specifically limited herein.
In addition, the purpose of this embodiment is to normally start the virtual machine and load data when the virtual machine running in the host computer 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.
Referring to fig. 1, step S11: and judging whether the running state is the downtime state, if so, executing the step S12.
Step S12: and executing data loading operation on the virtual machine disk based on the mapping relation established by 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 enables the virtual machine to execute data loading operation on the virtual machine disk based on a plurality of mapping relations established between the host machine and 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 mapping relationship of the present embodiment refers to a communication relationship in which a folder path in the storage device or a data file in the folder path can be accessed by the file system. The host machine establishes a mapping 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 mapping 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 mapping relation with the virtual machine disk, the host machine further executes data loading operation on the virtual machine disk based on the mapping relation, so that the virtual machine can normally load the data in the virtual machine disk.
The data loading method during the starting of the virtual machine is applied to a host machine running the virtual machine, the state of the virtual machine is firstly obtained, whether the operation state is a downtime state or not is further judged, if the operation state of the virtual machine is the downtime state, data loading operation is carried out on the virtual machine disk based on a mapping relation established with the virtual machine disk, and the virtual machine disk is a disk called by the virtual machine in the operation process. According to the method, when the virtual machine cannot be accessed due to the fact that the virtual machine is abnormal, the host machine of the virtual machine maps a plurality of virtual machine disks corresponding to the virtual machine, so that the virtual machine can be started by loading the disks normally, and accordingly access to the virtual machine file data which are abnormally operated by mapping the virtual machine disks through the host machine is achieved.
In this embodiment, preferably, the establishing a mapping relationship with a plurality of storage devices of the virtual machine includes establishing a mapping relationship with a plurality of storage devices of the virtual machine by sending mapping requests to the plurality of storage devices corresponding to the virtual machine.
In this embodiment, preferably, the performing, on the plurality of storage devices, a data loading operation based on the mapping relationship established with the plurality of storage devices includes performing, on the plurality of storage devices, a data loading operation based on the mapping relationship established with the target snapshot in the plurality of storage devices.
In this embodiment, it is further preferable that the method before executing the data loading operation corresponding to the data loading operation request on the plurality of storage devices based on the mapping relationship established with the plurality of storage devices further includes the following steps:
s30: providing authentication information to a plurality of storage devices;
s31: judging whether the verification information is target verification information with access authority or not;
s32: and if the verification information is the target verification information with the access right, executing a data loading operation corresponding to the loading operation request to the plurality of storage devices based on the mapping relation established between the plurality of storage devices.
Preferably, if the running status is not the down status, the method for verifying the target information with the access right further includes: and stopping executing the data loading operation of the virtual machine.
On the basis of the above embodiment, as a preferred implementation, the mapping relationship established with the virtual machine includes:
and the mapping relation is established between the virtual machine disk and the virtual machine disk by sending a mapping request 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 virtual machine establishes a mapping relationship with a plurality of virtual machine disks, specifically, a host sends a mapping request to the virtual machine disk to request that the virtual machine disk is used as a block device, and a folder path of the plurality of virtual machine disks is mapped to a specific configuration where data is loaded when the virtual machine is started. The embodiment establishes the mapping relation with the virtual machine disk by sending the mapping request to the plurality of virtual machine disks corresponding to the virtual machine, thereby further ensuring the reliability of the establishment and the mapping relation between the virtual machine and the plurality of virtual machine disks.
On the basis of the foregoing embodiment, as a preferred implementation manner, the executing a data loading operation on a virtual machine disk based on a mapping relationship established between the virtual machine disk and a plurality of virtual machine disks includes:
and executing data loading operation on the plurality of virtual machine disks based on the mapping relation established with the target folder path in the plurality of virtual machine disks.
It should be noted that the important point of the present embodiment is to establish a mapping relationship with a specific folder path in a plurality of virtual machine disks, that is, a target folder path, when the mapping relationship between a virtual machine and a plurality of virtual machine disks is established.
In this embodiment, the target folder path may be a folder path in which a specific type of file is stored in multiple virtual machine disks, where the target folder path includes, but is not limited to, a folder path in which a memory image file or a virtual machine operation log file is stored, and the virtual machine can obtain the memory image file or the virtual machine operation log file in the target folder path based on the mapping relationship, so as to analyze the cause of the abnormality of the virtual machine and eliminate the abnormality in the virtual machine.
In the embodiment, the virtual machine can relatively efficiently acquire the file under the path of the target folder based on the mapping relationship, and the access efficiency of the virtual machine data is further improved.
In this embodiment, preferably, the step S10: and acquiring the running state of the virtual machine, including acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the client.
Referring to fig. 2, the obtaining of the running state of the corresponding virtual machine according to the virtual machine access request sent by the client includes the following steps:
s20: acquiring a corresponding virtual machine running state according to a virtual machine access request transmitted by a front-end page;
s21: judging whether the running state is a downtime state or not;
s22: feeding back mapping rules mapped by a plurality of virtual machine disks to a front-end page, and receiving an access operation request transmitted by the front-end page;
s23: and executing data access operation corresponding to the access loading operation request on the virtual machine disk based on the mapping relation established by the plurality of virtual machine disks.
In this embodiment, the front-end page initiates loading of data when the virtual machine is started to the host, where the front-end page refers to a page for responding to an operation of a user and transmitting a request or data generated by the operation to the host, the user establishes an interaction relationship between the user and the host, and the front-end page includes, but is not limited to, a World Wide WEB (World Wide WEB) page or an application page, and is determined according to an actual demand.
Furthermore, in this embodiment, the front-end page initiates an access request to a 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 required by the user 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: the method comprises the steps of mapping a plurality of virtual machine disks to virtual machines in a host machine, and receiving access operation requests transmitted by a front-end page.
In this step, a mapping rule for mapping multiple virtual machine disks to virtual machines is further fed back to the front-end page, so as to ensure that a user of the front-end page can specifically initiate an access operation request according to the virtual machine mapping rule, and know the disk copy state, and further receive an access operation request transmitted from the front-end page after the mapping rule for mapping multiple virtual machine disks to virtual machines is fed back to the front-end page, where the access operation request refers to accessing a data file in a virtual machine disk.
Step S23: and based on the mapping relation established by the virtual machine disks, executing data access operation corresponding to the data loading and access operation request on the virtual machine disks.
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 loading access operation corresponding to the access operation request on the virtual machine disk based on the mapping relationship, so as to implement data loading on 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 mapping 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 receipt access operation corresponding to the access operation request to the virtual machine disk based on the mapping relation established between the verification information and 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 mapping 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 valid access right to the virtual machine.
The host machine 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 data access operation corresponding to the access operation request on the virtual machine disk based on a mapping relation 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 operation of establishing the disk mapping of the plurality of virtual machines on the virtual machine.
According to the embodiment, when the running state is judged not to be the downtime state, the operation of mapping the virtual machine disks is carried out, so that the data in the virtual machine can be accessed in a mode of mapping the virtual machine disks by the host machine only when the virtual machine is in the downtime state, and the data can be accessed to the virtual machine 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, the present invention also discloses a virtual machine data access device, 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 judging module 11 is used for judging whether the running state is the downtime state, and if so, the virtual machine mapping module is called;
the virtual machine mapping module 12 is configured to perform a data access operation on a virtual machine disk based on a mapping relationship established between the virtual machine disk and a plurality of virtual machine disks; the virtual machine disk is a disk called by the virtual machine in the running process.
In this embodiment, the mapping relationship between the mapping access module 12 and the virtual machine disk includes:
and the mapping relation is established between the virtual machine disk and the virtual machine disk by sending a mapping request to the virtual machine disk corresponding to the virtual machine.
In this embodiment, the executing of the data access operation on the virtual machine disk by the mapping access module 12 based on the mapping relationship established with the virtual machine disk includes:
and executing data access operation on the virtual machine disk based on the mapping relation established with the target folder path in the virtual machine disk.
In this embodiment, the state 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 virtual machine data access device of the invention further comprises:
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 mapping access module 12 performs data access operations on the virtual machine disk based on the mapping 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 mapping relation established with the virtual machine disk.
In a specific embodiment, the virtual machine data access apparatus of the present invention further includes:
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 judging module is used for judging whether the verification information is target verification information with access authority, and if so, the mapping access module 12 is called.
In this embodiment, 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 this embodiment, if the result of the state determination module is negative, the operation stop module is executed:
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 invention 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 carried out on the virtual machine disks based on the mapping relation established with a plurality of virtual machine disks, wherein the virtual machine disks are disks called by the virtual machine in the running process. When the virtual machine is abnormal and cannot be accessed, the host machine of the virtual machine maps the virtual machine disks corresponding to the virtual machines, and then the virtual machine can access the virtual machine disks, so that the access of the virtual machine to the file data in the virtual machine with abnormal operation is realized.
Based on the hardware implementation of the program module, and in order to implement the virtual machine data loading method according to the embodiment of the present application, the 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;
referring to fig. 4, the present invention also provides a host device, including: a memory 3 for storing a computer program; and the processor 2 is used for implementing the steps of the method for loading the data when the virtual machine is started when the computer program is executed.
The host device comprises:
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 data loading method during the starting of the virtual machine 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 embodiments of the 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 by the embodiment of the invention can be applied to the processor 2, or can be 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 data loading method when the virtual machine is started disclosed in the embodiments of the present application can 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 process in the data loading method when each virtual machine is started in the embodiment of the present application is realized, and for brevity, no further description is given here.
In an exemplary embodiment, an embodiment of the present invention further provides a storage medium, specifically a computer storage medium, which is a computer readable 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 data loading method when the virtual machine is started. 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 loading device provided by the application firstly obtains the running state of the virtual machine, and then judges whether the running state is the downtime state, if the running state of the virtual machine is the downtime state, data loading operation is executed on the virtual machine based on the mapping relation established between the virtual machine and 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 be started due to the fact that the virtual machine disk is abnormal, the host machine of the virtual machine maps the virtual machine disks corresponding to the virtual machine, so that the virtual machine can be started by loading the disks normally, and access to the virtual machine file data which runs abnormally through the host machine mapping of the virtual machine disks 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 data loading method during the startup of the virtual machine are realized.
The invention further provides a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program implements the steps of the method for loading data when the virtual machine is started.
The computer readable storage medium provided by the invention 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, the virtual machine is enabled to execute data loading operation on the virtual machine disk based on a plurality of mapping relations established with the virtual machine disk;
the virtual machine disk is a disk called by the virtual machine in the running process. When the computer readable storage medium cannot be loaded due to the fact that the virtual machine is abnormal, a host machine of the virtual machine maps a plurality of virtual machine disks corresponding to the virtual machine, so that the virtual machine can be started by the normally loaded disks of the virtual machine, and accordingly access to the abnormally operated virtual machine file data by mapping the virtual machine disks through the host machine is achieved.
The method, the device, the equipment and the storage medium for loading data when the virtual machine is started are described in detail above. 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.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for loading data when a virtual machine is started is characterized by comprising the following steps:
s10: acquiring the running state of the virtual machine;
s11: judging whether the running state is a downtime state or not;
s12: executing data loading operation on a plurality of storage devices of the virtual machine based on the mapping relation established between the plurality of storage devices of the virtual machine; the plurality of storage devices of the virtual machine are called storage devices in the running process of the virtual machine.
2. The method for data loading at startup of virtual machine according to claim 1, wherein said S10: and acquiring the running state of the virtual machine, including acquiring the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the client.
3. The method for loading data when a virtual machine starts up according to claim 2, wherein the step of obtaining the running state of the corresponding virtual machine according to the virtual machine access request transmitted by the client comprises the following steps:
s20: acquiring a corresponding virtual machine running state according to a virtual machine access request transmitted by a front-end page;
s21: judging whether the running state is a downtime state or not;
s22: feeding back mapping rules mapped by a plurality of virtual machine disks to a front-end page, and receiving an access operation request transmitted by the front-end page;
s23: and executing data access operation corresponding to the access loading operation request on the virtual machine disk based on the mapping relation established by the plurality of virtual machine disks.
4. The method for data loading when the virtual machine is started according to any one of claims 1 to 3, wherein the establishing of the mapping relationship with the plurality of storage devices of the virtual machine includes establishing the mapping relationship with the plurality of storage devices of the virtual machine by sending mapping requests to the plurality of storage devices corresponding to the virtual machine.
5. The method for data loading when the virtual machine is started up as claimed in any one of claims 1 to 3, wherein the performing the data loading operation on the plurality of storage devices based on the mapping relationship established with the plurality of storage devices comprises performing the data loading operation on the plurality of storage devices based on the mapping relationship established with the target snapshot in the plurality of storage devices.
6. The method for data loading during startup of a virtual machine according to claim 3, wherein the method before the data loading operation corresponding to the data loading operation request is executed on the plurality of storage devices based on the mapping relationship established between the plurality of storage devices further comprises the following steps:
s30: providing authentication information to a plurality of storage devices;
s31: judging whether the verification information is target verification information with access authority or not;
s32: and if the verification information is the target verification information with the access right, executing a data loading operation corresponding to the loading operation request to the plurality of storage devices based on the mapping relation established between the plurality of storage devices.
7. The method for data loading when a virtual machine starts up as claimed in claim 6, wherein the method for verifying the target information with the access right includes feeding back a verification exception prompt to the client.
8. A data loading device during virtual machine startup is characterized by comprising:
the state acquisition module is used for acquiring the running state of the virtual machine;
the state judging module is used for judging whether the running state of the virtual machine is a downtime state or not, and if so, the mapping loading module is called;
the mapping loading module is used for executing data loading operation on the plurality of storage devices based on the mapping relation established between the mapping loading module and the plurality of storage devices; the plurality of storage devices are called by the virtual machine in the running process.
9. A host device, comprising: a memory for storing a computer program; a processor for implementing the steps of the method for data loading at startup of a virtual machine according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for data loading upon startup of a virtual machine according to any one of claims 1 to 7.
CN202110949171.9A 2021-08-18 2021-08-18 Method, device and equipment for loading data during starting of virtual machine and storage medium Pending CN113656146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110949171.9A CN113656146A (en) 2021-08-18 2021-08-18 Method, device and equipment for loading data during starting of virtual machine and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110949171.9A CN113656146A (en) 2021-08-18 2021-08-18 Method, device and equipment for loading data during starting of virtual machine and storage medium

Publications (1)

Publication Number Publication Date
CN113656146A true CN113656146A (en) 2021-11-16

Family

ID=78481012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110949171.9A Pending CN113656146A (en) 2021-08-18 2021-08-18 Method, device and equipment for loading data during starting of virtual machine and storage medium

Country Status (1)

Country Link
CN (1) CN113656146A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930467A (en) * 2020-07-02 2020-11-13 联想(北京)有限公司 Virtual machine starting method, device, equipment and computer readable storage medium
CN112035219A (en) * 2020-09-10 2020-12-04 深信服科技股份有限公司 Virtual machine data access method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930467A (en) * 2020-07-02 2020-11-13 联想(北京)有限公司 Virtual machine starting method, device, equipment and computer readable storage medium
CN112035219A (en) * 2020-09-10 2020-12-04 深信服科技股份有限公司 Virtual machine data access method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
KR102236522B1 (en) Method and apparatus for processing information
US9146839B2 (en) Method for pre-testing software compatibility and system thereof
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
US11182253B2 (en) Self-healing system for distributed services and applications
US9229820B2 (en) Information processing device with memory dump function, memory dump method, and recording medium
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN110457907B (en) Firmware program detection method and device
CN110943860A (en) BMC (baseboard management controller) firmware updating method and system, electronic equipment and storage medium
CN112684982B (en) Data migration method, system, equipment and computer readable storage medium
CN110063042A (en) A kind of response method and its terminal of database failure
CN111158945B (en) Kernel fault processing method, device, network security equipment and readable storage medium
CN112003895B (en) Cloud host evacuation method, device, equipment and storage medium in OpenStack cloud platform
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN117687695A (en) Information processing method, information processing device, electronic equipment and storage medium
CN112035219B (en) Virtual machine data access method, device, equipment and storage medium
CN111694724B (en) Test method and device of distributed form system, electronic equipment and storage medium
CN113656146A (en) Method, device and equipment for loading data during starting of virtual machine and storage medium
CN112751782B (en) Flow switching method, device, equipment and medium based on multi-activity data center
CN110908725B (en) Application program starting method and device, electronic equipment and readable medium
CN109634721B (en) Method and related device for starting communication between virtual machine and host
CN113204359A (en) Online server upgrading method and device
CN113220510A (en) Device detection method, detection device, and computer-readable storage medium
US9417863B2 (en) System and method for expedited loading of an image onto a storage device
CN117076180B (en) Information processing method, device, equipment and computer readable storage medium
CN112559450B (en) File access method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination