CN111930467B - Virtual machine starting method, device, equipment and computer readable storage medium - Google Patents

Virtual machine starting method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111930467B
CN111930467B CN202010633688.2A CN202010633688A CN111930467B CN 111930467 B CN111930467 B CN 111930467B CN 202010633688 A CN202010633688 A CN 202010633688A CN 111930467 B CN111930467 B CN 111930467B
Authority
CN
China
Prior art keywords
module
virtual machine
starting
virtual
functions
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.)
Active
Application number
CN202010633688.2A
Other languages
Chinese (zh)
Other versions
CN111930467A (en
Inventor
李蕾
郭双拴
杨杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202010633688.2A priority Critical patent/CN111930467B/en
Publication of CN111930467A publication Critical patent/CN111930467A/en
Application granted granted Critical
Publication of CN111930467B publication Critical patent/CN111930467B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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 embodiment of the application provides a virtual machine starting method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: splitting a virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function; dynamically loading each module in the module set to deploy the module set in the same module service; when a request message for carrying out virtual machine instantiation sent by a client is obtained, obtaining configuration information of a virtual main board according to the request message, wherein the configuration information of the virtual main board at least comprises a target module identifier; starting the target module corresponding to the target module identifier to acquire corresponding virtualization capability; and starting the virtual machine instance based on the obtained virtualization capability. According to the virtual machine instantiation request of the user, the virtual machine instance corresponding to the request is started, and different Hypervisor versions do not need to be developed and maintained, so that customization is realized.

Description

Virtual machine starting method, device, equipment and computer readable storage medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, but not limited to, a method, an apparatus, a device, and a computer readable storage medium for starting a virtual machine.
Background
Conventional virtual machine monitors (VMM, virtual Machine Monitor) are data center oriented, which may also be referred to as hypervisors, and have no resource overhead concerns, so all functional modules of the hypervisors are linked into one system and then compiled to run. In the edge computing and internet of things (IOT, internet Of Things), physical resources such as a central processing unit (CPU, central Processing Unit), memory, and Input/Output (I/O) are limited, and some lightweight schemes are required. At present, the Hypervisor is simply cut, and suitable versions are cut according to different use scenes, but the method is basically not different from the traditional Hypervisor, all functions of the Hypervisor are loaded into a memory when a virtual machine is started each time, system resources are wasted, and development, testing and maintenance are also challenged by cutting different versions.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, apparatus, device, and computer-readable storage medium for starting a virtual machine.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a virtual machine starting method, which comprises the following steps:
splitting a virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function;
dynamically loading each module in the module set to deploy the module set in the same module service;
when a request message for carrying out virtual machine instantiation sent by a client is obtained, obtaining configuration information of a virtual main board according to the request message, wherein the configuration information of the virtual main board at least comprises a target module identifier;
starting the target module corresponding to the target module identifier to acquire corresponding virtualization capability;
and starting the virtual machine instance based on the obtained virtualization capability.
The embodiment of the application provides a virtual machine starting device, which comprises:
the splitting module is used for splitting the virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function;
the loading module is used for dynamically loading each module in the module set so as to deploy the module set in the same module service;
The virtual machine comprises a first acquisition module, a second acquisition module and a virtual machine processing module, wherein the first acquisition module is used for acquiring configuration information of a virtual main board according to a request message sent by a client for carrying out virtual machine instantiation when acquiring the request message, and the configuration information of the virtual main board at least comprises a target module identifier;
the first starting module is used for starting the target module corresponding to the target module identifier so as to acquire the corresponding virtualization capability;
and the second starting module is used for starting the virtual machine instance based on the obtained virtualization capability.
The embodiment of the application provides virtual machine starting equipment, which at least comprises the following components:
a processor; and
a memory for storing a computer program executable on the processor;
wherein the computer program when executed by the processor implements the steps of the virtual machine starting method.
Embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions configured to perform the steps of the virtual machine starting method.
According to the virtual machine starting method, device and equipment and the computer readable storage medium, a traditional virtual machine system is split into a plurality of independent modules, each module is dynamically loaded and deployed in the same module service, when a virtual machine instantiation request is received, a corresponding target module is started according to configuration information of a virtual machine mainboard, and then a virtual machine instance is started, so that the virtual machine instance corresponding to the request can be started according to the virtual machine instantiation request of a user, different hypervisors are not required to be developed and maintained, and customization is achieved.
Drawings
In the drawings (which are not necessarily drawn to scale), like numerals may describe similar components in different views. The drawings illustrate generally, by way of example and not by way of limitation, various embodiments discussed herein.
Fig. 1 is a schematic flow chart of an implementation of a virtual machine starting method according to an embodiment of the present application;
FIG. 2 is a system symbology diagram provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of dynamic loading according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an ELF file according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another ELF file according to an embodiment of the present disclosure;
fig. 6 is a schematic implementation flow chart of another virtual machine starting method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a virtual machine starting system according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a virtual machine starting device according to an embodiment of the present application;
fig. 9 is a schematic diagram of a composition structure of a virtual machine starting device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
If a similar description of "first\second\third" appears in the application document, the following description is added, in which the terms "first\second\third" are merely distinguishing between similar objects and do not represent a particular ordering of the objects, it being understood that the "first\second\third" may be interchanged in a particular order or precedence, where allowed, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
The embodiment of the application provides a virtual machine starting method, which is applied to virtual machine starting equipment, wherein the virtual machine starting equipment can be integrated on a server, and the method provided by the embodiment of the application can be realized by a computer program, and when the computer program is executed, all steps in the method provided by the embodiment of the application are completed. In some embodiments, the computer program may be executed by a processor in the virtual machine starting device. Fig. 1 is a schematic flow chart of an implementation of a virtual machine starting method according to an embodiment of the present application, as shown in fig. 1, where the method includes:
Step S101, splitting the virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function.
In this embodiment of the present application, the virtual machine system may be any one of existing virtual machine systems, and in this embodiment of the present application, each module in the virtual machine system may be split into a plurality of modules by a decoupling manner, each split module has an independent function, and running any one of the modules may not affect running or editing of other modules. Illustratively, virtual machine systems are functionally split into keyboard, video and mouse (KVM, keyboard Video Mouse) modules, advanced configuration and power management interface (ACPI, advanced Configuration and Power Management Interface) modules, trusted computing group (TCG, trusted Computing Group) modules, I/O paravirtualization (virtio) modules, and the like. In the embodiment of the application, the format of each module file adopts an executable and linkable (ELT, executable and Linkable Format) file format. In this embodiment of the present application, the module set includes an operating system module set and a function module set, where the function module set is a set of modules other than the operating system module set. In this embodiment of the present application, an identifier may be added to each module, where the identifier may be a serial number or a name. Illustratively, each module is incremented by a sequence number, e.g., module 1 through module N, where N is an integer greater than 1.
Step S102, each module in the module set is dynamically loaded to deploy the module set in the same module service.
In the embodiment of the application, firstly, an operating system module set is loaded into a module server of the operating system module set, the operating system of the virtual machine is created by executing the operating system module set, the operating system of the virtual machine generates a system symbol table, and after the system symbol table is generated, functions and identifiers corresponding to global variables included by each functional module in the functional module set are added into the system symbol table when the functional module set is loaded. Each module may include one or more functions, and fig. 2 is a schematic diagram of a system symbol provided in an embodiment of the present application, where, as shown in fig. 2, the system symbol table includes a module 1 to a module N, and each module includes at least one function, for example: module a includes a function a_symbol1 201 and a module a_symbol2 202, each module corresponding to a virtual address. For example: the module A corresponds to a Virtual Address A, the module B corresponds to Virtual Address B and the like, and when all the modules are added into the system symbol table, the dynamic loading of each module in the module set into one module service is realized. In the embodiment of the application, the module service provides the virtualization capability of each module in a mode of providing service to the outside.
Step S103, when a request message for virtual machine instantiation sent by a client is obtained, configuration information of a virtual main board is obtained according to the request message, wherein the configuration information of the virtual main board at least comprises a target module identifier.
In this embodiment of the present application, the obtaining the request message for virtual machine instantiation sent by the client may obtain the request message for virtual machine instantiation through a shared memory communication manner established between the client and the client. When the virtual machine starting device obtains the virtual machine instantiation request message sent by the client, the message can be parsed to obtain the configuration information of the virtual main board carried in the message request. In this embodiment of the present application, the configuration information of the virtual motherboard includes at least a target module identifier. Table 1 is a schematic table of configuration information of a virtual motherboard provided in the embodiment of the present application, please refer to table 1,
TABLE 1 schematic form of configuration information of virtual motherboard
The configuration information of the virtual main board comprises the following steps: attribute name (Attribute name), data type (Data type), sequence (cartialty), description information (Description). In this embodiment of the present application, the target module identifier is a module that needs to be loaded by a Hypervisor in configuration information of a virtual motherboard, and illustratively, the Description information (Description) includes the target module identifier (i.e., a module that needs to be loaded by a Hypervisor in the drawing). In some embodiments, the description information may further include: memory size, number of vcpus, architecture type of virtual machine, identity of virtual machine, type of Hypervisor, description of structure of virtual device, etc.
Step S104, starting the target module corresponding to the target module identifier to acquire the corresponding virtualization capability.
In this embodiment of the present application, after receiving the target module identifier, the corresponding target module identifier may be searched for from the system symbol table according to the target module identifier, and then a module corresponding to the target module identifier is started. With the above example, the modules corresponding to the modules 1 to N are started, and thus the virtualization capabilities corresponding to the modules 1 to N are obtained.
Step S105, starting a virtual machine instance based on the obtained virtualization capability.
In this embodiment of the present application, after the module corresponding to the target module identifier is started, the virtual machine instance may be started.
According to the virtual machine starting method, the traditional virtual machine system is split into the independent modules, each module is dynamically loaded and deployed in the same module service, when a virtual machine instantiation request is received, the corresponding target module is started according to configuration information of a virtual machine main board, and then the virtual machine instance is started, so that the virtual machine instance corresponding to the virtual machine instance can be started and requested according to the virtual machine instantiation request of a user, different hypervisors do not need to be developed and maintained, customization of the virtual machine is achieved, and meanwhile resource expenditure is saved.
In some embodiments, the module set includes an operating system module set and a function module set, and the step S102 "dynamically loading each module in the module set" may be implemented through steps S1021 to S1024 in fig. 3:
step S1021, loading and executing the operating system module set to create an operating system of the virtual machine.
In the embodiment of the application, when the virtual machine starting device acquires the module set, the module set of the operating system is loaded first, and after loading is completed, the operating system of the virtual machine is created.
Step S1022, generating a system symbol table corresponding to the operating system.
In this embodiment, after an operating system of a virtual machine is created, a virtual machine starting device generates a corresponding system symbol table through the operating system, where the system symbol table is used to record a loaded module, and includes: to save functions and global variables of the target module. In this embodiment, after the system symbol table is generated, the system symbol table records the functions and global variables included in the module as long as the module is added in the operating system. The virtual address corresponding to each function or global variable is recorded in the system symbol table. The system symbol table contains information used to locate, relocate symbol definitions and references in the program.
Step S1023, loading the function module set, and obtaining functions and global variables included in each function module in the function module set.
In this embodiment of the present application, after the operating system module is loaded, each functional module in the functional module set is loaded. In this embodiment of the present application, each functional module includes: at least one function, at this time, the functions and global variables included in each function module in the function set module are obtained.
Step S1024, adding the functions and global variables included in the respective functional modules to the system symbol table.
In this embodiment of the present application, when each functional module is loaded, the system symbol table records the functions and global variables included in each functional module, and accepts the above examples, and adds the functions and global variables included in the modules 1 to N into the system symbol table.
According to the virtual machine starting method, firstly, the system symbol table is generated by loading the system module set, and when the function module set is loaded, functions and global variables of the function module set are added into the system symbol table, so that when a request message for virtual machine instantiation sent by a client is received, a corresponding target module is inquired from the system symbol table according to the message request, the corresponding virtualization capability is obtained by executing the target module, and further, a virtual machine instance is started, and different Hypervisor versions do not need to be developed and maintained, and customization of the virtual machine instance is achieved.
In some embodiments, the step S104 "the starting the target module identifier corresponds to the target module" may be implemented by the following steps:
step S1041, searching the target module in the system symbol table according to the target module identification.
In the embodiment of the application, all the module identifiers are recorded in the system symbol table, so that after the target module identifier is determined, the target module can be searched from the system symbol table by taking the target module identifier as a search condition. Following the above example, the target module identification includes: module 1 to module N. And searching a corresponding target module in the system symbol table through the modules 1 to N.
In step S1042, the memory address of the target module is determined.
In this embodiment of the present application, in this embodiment, address relocation may be performed on virtual addresses of each function and global variable in the system symbol table, and the virtual addresses of each function and global variable may be corrected to corresponding memory addresses. Because the target module is found, the memory address corresponding to the target module can be determined.
Step S1043, starting the target module based on the memory address.
In the embodiment of the application, the target modules are started based on the memory addresses, so that the virtualization capacity corresponding to each target module is obtained.
According to the method provided by the embodiment of the application, the target module is searched through the system symbol, and after the target module is searched, the target module is started based on the memory address corresponding to the target module, so that the virtual machine instance is started.
In some embodiments, after "add functions and global variables included in the respective functional modules to the system symbol table" in step S1024, the method further includes:
step S1025, obtaining the memory addresses of the functions and the global variables included in the functional modules, and obtaining the virtual addresses of the functions and the global variables included in the functional modules in the system symbol table.
In the embodiment of the application, each functional module can be analyzed to obtain the header file information of each functional module, the starting address of each functional module is determined according to the header file information, and then the memory addresses of the functions and the global variables included in each functional module are determined based on the offset addresses of the functions and the global variables included in each functional module.
In the embodiment of the application, virtual addresses of functions and global variables included in each functional module are determined from a system symbol table.
Step S1026, establishing a mapping relationship between the memory addresses of the functions and global variables included in the functional modules and the corresponding virtual addresses.
In this embodiment of the present application, after the memory addresses of the functions and the global variables included in each functional module and the corresponding virtual addresses are obtained, the mapping relationship between the memory addresses of the functions and the global variables included in each functional module and the corresponding virtual addresses may be established. In the embodiment of the application, a link table can be established according to the mapping relation. The mapping relation between the memory addresses of the functions and the global variables included in each functional module and the corresponding virtual addresses is established by linking the memory addresses of the functions and the global variables included in each functional module with the corresponding virtual addresses.
In the embodiment of the application, the problem of error operation of functions and global variables caused by changing virtual addresses is avoided by establishing the mapping relation between the memory addresses of the functions and the global variables included in each functional module and the corresponding virtual addresses.
In some embodiments, the step S1025 of "obtaining the memory addresses of the functions and the global variables included in the respective functional modules" may be implemented by:
and S1, analyzing each functional module to obtain header file information of each functional module.
In this embodiment of the present application, each functional module is an ELT file, fig. 4 is a schematic structural diagram of an ELT file provided in the embodiment of the present application, and fig. 5 is a schematic structural diagram of another ELF file provided in the embodiment of the present application, as shown in fig. 4 and 5, the ELF file includes: the ELF file includes a plurality of parts such as a header file 501 (ELF header), a program header table 502 (Program Header Table), a section header table 503 (Section Header Table), sections 504, or segments 504. The organization of the entire ELF file, such as the entry address, offset address, size, structure, section, etc., of the program header is described in the header file. The program header table indicates how to create a process image, and the section header table contains information of an entry, a name, a size, and the like of each section. Various items of information of the target file, such as instructions, data, symbol tables, repositioning information and the like, are provided in the section. In the embodiment of the application, each functional module can be analyzed, so that the header file information of each functional module is obtained, and then the starting address and the offset address are obtained according to the header file information of each functional module obtained after analysis.
And S2, acquiring the starting address of each functional module according to the header file information of each functional module.
In this embodiment of the present application, since the header file information includes the start address of the functional module, the start address of each functional module may be obtained. The starting address of the functional module 1 is, for example, 10.
And S3, obtaining offset addresses of functions and global variables included in each functional module.
In this embodiment of the present application, the offset address of the function included in each functional module may be determined through the header file information, and the offset address of a certain function a in the functional module 1 is 200 in adapting to the above example.
And S4, determining the memory addresses of the functions and the global variables included in each functional module based on the initial address and the offset addresses of the functions and the global variables included in each functional module.
In this embodiment of the present application, after determining the starting address and the offset address of the function and the global variable included in each functional module, the memory address of the function and the global variable included in each functional module may be determined. With the above example in mind, the memory address of function a in function 1 is 210.
In this embodiment of the present application, each module in the corresponding system module set may also acquire the memory addresses in the function and the global variable in each module in the same manner. In this embodiment of the present application, the memory address is an actual address stored in the service module.
In the embodiment of the application, header file information of each functional module is obtained by analyzing each functional module, and then memory addresses of each function and global variable are determined according to the header file information. Therefore, after the mapping relation between the memory addresses of the functions and the global variables included in each functional module and the corresponding virtual addresses is established, each memory address included in the module can be directly used when the target module is started, and therefore errors in the operation of the functions and the global variables are avoided.
In some embodiments, the step S1025 of "obtaining the virtual addresses of the functions and the global variables included in the respective functional modules in the system symbol table" may be implemented by:
step S11, the system symbol table is obtained.
And step S12, determining virtual addresses corresponding to functions and global variables included by the functional modules from the system symbol table.
In the case that the function module includes a function, the virtual address of the function module may be determined as the virtual address of the function, and the virtual address of the function module may be determined directly from the system symbol table, so as to determine the virtual address corresponding to the function and the global variable included in the function module. In some embodiments, the virtual starting address of each functional module may be determined according to a system symbol table, and the offset addresses of the functions and the global variables may be determined at the same time, so as to determine the virtual addresses corresponding to the functions and the global variables included in each functional module.
In some embodiments, in step S103", when a request message sent by a client for instantiating a virtual machine is obtained, configuration information of a virtual motherboard is obtained according to the request message, where the configuration information of the virtual motherboard includes at least a target module identifier" further includes:
step S103A, establishing a communication link between itself and the client.
In this embodiment of the present application, the communication link is implemented by using a shared memory. In the embodiment of the application, the client and the virtual machine starting device apply for a shared memory as the data interaction buffer, the client stores data in the data interaction buffer, the virtual starting device can acquire the data stored in the data interaction buffer by the client in a polling mode, and the client can also acquire the data stored by the virtual machine starting device in the data interaction buffer, so that a communication link is established.
Step S103B, obtaining, based on the communication link, a request message for virtual machine instantiation sent by the client.
In this embodiment of the present application, when a client needs to send a request message for virtual machine instantiation, a request message corresponding to a message protocol may be generated based on a message protocol between the client and a virtual starting device, where the client sends the request message to an area of a shared memory, so that the virtual machine starting device obtains the request message for virtual machine instantiation sent by the client.
According to the method, communication between the client and the virtual machine starting equipment is achieved by establishing the communication link of the shared memory of the client and the virtual machine starting equipment, and the message request instantaneity is high through the communication link of the shared memory.
Based on the foregoing embodiments, the embodiment of the present application further provides a method for starting a virtual machine, and fig. 6 is a schematic implementation flow chart of another method for starting a virtual machine, as shown in fig. 6, where the method includes:
in step S601, all components of the Hypervisor (similar to the virtual machine system in the above embodiments) are split into independent modules.
In the embodiment of the application, the module file format adopts an ELF file format, and the ELF file type is a sharing target type. The module file content has two parallel view angles: one is the program link angle and the other is the program run angle.
Illustratively, each individual module may be kvm-links, kvm-ioctl, virtio, virtio-links, kernel-loader, etc. Each module has independent functions such as:
kvm-links module: based on the interface on the KVM where creating the VMM requires invoking KVM functionality from the module services, the KVM-bindings module represents an external functional interface in the KVM kernel that provides hardware virtualization.
kvm-ioctl module: because KVM-links interface words contain only structure and definition, KVM-ioctls (KVM-ioctls) based wrappers are also provided with which to open disks, KVM, create virtual machines, create virtual processors (vCPU), etc.
virtio device module: virtio has a set of front and rear end architecture. The front end is in the virtio-devices module and the back end is in the vhost module. Vhost supports user space drivers and kernel space drivers, but users can also plug virtio-devices into custom backend. Most IO devices such as block devices (blocks), network card devices (net), and socket communication devices (vsock) belong to the virtual device.
virtio-links module: binding of Virtio devices generated using Virtio Linux header. All devices in the virtio-devices use conditional compilation to be exported independently as modules.
A kernel-loader module: is responsible for loading the contents of the ELF kernel image into the guest memory.
In step S602, the module is dynamically loaded.
In this embodiment, the system core component (like the set of operating system modules in the above embodiments) first starts to generate a dynamic symbol table of the Hypervisor system (like the system symbol table in the above embodiments) for storing the symbols of the target modules (like the functions in the above embodiments) and global variables. When the target module (like the functional module in the above embodiments) is loaded, the system acquires all the functions and global variables contained in the target module, adds the functions and global variables to the system symbol table of the Hypervisor system, and then performs address relocation on all the functions and global variables in the target module.
The dynamic module loading mode is adopted, so that parallel development and debugging of a plurality of modules under a Hypervisor system can be supported. Meanwhile, a certain module is independently upgraded, and the operation of the whole system is not influenced.
In step S603, the module is deployed in its entirety in one module service.
In the embodiment of the present application, the module service may be a module server.
Fig. 7 is a schematic structural diagram of a virtual machine starting system provided in an embodiment of the present application, as shown in fig. 7, where the virtual starting system includes: VMM client (clients) 701, interaction channels (virtual ues) 702, virtual machine launch device, which may be a Hypervisor server 703. The Hypervisor server may include a virtual machine creation initiation Module (Virtual Machine Class Initiator) 7031, a Module handler (Module handler) 7032. Wherein,
VMM client (client) 701: the method is used for establishing connection with the Hypervisor server 703, sending a request of a user and returning a Hypervisor execution result.
Interaction channels (virtual ues) 702: the method is a channel for interaction between the VMM client process and the Hypervisor service process, and is realized by using a mode of sharing memory among processes, so that messages can be exchanged between the VMM client 701 and the Hypervisor server 703 in a mode of operating the memory. The VMM client 701 sends a virtual motherboard specification (VM spec) message to the virtual queues 702, and the module processor (module handler) 7031 of the hypervisor server 703 reads the messages of the virtual queues 702 in a polling manner.
Virtual Machine Class Initiator 7031: after the VM specification request message is read from the virtual queues 702, the request is split into different components according to the definition of the virtual machine specification, and different modules are gradually called and executed.
Module handler 7032: the call request is obtained from Virtual Machine class initiator 7031 and then the module symbol table is queried to execute the corresponding module.
In step S604, the user defines a specification of a virtual motherboard according to actual requirements of different scenes.
The user defines a Specification (SPEC) of a virtual motherboard according to the actual requirement (the configuration information of the virtual motherboard in the above embodiments is the same), and then obtains the running instance of the virtual motherboard from the module service by means of service call.
The traditional virtual machine configuration file is only defined for the virtual machine, and the background directly starts the unique Hypervisor system in the system according to the configuration file. However, in the modularized Hypervisor system, the SPEC of the virtual motherboard defined by the user needs not only configuration of the virtual machine, but also definition related to the Hypervisor module combination, because the background needs to combine corresponding Hypervisor modules to start different Hypervisor systems based on different virtual machine instantiation requests of the user.
The VMM client sends a VM Specification (SPEC) message into the virtqueue, the message protocol definition joining table 2:
table 2, message protocol definition table provided in embodiments of the present application
Step S605, starting the program, and obtaining the virtualization capability by means of service call.
The user starting process sends a VM spec message to the module service through a component virtqueue, hypervisord acquires the VM spec message in a polling mode, and then the virtual machine instantiation device calls the module manager to acquire the virtualization capability. The module server locates the memory virtual address of the corresponding module symbol through the symbol lookup table of the system.
Step S606, starting a virtual machine instance.
According to the method provided by the embodiment of the application, the traditional Hypervisor is split into different components such as kvm, ACPI, tcg, virtio according to functions, and then the components are compiled into different modules to be deployed in one module service, so that the virtualization capability is provided for the outside in the form of service. When a user needs to create a virtual machine, unlike the traditional virtual machine configuration file, only defines a virtual machine (namely, the background directly starts a unique Hypervisor system in the system according to the configuration file, in the modularized Hypervisor system, the SPEC of the virtual main board defined by the user not only needs to have the configuration of the virtual machine, but also needs to have the definition related to the Hypervisor module combination, because based on different virtual machine instantiation requests of the user, the background can combine corresponding Hypervisor modules to start different Hypervisor systems according to the need, then the process started by the user obtains the virtualization capability through a service calling mode, and the module service receives the calling request to execute the corresponding functional module according to the calling parameter and returns the virtual main board device instance.
According to the method provided by the embodiment of the application, firstly, the Hypervisor has only one memory overhead, and secondly, different Hypervisor versions do not need to be developed and maintained. The user sends different service call requests aiming at different scenes, so that the dynamic customization of the Hypervisor is realized by a novel loading mode, and meanwhile, the resource expense is saved.
Based on the foregoing embodiments, the embodiments of the present application provide a virtual machine starting apparatus, where each module included in the apparatus and each unit included in each module may be implemented by a processor in a computer device; of course, the method can also be realized by a specific logic circuit; in practice, the processor may be a central processing unit (CPU, central Processing Unit), a microprocessor (MPU, microprocessor Unit), a digital signal processor (DSP, digital Signal Processing), or a field programmable gate array (FPGA, field Programmable Gate Array), or the like.
Fig. 8 is a schematic structural diagram of a virtual machine starting device provided in the embodiment of the present application, as shown in fig. 8, where the virtual machine starting device 800 includes:
a splitting module 801, configured to split the virtual machine system to obtain a module set including a plurality of modules, where each module corresponds to an independent function;
A loading module 802, configured to dynamically load each module in the module set, so as to deploy the module set in the same module service;
a first obtaining module 803, configured to obtain, when a request message for virtual machine instantiation sent by a client is obtained, configuration information of a virtual motherboard according to the request message, where the configuration information of the virtual motherboard includes at least a target module identifier;
a first starting module 804, configured to start a target module corresponding to the target module identifier, so as to obtain a corresponding virtualization capability;
a second starting module 805 is configured to start a virtual machine instance based on the obtained virtualization capability.
In some embodiments, the set of modules includes a set of operating system modules and a set of functional modules, and the loading module 802 includes:
the first loading unit is used for loading and executing the operating system module set to create an operating system of the virtual machine;
the generating unit is used for generating a system symbol table corresponding to the operating system;
the second loading unit is used for loading the function module set and acquiring functions and global variables included by each function module in the function module set;
And the adding unit is used for adding the functions and the global variables included by the functional modules into the system symbol table.
In some embodiments, the first start module 804 includes:
the searching unit is used for searching the target module in the system symbol table according to the target module identifier;
the determining unit is used for determining the memory address of the target module;
and the starting unit is used for starting the target module based on the memory address.
In some embodiments, the loading module 802 further comprises:
the acquisition unit is used for acquiring the memory addresses of the functions and the global variables included in each functional module and acquiring the virtual addresses of the functions and the global variables included in each functional module in the system symbol table;
and the establishing unit is used for establishing the mapping relation between the memory addresses of the functions and the global variables included by each functional module and the corresponding virtual addresses.
In some embodiments, the acquisition unit comprises:
the analysis subunit is used for analyzing each functional module and acquiring header file information of each functional module;
the first acquisition subunit is used for acquiring the starting address of each functional module according to the header file information of each functional module;
The second acquisition subunit is used for acquiring the offset addresses of the functions and the global variables included by each functional module;
and the determining subunit is used for determining the memory addresses of the functions and the global variables included by each functional module based on the starting address and the offset addresses of the functions and the global variables included by each functional module.
In some embodiments, the acquisition unit further comprises:
a third obtaining subunit, configured to obtain the system symbol table;
and the searching subunit is used for searching the virtual addresses corresponding to the functions and the global variables included by each functional module from the system symbol table.
In some embodiments, the virtual machine starting apparatus 800 further includes:
the establishing module is used for establishing a communication link between the establishing module and the client, wherein the communication link is realized by using a shared memory;
and the second acquisition module is used for acquiring the request message for virtual machine instantiation sent by the client based on the communication link.
The description of the apparatus embodiments above is similar to that of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the above-mentioned virtual machine starting method is implemented in the form of a software functional module, and is sold or used as a separate product, the virtual machine starting method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partly contributing to the prior art, and the computer software product may be stored in a storage medium, and include several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Accordingly, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the virtual machine starting method provided in the above embodiment.
An embodiment of the present application provides a virtual machine starting device, fig. 9 is a schematic diagram of a composition structure of the virtual machine starting device provided in the embodiment of the present application, as shown in fig. 9, where the virtual machine starting device 900 includes: a processor 901, at least one communication bus 902, a user interface 903, at least one external communication interface 904, and memory 905. Wherein the communication bus 902 is configured to enable coupled communication between the components. The user interface 903 may include a display screen, and the external communication interface 904 may include a standard wired interface and a wireless interface, among others. Wherein the processor 901 is configured to execute a program of a virtual machine starting method stored in a memory, so as to implement the steps in the virtual machine starting method provided in the above embodiment
The above description of embodiments of virtual machine starting apparatus and storage medium is similar to that of the method embodiments described above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the virtual machine starting apparatus and the storage medium of the present application, please refer to the description of the method embodiments of the present application for understanding.
It should be noted here that: the description of the storage medium and apparatus embodiments above is similar to that of the method embodiments described above, with similar benefits as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus of the present application, please refer to the description of the method embodiments of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the integrated units described above may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in essence or in a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing an AC to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The foregoing is merely an embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A virtual machine starting method, comprising:
splitting a virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function, and the module set comprises an operating system module set and a function module set;
loading and executing the operating system module set to create an operating system of the virtual machine;
generating a system symbol table corresponding to the operating system;
loading the function module set, and obtaining functions and global variables included by each function module in the function module set;
adding functions and global variables included by the functional modules into the system symbol table to deploy the module set in the same module service;
when a request message for carrying out virtual machine instantiation sent by a client is obtained, obtaining configuration information of a virtual main board according to the request message, wherein the configuration information of the virtual main board at least comprises a target module identifier;
Searching a target module in the system symbol table according to the target module identifier, and starting a corresponding target module to acquire corresponding virtualization capability;
and starting the virtual machine instance based on the obtained virtualization capability.
2. The method of claim 1, the launching of the corresponding target module, comprising:
determining a memory address of the target module;
and starting the target module based on the memory address.
3. The method of claim 1, the method further comprising:
acquiring memory addresses of functions and global variables included in each functional module, and acquiring virtual addresses of the functions and the global variables included in each functional module in the system symbol table;
and establishing mapping relations between the memory addresses of the functions and the global variables included by the functional modules and the corresponding virtual addresses.
4. A method according to claim 3, wherein said obtaining the memory addresses of the functions and global variables included in the respective functional modules includes:
analyzing each functional module to obtain header file information of each functional module;
acquiring the starting address of each functional module according to the header file information of each functional module;
Obtaining offset addresses of functions and global variables included by each functional module;
and determining the memory addresses of the functions and the global variables included in each functional module based on the start address and the offset addresses of the functions and the global variables included in each functional module.
5. A method according to claim 3, said obtaining virtual addresses in the system symbol table of functions and global variables comprised by the respective functional modules, comprising:
acquiring the system symbol table;
and determining virtual addresses corresponding to functions and global variables included by the functional modules from the system symbol table.
6. The method of claim 1, the method further comprising:
establishing a communication link between the client and the client, wherein the communication link is realized by using a mode of sharing a memory;
and acquiring a request message for virtual machine instantiation sent by the client based on the communication link.
7. A virtual machine starting apparatus, the apparatus comprising:
the splitting module is used for splitting the virtual machine system to obtain a module set comprising a plurality of modules, wherein each module corresponds to an independent function, and the module set comprises an operating system module set and a function module set;
The loading module is used for loading and executing the operating system module set to create an operating system of the virtual machine, and is also used for loading the function module set to acquire functions and global variables included by each function module in the function module set;
the generating module is used for generating a system symbol table corresponding to the operating system;
an adding module, configured to add a function and a global variable included in each functional module to the system symbol table, so as to deploy the module set in the same module service;
the virtual machine comprises a first acquisition module, a second acquisition module and a virtual machine processing module, wherein the first acquisition module is used for acquiring configuration information of a virtual main board according to a request message sent by a client for carrying out virtual machine instantiation when acquiring the request message, and the configuration information of the virtual main board at least comprises a target module identifier;
the first starting module is used for searching the target module in the system symbol table according to the target module identifier, and starting the corresponding target module to acquire the corresponding virtualization capability;
and the second starting module is used for starting the virtual machine instance based on the obtained virtualization capability.
8. A virtual machine starting device, wherein the virtual machine starting device at least comprises:
A processor; and
a memory for storing a computer program executable on the processor;
wherein the computer program when executed by a processor implements the steps of the virtual machine starting method of any one of claims 1 to 6.
9. A computer storage medium having stored therein computer executable instructions configured to perform the steps of the virtual machine starting method of any of the preceding claims 1 to 6.
CN202010633688.2A 2020-07-02 2020-07-02 Virtual machine starting method, device, equipment and computer readable storage medium Active CN111930467B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010633688.2A CN111930467B (en) 2020-07-02 2020-07-02 Virtual machine starting method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010633688.2A CN111930467B (en) 2020-07-02 2020-07-02 Virtual machine starting method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111930467A CN111930467A (en) 2020-11-13
CN111930467B true CN111930467B (en) 2024-03-26

Family

ID=73317276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010633688.2A Active CN111930467B (en) 2020-07-02 2020-07-02 Virtual machine starting method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111930467B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656146A (en) * 2021-08-18 2021-11-16 爱尚游(北京)科技股份有限公司 Method, device and equipment for loading data during starting of virtual machine and storage medium
CN113821273B (en) * 2021-09-23 2023-10-13 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN114880076B (en) * 2022-05-11 2023-02-03 科东(广州)软件科技有限公司 Dynamic loading method and device for dynamic mapping file of user-mode virtual machine
CN117389693B (en) * 2023-12-12 2024-04-05 麒麟软件有限公司 IO layer security detection method of hardware virtualization system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102959512A (en) * 2010-07-02 2013-03-06 瑞典爱立信有限公司 Virtual machine splitting method and system
CN108183871A (en) * 2017-11-23 2018-06-19 北京三快在线科技有限公司 A kind of virtual switch, virtual switch start method, electronic equipment
CN109426546A (en) * 2017-09-01 2019-03-05 腾讯科技(深圳)有限公司 Using starting method and device, computer storage medium and equipment
WO2020063879A1 (en) * 2018-09-30 2020-04-02 华为技术有限公司 Method and apparatus for migrating virtual machine

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9317314B2 (en) * 2010-06-29 2016-04-19 Microsoft Techology Licensing, Llc Techniques for migrating a virtual machine using shared storage
TWI451245B (en) * 2011-09-14 2014-09-01 Inst Information Industry Virtual machine monitoring method, system and computer readable storage medium for storing thereof
CN107807839B (en) * 2016-09-09 2022-01-28 阿里巴巴集团控股有限公司 Method and device for modifying memory data of virtual machine and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102959512A (en) * 2010-07-02 2013-03-06 瑞典爱立信有限公司 Virtual machine splitting method and system
CN109426546A (en) * 2017-09-01 2019-03-05 腾讯科技(深圳)有限公司 Using starting method and device, computer storage medium and equipment
CN108183871A (en) * 2017-11-23 2018-06-19 北京三快在线科技有限公司 A kind of virtual switch, virtual switch start method, electronic equipment
WO2020063879A1 (en) * 2018-09-30 2020-04-02 华为技术有限公司 Method and apparatus for migrating virtual machine

Also Published As

Publication number Publication date
CN111930467A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111930467B (en) Virtual machine starting method, device, equipment and computer readable storage medium
US11243953B2 (en) Mapreduce implementation in an on-demand network code execution system and stream data processing system
US10949237B2 (en) Operating system customization in an on-demand network code execution system
US10902030B2 (en) User request processing method and device
US9990232B2 (en) Quality of service tagging for computing jobs
US10452372B2 (en) Method and deployment module for managing a container to be deployed on a software platform
RU2421785C2 (en) Automated control of device drivers
US7971047B1 (en) Operating system environment and installation
US10564999B2 (en) Employing application containers in a large scale processing environment
US11467814B2 (en) Static asset containers
US20190250960A1 (en) Method, apparatus, and server for managing image across cloud servers
Plauth et al. A performance survey of lightweight virtualization techniques
US20200244708A1 (en) Deriving system architecture from security group relationships
WO2023109113A1 (en) Application program query method and apparatus, device and storage medium
US9753759B2 (en) Optimizations and enhancements of application virtualization layers
US10324766B1 (en) Task profile collection
US20140344832A1 (en) Automated framework for tracking and maintaining kernel symbol list types
US20180046467A1 (en) Microvisor run time environment offload processor
US10915307B2 (en) Automatically producing software images
US11972252B2 (en) Docker installed software/hardware discovery
Koliogeorgi et al. AEGLE's cloud infrastructure for resource monitoring and containerized accelerated analytics
AU2022208115A1 (en) Workload configuration extractor
CN114090083A (en) Visual component configuration method, device, equipment and storage medium
EP4128726B1 (en) Signaling schemes in events message tracks
US20240143318A1 (en) Efficient configuration management in continuous deployment

Legal Events

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