CN111782342A - Virtual machine starting method and device - Google Patents

Virtual machine starting method and device Download PDF

Info

Publication number
CN111782342A
CN111782342A CN202010618472.9A CN202010618472A CN111782342A CN 111782342 A CN111782342 A CN 111782342A CN 202010618472 A CN202010618472 A CN 202010618472A CN 111782342 A CN111782342 A CN 111782342A
Authority
CN
China
Prior art keywords
virtual machine
starting
boot
configuration file
virtual
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
CN202010618472.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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202010618472.9A priority Critical patent/CN111782342A/en
Publication of CN111782342A publication Critical patent/CN111782342A/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/4401Bootstrapping
    • 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • 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

Abstract

The application provides a virtual machine starting method and a virtual machine starting device, wherein the method comprises the following steps: determining a first starting configuration file, wherein the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated in the process of finishing the starting of the virtual machine based on the boot process; and finishing the starting of the virtual machine based on the first starting configuration file and the boot process. According to the virtual machine starting method, the first starting configuration file stored with the historical configuration data can be used for realizing the quick starting of the virtual machine.

Description

Virtual machine starting method and device
Technical Field
The embodiment of the application relates to the technical field of virtualization, in particular to a virtual machine starting method and device.
Background
In the prior art, a virtual machine simulator, such as a Qemu (Quick EMUlator), needs to go through many steps in a process of guiding a virtual machine to complete creation and start based on a traditional boot flow, the whole flow is cumbersome, and the virtual machine simulator needs to load various built-in modules when executing each boot step to successfully execute each step and obtain a corresponding execution result. Therefore, the virtual machine is started for a long time, and occupies a large amount of physical resources such as a central processing unit, a memory, an input/output system and the like during running, so that the response speed of the electronic device is low in the process of creating and starting the virtual machine.
Disclosure of Invention
The application provides a virtual machine starting method and device capable of achieving quick starting of a virtual machine by means of a first starting configuration file stored with historical configuration data.
In order to solve the foregoing technical problem, an embodiment of the present application provides a virtual machine starting method, including:
determining a first starting configuration file, wherein the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated in the process of finishing the starting of the virtual machine based on the boot process;
and finishing the starting of the virtual machine based on the first starting configuration file and the boot process.
Preferably, the boot flow includes the steps of:
creating the virtual main board and the virtual memory according to the obtained first virtual machine configuration information;
initializing the virtual mainboard;
establishing a storage space mapping relation between virtual hardware in the virtual main board and a virtual memory;
determining a target operating system according to the configuration information of the first virtual machine, and guiding the target operating system;
controlling the target virtual main board to load the kernel of the target operating system;
and starting a daemon program of the target operating system.
Preferably, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the determining a first boot profile includes:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
determining the first start-up configuration file according to the second virtual machine configuration information, wherein the second virtual machine configuration information is matched with the first virtual machine configuration information.
Preferably, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the determining a first boot profile includes:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining the first starting configuration file according to the second virtual machine configuration information, wherein the virtual mainboard configuration parameters stored in the first virtual machine configuration information are matched with the virtual mainboard configuration parameters in the second virtual machine configuration information.
Preferably, the completing the start of the virtual machine based on the first start-up configuration file and the boot process includes:
acquiring an execution result required by the virtual machine in the starting process from the first starting configuration file, wherein the required execution result is either all execution results stored in the first starting configuration file or execution results corresponding to the processing process of the virtual mainboard and stored in the first starting configuration file;
performing data calling on the required execution result, and determining a step corresponding to the guide flow based on the called execution result;
and skipping the corresponding steps in sequence based on the required execution result, and continuing to execute other steps in the boot flow until the virtual machine is started.
Preferably, a plurality of start-up configuration files are stored in the virtual machine simulator;
the determining a first boot profile includes:
responding to a virtual machine creating instruction input by a user;
determining that the second virtual machine configuration information input by the user is not received;
respectively determining the starting duration of the virtual machine corresponding to each starting configuration file;
determining the first boot profile from the plurality of boot profiles based on the boot-up duration.
Preferably, the determining the first boot profile includes:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
the method further comprises the following steps:
determining that no startup configuration file is stored or determining that the plurality of execution results are not contained in the stored startup configuration file based at least on the file content;
and guiding the virtual machine to finish starting based on the guide flow.
Preferably, the booting the virtual machine to complete the booting by the virtual machine emulator based on the boot flow includes:
guiding the first virtual machine to finish starting based on the boot flow, and simultaneously recording execution results corresponding to each step in the boot flow;
after the virtual machine is guided to finish the starting based on the guiding process, the method further comprises the following steps:
establishing the first starting configuration file;
and storing the execution result into the first starting configuration file.
Another embodiment of the present invention provides a virtual simulation apparatus, including:
the determining module is used for determining that a first starting configuration file is stored;
an execution module that completes the start of the virtual machine based on the first start-up configuration file and the boot flow
The first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated by the execution module in the process of executing the boot process to complete the starting of the virtual machine.
Preferably, the determining module is further configured to:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
when the determining module determines that no startup configuration file is stored or determines that the plurality of execution results are not included in the stored startup configuration file based at least on the file content, the executing module is further configured to:
and guiding the virtual machine to finish starting based on the guide flow.
Based on the above disclosure, it can be known that, in the present application, the virtual machine simulator can be assisted to create or start the virtual machine again based on the boot process by using the execution result correspondingly generated in the process of storing the history creation and starting the virtual machine, so that at least in the process of starting the virtual machine this time, the execution result of at least part of the boot step does not need to be processed and derived again, but can be directly subjected to data call on the stored execution result, so that the processes of processing and deriving at least part of the execution result can be reduced, the processing and deriving time is saved, the device processing load is reduced, the starting time of the virtual machine is shortened, and the virtual machine is quickly started.
Drawings
Fig. 1 is a flowchart of a virtual machine starting method in the embodiment of the present application.
Fig. 2 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 3 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 4 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 5 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 6 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 7 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 8 is a flowchart of a virtual machine starting method in another embodiment of the present application.
Fig. 9 is a block diagram of a virtual machine simulation apparatus according to an embodiment of the present application.
Fig. 10 is a block diagram of an electronic device in the embodiment of the present application.
Detailed Description
Specific embodiments of the present application will be described in detail below with reference to the accompanying drawings, but the present application is not limited thereto.
It will be understood that various modifications may be made to the embodiments disclosed herein. The following description is, therefore, not to be taken in a limiting sense, but is made merely as an exemplification of embodiments. Other modifications will occur to those skilled in the art within the scope and spirit of the disclosure.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above, and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely examples of the disclosure that may be embodied in various forms. Well-known and/or repeated functions and structures have not been described in detail so as not to obscure the present disclosure with unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the disclosure.
Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a virtual machine starting method, including:
determining a first starting configuration file, wherein the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated in the starting process of the virtual machine based on the boot process;
and finishing the creation and the starting of the virtual machine based on the first starting configuration file and the boot process.
For example, the electronic device is loaded with a virtual machine emulator software/program, which is an open source simulation processing software, such as qemu (quick emulator), and when the software is loaded in the electronic device, a virtual emulation module is generated for completing the start of the virtual machine, which is hereinafter referred to as a virtual machine emulator. After a user starts the virtual machine simulator and inputs a virtual machine creating instruction to the virtual machine simulator, the virtual machine simulator can determine whether a first starting configuration file is stored in a storage module of the virtual machine simulator, a plurality of execution results are stored in the first starting configuration file, and the plurality of execution results are correspondingly generated by the virtual machine simulator in the process of sequentially executing a guide flow to complete the creation and starting processes of the historical virtual machine. That is, the boot flow includes a plurality of boot steps, and when the virtual machine emulator executes the plurality of boot steps in sequence, an execution result is generated based on each boot step, and a next boot step needs to be executed after a previous boot step completes execution and generates a corresponding execution result. That is, the execution result of the previous boot step is a trigger condition for executing the next boot step. When the virtual machine simulator determines that a first starting configuration file is stored in the storage module of the virtual machine simulator or other storage modules of the electronic equipment, the virtual machine simulator at least completes the creation and starting of the virtual machine at this time together based on the first starting configuration file and the boot process. Or, when a user wants to start a certain historical virtual machine, the user may determine a first start configuration file corresponding to the historical virtual machine to be started, and then the device completes the start of the historical virtual machine based on the first start configuration file and the boot flow. Because the first start configuration file stores part or all of the execution results required in the starting process of the virtual machine, when the virtual machine simulator starts the virtual machine based on the boot flow, or the virtual machine is created and started, the execution results in the first start configuration file can be directly used, so that the processing results of at least part of the boot steps are not required to be deduced in the starting, or the creating and starting processes of the virtual machine, the starting time of the virtual machine is at least saved, the actual boot process is simplified, a large amount of intermediate redundant data generated when each processing result is deduced is avoided, the data processing load is reduced for the electronic equipment, and the response speed of the electronic equipment to a user is accelerated.
Therefore, based on the disclosure of the above embodiments, the embodiments of the present application have the beneficial effects that the execution results correspondingly generated in the process of creating and starting the virtual machine in the history are stored to assist the virtual machine simulator to create and start again based on the boot flow, or start the virtual machine again, so that in the process of starting the virtual machine this time, the execution results of at least part of the boot steps do not need to be processed and derived again, but can be directly called for the stored execution results, so that the processing and deriving processes of at least part of the execution results can be reduced, the processing and deriving time is saved, the processing load of the device is reduced, the starting time of the virtual machine is shortened, and the virtual machine is quickly started.
Further, as shown in fig. 2, the boot flow in this embodiment includes the following steps:
starting a virtual machine simulator;
creating a virtual main board and a virtual memory according to the obtained first virtual machine configuration information;
initializing a virtual mainboard;
establishing a storage space mapping relation between virtual hardware in a virtual mainboard and a virtual memory;
determining a target operating system according to the configuration information of the first virtual machine, and guiding the target operating system;
controlling a target virtual main board to load a kernel of a target operating system;
and starting the daemon of the target operating system.
The first virtual machine configuration information is input based on a dialog bar or the like for inquiring specific virtual hardware configuration fed back by the virtual machine emulator after the user inputs a virtual machine creation instruction, and may also be input by the user while inputting the virtual machine creation instruction, which is not limited specifically. The first virtual machine configuration information specifically includes configuration parameters of each virtual hardware in the first virtual machine, such as a model number of a virtual motherboard, a size of a virtual hard disk, and the like, and may also include a specified loaded virtual operating system, that is, a target operating system in the text, such as a loaded windows operating system, a linux operating system, and the like. Initializing the virtual motherboard includes starting a Sea BIOS program (SeaBIOS is an open source 16bit x86 BIOS program), and completing initialization of the memory, the central processing unit, and the input/output system on the virtual motherboard. The daemon for starting the target operating system may be, for example, a program for starting a firewall, installing a driver of virtual hardware, and the like, and of course, while the daemon is started, a client application, such as a browser, and the like, may also be started. The execution results are correspondingly generated when the virtual machine emulator executes the boot steps, and the execution results also include the already established virtual machine, that is, the execution results of the virtual main board and the virtual memory are created according to the first virtual machine configuration information. When the same virtual machine is started again, the execution result of the corresponding virtual machine can be directly called.
Further, when determining the first boot configuration file, the virtual machine emulator in this embodiment includes:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
and determining a first starting configuration file containing an execution result required for starting the virtual machine at this time from the starting configuration files at least based on the file content.
That is, in the process of determining the first startup configuration file, the virtual machine emulator first needs to determine whether the startup configuration file is stored in the storage module of the virtual machine emulator, and if it is determined that the startup configuration file is stored, the virtual machine emulator reads and determines the specific file content of each startup configuration file, and then determines the first startup configuration file from the stored startup configuration files based on at least the file content of each startup configuration file.
Specifically, the first startup configuration file in this embodiment further includes first virtual machine configuration information input by a user, where the first virtual machine configuration information at least includes virtual hardware configuration parameters of the first virtual machine. When the virtual machine emulator determines the first boot configuration file, the following two embodiments are specifically included:
the first embodiment is as follows:
the first starting configuration file also comprises appointed loaded target operating system information;
determining a first startup profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining a first starting configuration file according to the second virtual machine configuration information, wherein the second virtual machine configuration information is matched with the first virtual machine configuration information.
For example, as shown in fig. 3, the virtual machine emulator receives a virtual machine creation instruction input by a user, creates a new virtual machine, defines it as a second virtual machine, and inputs second virtual machine configuration information. The second virtual machine configuration information includes virtual hardware configuration parameters of the second virtual machine and target operating system information specified to be loaded. Then, the virtual machine emulator responds to an instruction input by a user, reads specific content in the second virtual machine configuration information, performs matching search in the storage module based on a read result, and if the specific content of the first virtual machine configuration information included in a certain start configuration file is found to be completely matched with the specific content of the read second virtual machine configuration information, that is, the two configuration information have the same virtual hardware configuration parameters and the same designated target operating system, it may be determined that the second virtual machine is the same in nature as the first virtual machine at this time, and the first virtual machine is started directly based on the boot flow and the configuration file, so the virtual machine emulator determines that the start configuration file is the first start configuration file.
Example two:
a difference between this embodiment and the embodiment is that, when the second virtual machine configuration information or the first virtual machine configuration information includes the target operating system information specified to be loaded, if the virtual machine emulator determines that the first virtual machine configuration information stored in a certain boot configuration file is completely the same as the configuration parameters related to the virtual hardware in the obtained second virtual machine configuration information, and the target operating system specified to be loaded is different, the virtual machine emulator also determines that the boot configuration file is the first boot configuration file.
Example three:
determining a first startup profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining a first starting configuration file according to the second virtual machine configuration information, wherein the virtual mainboard configuration parameters stored in the first virtual machine configuration information are matched with the virtual mainboard configuration parameters in the second virtual machine configuration information.
For example, as shown in fig. 4, the virtual machine emulator receives a virtual machine creation instruction input by the user, creates a new virtual machine, temporarily defines the new virtual machine as a second virtual machine again, and inputs second virtual machine configuration information. The second virtual machine configuration information includes at least virtual hardware configuration parameters of the second virtual machine. Then, the virtual machine emulator responds to an instruction input by a user, reads specific content in the second virtual machine configuration information, performs matching search in the storage module based on the read result, and if it is found that the specific content of the first virtual machine configuration information included in a certain startup configuration file is the same as the specific content of the read second virtual machine configuration information, the virtual motherboard configuration parameters are the same, it is indicated that the virtual motherboards of the first virtual machine and the second virtual machine are the same, and the execution result corresponding to the virtual motherboard can be executed without being executed again in the process of creating and starting the second virtual machine, and the virtual motherboard that has been created and started by the first virtual machine is directly used, that is, the execution result generated in the process of creating and starting the virtual motherboard by the first virtual machine is directly used. Accordingly, the virtual machine emulator determines that the boot configuration file is the first boot configuration file.
In addition, when the device determines whether the first startup configuration file is stored, the device may be searched based on the virtual machine configuration information specified by the user, for example, when the user wants to start a certain historical virtual machine, the virtual machine configuration information to be searched may be input in a search engine, and the search engine performs matching search based on the input information to determine the first startup configuration file.
Further, as shown in fig. 5, after determining the first boot configuration file, the method for completing the booting of the virtual machine based on the first boot configuration file and the boot process includes:
acquiring an execution result required by the virtual machine in the starting process from the first starting configuration file, wherein the required execution result is all execution results stored in the first starting configuration file or the execution results stored in the first starting configuration file and corresponding to the processing process of the virtual mainboard;
carrying out data calling on the required execution result, and determining the corresponding step in the guide flow based on the called execution result;
and skipping corresponding steps in sequence based on the required execution result, and continuing to execute other steps in the boot flow until the creation and the starting of the virtual machine are completed.
Specifically, after determining the first start configuration file, the virtual machine simulator may indicate that the first start configuration file includes a part or all of the execution results required in the current virtual machine start process. When determining the required execution result, the determination may be based on comparison of the virtual machine configuration information in the process of determining the first boot configuration file. For example, by comparing the first virtual machine configuration information and the second virtual machine configuration information, if the two pieces of configuration information are completely consistent, it can be determined that all the execution results in the first startup configuration file can be used for creating and starting the virtual machine at this time, that is, all the execution results in the first startup configuration file are required execution results. At this time, the virtual machine simulator does not need to create a virtual machine again, and directly performs steps such as initialization of the virtual hardware based on each data of the corresponding virtual hardware recorded in the first start configuration file and the boot flow until the virtual machine corresponding to the first start configuration file is started, the execution result of each boot step in the starting process does not need to be derived again, and the execution result stored in the first start configuration file is directly subjected to data calling, so that the starting speed is greatly increased. If the configuration parameters of the two pieces of configuration information only correspond to the virtual motherboard are consistent, the first boot configuration file only indicates that the execution result of the generation and initialization portion corresponding to the virtual motherboard in the boot flow is available, that is, only the execution result of the portion is the execution result required at this time. After the required execution result is determined, the virtual machine simulator carries out data calling on the required execution result, and determines a guide step corresponding to the execution result in the guide flow. And then, the virtual machine simulator executes a boot flow, directly calls a corresponding execution result after the corresponding boot step is reached, and triggers the execution of the next boot step based on the execution result, if the execution result of the next boot step can also be called without generation, directly calls the next boot step, continues to start the next boot step, executes the step according to a normal flow until no callable execution result exists, and generates a corresponding execution result until the creation and the starting of the virtual machine are completed. The above-mentioned repeatedly triggering the execution procedure of the next boot step based on the called execution result is a step jump procedure, that is, each boot step capable of directly calling the execution result is not required to be executed, each boot step can be directly skipped based on the corresponding execution result, and the boot step which needs to be normally executed to obtain the corresponding execution result is directly entered. In the process, the execution results of all the boot steps are obtained without derivation and processing, so that compared with the conventional virtual machine creating and starting process, the method of the embodiment saves more time, and enables the history data to be directly called when the history created virtual machines with the same configuration or only the virtual mainboards with the same configuration are created or started again without executing all the boot steps again.
Further, as shown in fig. 6, when a plurality of boot configuration files are stored in the virtual machine emulator,
determining a first startup profile, comprising:
responding to a virtual machine creating instruction input by a user;
determining that the second virtual machine configuration information input by the user is not received;
respectively determining the starting duration of the virtual machine corresponding to each starting configuration file;
a first startup profile is determined from a plurality of startup profiles based on a startup duration.
For example, when a plurality of start-up configuration files respectively corresponding to different virtual machines are stored in a storage module of the virtual machine simulator, when the virtual machine simulator receives a virtual machine creation instruction input by a user but does not receive second virtual machine configuration information input by the user, the virtual machine simulator may respectively determine a start-up duration for completing the corresponding virtual machine based on each start-up configuration file, and then select a first start-up configuration file from the plurality of start-up configuration files based on the duration. And then, the virtual machine simulator does not need to create a new virtual machine again, and the corresponding historical virtual machine is started directly on the basis of the first starting configuration file and the guiding process. The determining of each duration may specifically be determined according to a data size of each stored execution result, and if the data storage amount is large, the consumed time is usually long, and if the data storage amount is small, the consumed time is usually short. Or, the time consumed for starting the virtual machine corresponding to each start-up configuration file may be determined based on the time consumed for completing the start-up of each virtual motherboard and the target operating system recorded in the history. When the first start configuration file is determined, the start configuration file corresponding to the virtual machine which consumes the shortest time for completing start can be specifically selected as the first start configuration file, so that the start time of the virtual machine at this time is the shortest.
Alternatively, for the above case, the virtual machine emulator may also determine the first boot profile based on pre-stored priorities set for the respective boot profiles stored.
Further, as shown in fig. 7, the method in this embodiment further includes:
determining that the starting configuration file is not stored or determining that the stored starting configuration file does not contain a plurality of execution results at least based on the file content;
and guiding the virtual machine to complete the starting based on the guiding flow.
For example, the virtual machine simulator determines that no start-up configuration file is stored in the storage module, for example, when the virtual machine is first created, the created virtual machine is first started, or the stored start-up configuration file is found by reading the file content of the stored start-up configuration file, and determining that the stored configuration file does not contain a plurality of execution results, the virtual machine is automatically created or started according to the guiding process without calling any processing result.
For another example, when the virtual machine emulator determines that the first virtual machine configuration information is not matched with the second virtual machine configuration information completely, or only the target operating system information is matched, the virtual machine emulator may also determine that there is no first boot configuration file, and complete the creation or boot of the current virtual machine only based on the boot flow.
Further, as shown in fig. 8, the virtual machine emulator boots the virtual machine to complete the boot based on the boot flow, including:
guiding the first virtual machine to finish the starting of the virtual machine based on the boot flow, and simultaneously recording the execution results of all steps in the corresponding boot flow;
after the virtual machine is guided to finish the starting based on the guiding flow, the method further comprises the following steps:
establishing a first starting configuration file;
and storing the execution result into the first starting configuration file.
That is, if the first start-up configuration file is not found, when the virtual machine completes the creation and initialization of the virtual machine only through the boot process, the virtual machine simulator records the execution result of each step in the process of completing the creation and startup of the virtual machine based on the boot process, and after the virtual machine is started up, creates the first start-up configuration file in the storage module, and simultaneously stores all the recorded execution results, or simultaneously stores the received virtual machine configuration information input by the user, so that when the virtual machine is subsequently created again, the matched start-up configuration file can be quickly found.
As shown in fig. 9, another embodiment of the present invention also provides a virtual machine emulation apparatus, including:
a determination module to determine that a first startup profile is stored,
the processing module is used for finishing the starting of the virtual machine according to the first starting configuration file and the guide flow;
the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the plurality of execution results are generated by the processing module in order to execute the boot process so as to complete the creation and starting of the virtual machine.
For example, the virtual machine emulation device can include an open source emulation processor/open source emulation processing software, such as Qemu, Quick EMUlator. After a user starts the virtual machine simulation device and inputs a virtual machine creating instruction to the virtual machine simulation device, the determining module determines whether the virtual machine simulation device stores a first starting configuration file, wherein a plurality of execution results are stored in the first starting configuration file, and the plurality of execution results are correspondingly generated in the process that the processing module executes the guide flow in sequence to complete the creation and starting of the historical virtual machine. That is, the boot flow includes a plurality of boot steps, and when the processor executes the plurality of boot steps in sequence, an execution result is generated based on each boot step, and a next boot step needs to be executed after a previous boot step is completed and a corresponding execution result is generated. That is, the execution result of the previous boot step is a trigger condition for executing the next boot step. When the determining module determines that the virtual machine simulation device stores the first starting configuration file, the virtual machine simulation device is started together based on the first starting configuration file and the guiding process. Because the first start configuration file stores part or all of the execution results required in the starting process of the virtual machine, when the processing module starts the virtual machine based on the boot process, the execution results in the first start configuration file can be directly used, so that the processing results of at least part of the boot steps of the virtual machine are not required to be obtained by derivation again in the starting process, the starting time of the virtual machine is saved, the actual boot process is simplified, a large amount of intermediate redundant data generated when each processing result is obtained by derivation is avoided, the data processing load is reduced for the electronic equipment, and the response speed of the electronic equipment to a user is accelerated.
Therefore, based on the disclosure of the above embodiment, it can be seen that the embodiment of the present application has the beneficial effects that the execution result correspondingly generated in the process of creating and starting the virtual machine by using the stored history is used to assist the processor to create and start the virtual machine again based on the boot flow, so that in the process of starting the virtual machine this time, the execution result of at least part of the boot steps does not need to be processed and derived again, but can be directly called for the stored execution result, so that the processing and deriving processes of at least part of the execution result can be reduced, the processing and deriving time is saved, the processing load of the device is reduced, the starting time of the virtual machine is shortened, and the virtual machine is quickly started.
Further, the boot flow includes the steps of:
creating the virtual main board and the virtual memory according to the obtained first virtual machine configuration information;
initializing the virtual mainboard;
establishing a storage space mapping relation between virtual hardware in the virtual main board and a virtual memory;
determining a target operating system according to the configuration information of the first virtual machine, and guiding the target operating system;
controlling the target virtual main board to load the kernel of the target operating system;
and starting a daemon program of the target operating system.
Further, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the determining module determines a first boot profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
determining the first start-up configuration file according to the second virtual machine configuration information, wherein the second virtual machine configuration information is matched with the first virtual machine configuration information.
Further, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the determining module determines a first boot profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining the first starting configuration file according to the second virtual machine configuration information, wherein the virtual mainboard configuration parameters stored in the first virtual machine configuration information are matched with the virtual mainboard configuration parameters in the second virtual machine configuration information.
Further, the executing module completes the starting of the virtual machine based on the first starting configuration file and the boot process, including:
acquiring an execution result required by the virtual machine in the starting process from the first starting configuration file, wherein the required execution result is either all execution results stored in the first starting configuration file or execution results corresponding to the processing process of the virtual mainboard and stored in the first starting configuration file;
performing data calling on the required execution result, and determining a step corresponding to the guide flow based on the called execution result;
and skipping the corresponding steps in sequence based on the required execution result, and continuing to execute other steps in the boot flow until the virtual machine is started.
Furthermore, the virtual machine simulation device further comprises a storage module, wherein a plurality of starting configuration files are stored in the storage module;
the determining module determines a first boot profile, comprising:
responding to a virtual machine creating instruction input by a user;
determining that the second virtual machine configuration information input by the user is not received;
respectively determining the starting duration of the virtual machine corresponding to each starting configuration file;
determining the first boot profile from the plurality of boot profiles based on the boot-up duration.
Further, the determining module determines a first boot profile, including:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
further, when the determining module determines that no boot configuration file is stored, or determines that the plurality of execution results are not included in the stored boot configuration file at least based on the file content, the executing module directs the virtual machine to complete booting based on the boot flow.
Further, the executing module guides the virtual machine to complete creation and starting based on the boot flow, including:
guiding the first virtual machine to finish starting based on the boot flow, and simultaneously recording execution results corresponding to each step in the boot flow;
after the virtual machine is guided to finish the starting based on the guiding process, the method further comprises the following steps:
establishing the first starting configuration file in a storage module;
and storing the execution result into the first starting configuration file.
As shown in fig. 10, another embodiment of the present invention further provides an electronic device, including:
one or more processors;
a computer readable medium configured to store one or more programs;
the one or more programs are for execution by the first one or more processors to cause the one or more processors to implement the methods as described above.
Specifically, the one or more programs may be virtual machine emulation programs, the method comprising:
the one or more processors determine a first starting configuration file and complete the creation and starting of the virtual machine based on the first starting configuration file and the boot process; the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are sequentially executed by the processor to complete the creation of the virtual machine and the corresponding generation in the starting process.
For example, the one or more programs are corresponding programs of open source analog processor/open source analog processing software, such as Qemu, Quick EMUlator, which can be loaded in the processor. After the user starts the one or more programs through the processor and inputs a virtual machine creation instruction to the processor, the processor determines whether the electronic device stores a first start configuration file, wherein a plurality of execution results are stored in the first start configuration file, and the execution results are generated by the processor in order to execute a boot flow to complete the creation and start processes of the historical virtual machine. That is, the boot flow includes a plurality of boot steps, and when the processor executes the plurality of boot steps in sequence, an execution result is generated based on each boot step, and a next boot step needs to be executed after a previous boot step is completed and a corresponding execution result is generated. That is, the execution result of the previous boot step is a trigger condition for executing the next boot step. When the processor determines that the electronic equipment stores the first starting configuration file, the processor completes the starting of the virtual machine together based on the first starting configuration file and the boot process. Because the first start configuration file stores part or all of the execution results required in the process of starting the virtual machine, when the processor starts the virtual machine based on the boot process, the execution results in the first start configuration file can be directly used, so that the processing results of at least part of the boot steps of the virtual machine are not required to be obtained by derivation again in the starting process, the starting time of the virtual machine is saved, the actual boot process is simplified, a large amount of intermediate redundant data generated when each processing result is obtained by derivation is avoided, the data processing load is reduced for the electronic equipment, and the response speed of the electronic equipment to a user is accelerated.
Therefore, based on the disclosure of the above embodiment, it can be seen that the embodiment of the present application has the beneficial effects that the execution result correspondingly generated in the process of creating and starting the virtual machine by using the stored history is used to assist the processor to create and start the virtual machine again based on the boot flow, so that in the process of starting the virtual machine this time, the execution result of at least part of the boot steps does not need to be processed and derived again, but can be directly called for the stored execution result, so that the processing and deriving processes of at least part of the execution result can be reduced, the processing and deriving time is saved, the processing load of the device is reduced, the starting time of the virtual machine is shortened, and the virtual machine is quickly started.
Further, the boot flow includes the steps of:
creating the virtual main board and the virtual memory according to the obtained first virtual machine configuration information;
initializing the virtual mainboard;
establishing a storage space mapping relation between virtual hardware in the virtual main board and a virtual memory;
determining a target operating system according to the configuration information of the first virtual machine, and guiding the target operating system;
controlling the target virtual main board to load the kernel of the target operating system;
and starting a daemon program of the target operating system.
Further, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the processor determining a first boot profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
determining the first start-up configuration file according to the second virtual machine configuration information, wherein the second virtual machine configuration information is matched with the first virtual machine configuration information.
Further, the first startup configuration file further includes first virtual machine configuration information input by a user, and the first virtual machine configuration information includes virtual hardware configuration parameters of the first virtual machine;
the processor determining a first boot profile, comprising:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining the first starting configuration file according to the second virtual machine configuration information, wherein the virtual mainboard configuration parameters stored in the first virtual machine configuration information are matched with the virtual mainboard configuration parameters in the second virtual machine configuration information.
Further, the executing module completes the starting of the virtual machine based on the first starting configuration file and the boot process, including:
acquiring an execution result required by the virtual machine in the starting process from the first starting configuration file, wherein the required execution result is either all execution results stored in the first starting configuration file or execution results corresponding to the processing process of the virtual mainboard and stored in the first starting configuration file;
performing data calling on the required execution result, and determining a step corresponding to the guide flow based on the called execution result;
and skipping the corresponding steps in sequence based on the required execution result, and continuing to execute other steps in the boot flow until the virtual machine is started.
Furthermore, the electronic device further comprises a storage module, wherein a plurality of starting configuration files are stored in the storage module;
the processor determining a first boot profile, comprising:
responding to a virtual machine creating instruction input by a user;
determining that the second virtual machine configuration information input by the user is not received;
respectively determining the starting duration of the virtual machine corresponding to each starting configuration file;
determining the first boot profile from the plurality of boot profiles based on the boot-up duration.
Further, the processor determines a first boot profile, comprising:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
further, when the processor determines that no boot configuration file is stored, or determines that the plurality of execution results are not contained in the stored boot configuration file at least based on the file content, the execution module directs the virtual machine to complete booting based on the boot flow.
Further, the executing module guides the virtual machine to complete creation and starting based on the boot flow, including:
guiding the first virtual machine to finish starting based on the boot flow, and simultaneously recording execution results corresponding to each step in the boot flow;
after the virtual machine is guided to finish the starting based on the guiding process, the method further comprises the following steps:
establishing the first starting configuration file in a storage module;
and storing the execution result into the first starting configuration file.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.

Claims (10)

1. A virtual machine starting method comprises the following steps:
determining a first starting configuration file, wherein the first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated in the process of finishing the starting of the virtual machine based on the boot process;
and finishing the starting of the virtual machine based on the first starting configuration file and the boot process.
2. The method of claim 1, wherein the boot flow comprises the steps of:
creating the virtual main board and the virtual memory according to the obtained first virtual machine configuration information;
initializing the virtual mainboard;
establishing a storage space mapping relation between virtual hardware in the virtual main board and a virtual memory;
determining a target operating system according to the configuration information of the first virtual machine, and guiding the target operating system;
controlling the target virtual main board to load the kernel of the target operating system;
and starting a daemon program of the target operating system.
3. The method of claim 1, wherein the first boot-up profile further comprises user-entered first virtual machine configuration information, the first virtual machine configuration information comprising virtual hardware configuration parameters of the first virtual machine;
the determining a first boot profile includes:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
determining the first start-up configuration file according to the second virtual machine configuration information, wherein the second virtual machine configuration information is matched with the first virtual machine configuration information.
4. The method of claim 1, wherein the first boot-up profile further comprises user-entered first virtual machine configuration information, the first virtual machine configuration information comprising virtual hardware configuration parameters of the first virtual machine;
the determining a first boot profile includes:
responding to a virtual machine creating instruction, and receiving second virtual machine configuration information input by a user, wherein the second virtual machine configuration information comprises virtual hardware configuration parameters of a second virtual machine;
and determining the first starting configuration file according to the second virtual machine configuration information, wherein the virtual mainboard configuration parameters stored in the first virtual machine configuration information are matched with the virtual mainboard configuration parameters in the second virtual machine configuration information.
5. The method of claim 1, wherein said completing the boot of the virtual machine based on the first boot profile and the boot flow comprises:
acquiring an execution result required by the virtual machine in the starting process from the first starting configuration file, wherein the required execution result is either all execution results stored in the first starting configuration file or execution results corresponding to the processing process of the virtual mainboard and stored in the first starting configuration file;
performing data calling on the required execution result, and determining a step corresponding to the guide flow based on the called execution result;
and skipping the corresponding steps in sequence based on the required execution result, and continuing to execute other steps in the boot flow until the virtual machine is started.
6. The method of claim 1, wherein a plurality of boot configuration files are stored in the virtual machine emulator;
the determining a first boot profile includes:
responding to a virtual machine creating instruction input by a user;
determining that the second virtual machine configuration information input by the user is not received;
respectively determining the starting duration of the virtual machine corresponding to each starting configuration file;
determining the first boot profile from the plurality of boot profiles based on the boot-up duration.
7. The method of claim 1, wherein the determining that a first boot profile is stored comprises:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
the method further comprises the following steps:
determining that no startup configuration file is stored or determining that the plurality of execution results are not contained in the stored startup configuration file based at least on the file content;
and guiding the virtual machine to finish starting based on the guide flow.
8. The method of claim 7, wherein the virtual machine emulator booting the virtual machine to complete the boot based on the boot flow comprises:
guiding the first virtual machine to finish starting based on the boot flow, and simultaneously recording execution results corresponding to each step in the boot flow;
after the virtual machine is guided to finish the starting based on the guiding process, the method further comprises the following steps:
establishing the first starting configuration file;
and storing the execution result into the first starting configuration file.
9. A virtual simulation apparatus, comprising:
a determining module for determining a first start-up profile;
an execution module that completes the start of the virtual machine based on the first start-up configuration file and the boot flow
The first starting configuration file is a pre-stored file, the first starting configuration file comprises a plurality of execution results, and the execution results are correspondingly generated by the execution module in the process of executing the boot process to complete the starting of the virtual machine.
10. The virtual simulation apparatus of claim 9, the determination module further to:
determining that a starting configuration file is stored;
determining the file content of the starting configuration file;
determining a first startup configuration file containing the plurality of execution results from the startup configuration file based on the file content;
when the determining module determines that no startup configuration file is stored or determines that the plurality of execution results are not included in the stored startup configuration file based at least on the file content, the executing module is further configured to:
and guiding the virtual machine to finish starting based on the guide flow.
CN202010618472.9A 2020-06-30 2020-06-30 Virtual machine starting method and device Pending CN111782342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010618472.9A CN111782342A (en) 2020-06-30 2020-06-30 Virtual machine starting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010618472.9A CN111782342A (en) 2020-06-30 2020-06-30 Virtual machine starting method and device

Publications (1)

Publication Number Publication Date
CN111782342A true CN111782342A (en) 2020-10-16

Family

ID=72761508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010618472.9A Pending CN111782342A (en) 2020-06-30 2020-06-30 Virtual machine starting method and device

Country Status (1)

Country Link
CN (1) CN111782342A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306581A (en) * 2020-11-13 2021-02-02 苏州浪潮智能科技有限公司 Method and medium for managing Basic Input Output System (BIOS) configuration by baseboard management controller
CN114640555A (en) * 2022-02-24 2022-06-17 联想(北京)有限公司 Information processing method, virtual machine cluster and system
WO2023087622A1 (en) * 2021-11-16 2023-05-25 苏州浪潮智能科技有限公司 Virtual machine boot configuration method and apparatus, computer device, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235831A1 (en) * 2009-03-12 2010-09-16 Arend Erich Dittmer Method for dynamic configuration of virtual machine
US20130191643A1 (en) * 2012-01-25 2013-07-25 Fujitsu Limited Establishing a chain of trust within a virtual machine
CN104503788A (en) * 2014-12-16 2015-04-08 电子科技大学 Setting method capable of shortening starting time of Android operating system
CN108874459A (en) * 2017-05-10 2018-11-23 华为机器有限公司 Quick start method and device based on virtualization technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235831A1 (en) * 2009-03-12 2010-09-16 Arend Erich Dittmer Method for dynamic configuration of virtual machine
US20130191643A1 (en) * 2012-01-25 2013-07-25 Fujitsu Limited Establishing a chain of trust within a virtual machine
CN104503788A (en) * 2014-12-16 2015-04-08 电子科技大学 Setting method capable of shortening starting time of Android operating system
CN108874459A (en) * 2017-05-10 2018-11-23 华为机器有限公司 Quick start method and device based on virtualization technology

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306581A (en) * 2020-11-13 2021-02-02 苏州浪潮智能科技有限公司 Method and medium for managing Basic Input Output System (BIOS) configuration by baseboard management controller
CN112306581B (en) * 2020-11-13 2023-01-06 苏州浪潮智能科技有限公司 Method and medium for managing Basic Input Output System (BIOS) configuration by baseboard management controller
WO2023087622A1 (en) * 2021-11-16 2023-05-25 苏州浪潮智能科技有限公司 Virtual machine boot configuration method and apparatus, computer device, and storage medium
CN114640555A (en) * 2022-02-24 2022-06-17 联想(北京)有限公司 Information processing method, virtual machine cluster and system

Similar Documents

Publication Publication Date Title
CN111782342A (en) Virtual machine starting method and device
US8291209B2 (en) Integration model for instant-on environment
EP0100140B1 (en) Data processing system and method of starting up system
US5978913A (en) Computer with periodic full power-on self test
JP5048526B2 (en) Computer system and legacy boot method for the computer system
US20110179260A1 (en) Method for integrating operating system into bios chip and method for booting operating system from server
CN108776595B (en) Method, device, equipment and medium for identifying display card of GPU (graphics processing Unit) server
CN108829449B (en) Method, device, equipment and medium for starting operating system by BIOS (basic input output System)
CN111782335A (en) Extended application mechanism through in-process operating system
CN114003421B (en) Virtual machine timeout mechanism testing method, system, terminal and storage medium
US7890742B2 (en) Automatically selecting firmware instructions for an operating system
CN116775202A (en) Fuzzy test method, device, medium, electronic equipment and computer program product
CN113094111A (en) Device and method for starting device
US20070234029A1 (en) Methods and apparatus for context sensitive component dispatch management
CN110716753A (en) Cloud host initialization method and device, storage medium and electronic equipment
CN116383091B (en) Starting method and starting device of eMMC verification platform and storage medium
CN111158863B (en) Interrupt controller processing method and device and electronic equipment
US11392390B2 (en) Method and system for automatically booting a computer to run from a removable device
CN113064749B (en) Method for controlling debugging information output at runtime stage through BIOS
US11163591B2 (en) Power management method and device, electronic apparatus, and computer program product
CN115328560A (en) Chip starting method and system, computer equipment, storage medium and chip
US10956175B2 (en) Boot process modification
CN113568670A (en) Computer starting process stage display method and device and storage medium
JPH06230843A (en) Hardwre raising system
CN114385255A (en) POS machine control method, system, device and computer readable 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