CN116974697A - Extension method of virtual machine instance and computing equipment - Google Patents

Extension method of virtual machine instance and computing equipment Download PDF

Info

Publication number
CN116974697A
CN116974697A CN202310954947.5A CN202310954947A CN116974697A CN 116974697 A CN116974697 A CN 116974697A CN 202310954947 A CN202310954947 A CN 202310954947A CN 116974697 A CN116974697 A CN 116974697A
Authority
CN
China
Prior art keywords
virtual machine
instance
program
seed
machine body
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
CN202310954947.5A
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202310954947.5A priority Critical patent/CN116974697A/en
Publication of CN116974697A publication Critical patent/CN116974697A/en
Pending legal-status Critical Current

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/45562Creating, deleting, cloning virtual machine instances
    • 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

Provided are a virtual machine instance expansion method and computing equipment. The executable file used for creating the virtual machine instance comprises a control program and a virtual machine body program, and the unshared memory section in the process space corresponding to the seed virtual machine instance is mapped in a private mode; the method comprises the following steps: in a seed instance process corresponding to a seed virtual machine instance, executing a first operation by a control program, wherein the first operation comprises: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; responding to the first request, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance; in the first new instance process, a second operation is performed by the control program, including restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue executing in the first new instance process.

Description

Extension method of virtual machine instance and computing equipment
Technical Field
One or more embodiments of the present disclosure relate to the field of computers, and in particular, to a method for expanding a virtual machine instance and a computing device.
Background
In some technical scenarios, it is desirable to quickly create multiple virtual machine instances to support the same or different transactions. For example, a function-as-a-service (Function as a Service, faaS) platform supports a developer to write functions that need to be run, by creating virtual machine instances to run functions written by the developer; different virtual machine instances may run the same or different functions.
A new solution is desired to more quickly complete the creation of virtual machine instances.
Disclosure of Invention
One or more embodiments of the present disclosure provide a method and a computing device for expanding a virtual machine instance.
In a first aspect, an extension method of a virtual machine instance is provided, where an executable file for creating the virtual machine instance includes a control program and a virtual machine body program, where the virtual machine body program includes a virtual machine operating system and/or an equipment simulator, and an unshared memory segment in a process space corresponding to a seed virtual machine instance is mapped in a private manner; the method comprises the following steps: in a seed instance process corresponding to the seed virtual machine instance, executing a first operation by the control program, wherein the first operation comprises: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; and responding to a first request for requesting to create the virtual machine instance, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance; in the first new instance process, performing, by the control program, a second operation, the second operation comprising: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first new instance process.
In a possible implementation manner, the seed instance process includes a first control thread corresponding to the control program and a first business thread corresponding to the virtual machine body program; wherein,,
the executing, by the control program, a first operation includes: and after the first service thread finishes initialization, the first control thread prohibits continuous scheduling of the first service thread and records the context of the first service thread.
In one possible implementation manner, the first new instance process includes a second control thread corresponding to the control program; wherein the executing, by the control program, the second operation includes: and the second control thread restores the execution environment of a second service thread corresponding to the first service thread in the first newly-added instance process according to the context, and allows the second service thread to be continuously scheduled.
In one possible implementation, the prohibiting the continuous scheduling of the first service thread includes destroying the first service thread.
In one possible implementation, the prohibiting the continuing to schedule the first service thread includes blocking the first service thread;
in one possible implementation manner, the prohibiting the continuous scheduling of the first service thread includes triggering a corresponding processor to terminate running the first service thread.
In a possible implementation manner, the seed instance process includes a first control cooperative program corresponding to the control program and a first service cooperative program corresponding to the virtual machine body program; wherein the executing, by the control program, the first operation includes: and after the first service cooperation program finishes initialization, the first control cooperation program prohibits continuous scheduling of the first service cooperation program and records the context of the first service cooperation program.
In one possible implementation manner, the first new instance process includes a second control protocol corresponding to the control program; wherein the executing, by the control program, the second operation includes: and the second control cooperative program restores the execution environment of a second service cooperative program corresponding to the first service cooperative program in the first newly-added example process according to the context, and allows the second service cooperative program to be continuously scheduled.
In one possible implementation manner, the process cloning the seed instance process includes: and initiating a system call to a system kernel of the host operating system to clone the seed instance process.
In one possible embodiment, the method further comprises: the seed instance process is created based on the executable file.
In one possible embodiment, the first operation further includes: responding to a second request for requesting to create a virtual machine instance, performing process cloning on the seed instance process to obtain a second newly-added instance process corresponding to a second newly-added virtual machine instance; wherein the method further comprises: in the second added instance process, executing a third operation by the control program, wherein the third operation comprises: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the second newly-added instance process.
In a second aspect, a computing device is provided, where the computing device includes a seed instance process corresponding to a seed virtual machine instance, an executable file for creating the virtual machine instance includes a control program and a virtual machine body program, the virtual machine body program includes a virtual machine operating system and/or a device simulator, and an unshared memory segment in a process space corresponding to the seed virtual machine instance is mapped in a private manner; wherein: the seed instance process is configured to perform a first operation by the control program, the first operation comprising: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; responding to a first request for requesting to create a virtual machine instance, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance; the first added instance process is configured to execute a second operation through the control program, and the second operation comprises: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first new instance process.
In a third aspect, there is provided a computer readable storage medium having stored thereon a computer program/instructions which, when executed in a computing device, implement the method of any of the first aspects.
In a fourth aspect, there is provided a computing device comprising a memory having stored therein a computer program/instruction and a processor executing the computer program/instruction to implement the method of any of the first aspects.
By means of the method and the computing device provided in one or more embodiments of the present disclosure, an executable file for creating a virtual machine instance includes a control program and a virtual machine ontology program, and by completing initialization of the virtual machine ontology program in a seed instance process corresponding to a seed virtual machine instance created based on the executable file, the control program is implemented to prohibit the virtual machine ontology program that has completed initialization from continuing execution in the seed instance, and to correspondingly record a context of the virtual machine ontology program; when a new virtual machine instance needs to be created, a new instance process is cloned from the seed instance process, and then the control program is only needed to realize that the execution environment of the virtual machine body program is restored according to the context of the virtual machine body program in the new instance process, and the virtual machine body program is allowed to continue to execute in the new instance process, so that the creation of the new virtual machine instance can be completed, the initialization of the virtual machine body program in the new instance process is completed without the cooperation of an operating system of a host machine, and the creation of the virtual machine instance can be completed more quickly.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present description, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a technical scenario corresponding to the technical solution provided in the embodiment of the present disclosure;
FIG. 2 is a flowchart of an extension method of a virtual machine instance provided in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an exemplary provided process for creating a new virtual machine instance;
fig. 4 is a schematic structural diagram of a computing device provided in an embodiment of the present disclosure.
Detailed Description
Various non-limiting embodiments provided by the present specification are described in detail below with reference to the attached drawings.
Fig. 1 is a schematic diagram of a technical scenario corresponding to the technical solution provided in the embodiment of the present disclosure.
Referring to FIG. 1, in a FaaS platform, multiple virtual machine instances, such as the illustrated virtual machine VM1 and virtual machine VM2, may be deployed by a host machine operating system in a computing device. The same or different functions written by the developer may be run in different virtual machine instances, e.g., function F1 may be run in virtual machine VM1 and function F2 may be run in virtual machine VM2. One or more language runtimes for supporting function operations may also be deployed in the virtual machine instance. For example, node. Js may be deployed in the illustrated virtual machine VM1 to support running functions written in the programming language JavaScript in the virtual machine VM 1; further as illustrated, the Python language runtime may be deployed in the virtual machine VM1 to support running functions written in the programming language Python in the virtual machine VM 1.
In the actual technical field, it is generally required to create virtual machine instances for running functions at high frequency, that is, to expand virtual machine instances at high frequency, so a new technical solution is desired to more quickly complete the creation of virtual machine instances.
The embodiment of the specification at least provides an extension method of a virtual machine instance and computing equipment. The executable file used to create the virtual machine instance includes a control program (also may be referred to as a control program section/control code section) and a virtual machine ontology program (also may be referred to as a virtual machine ontology program section/virtual machine ontology code section); a seed instance process corresponding to the seed virtual machine instance may be first created, and a first operation may be performed in the seed instance process by the control program, including: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in a seed instance process, recording a context corresponding to the virtual machine body program, and performing process cloning on the seed instance process in response to a first request for requesting to create a virtual machine instance to obtain a first new instance process corresponding to a first new virtual machine instance; then in the first newly added instance process, a second operation is performed by the control program, including: restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first newly-added instance process to complete the creation of the new virtual machine instance.
In this way, the executable file used for creating the virtual machine instance comprises a control program and a virtual machine body program, and the control program is used for prohibiting the virtual machine body program which is already initialized from continuously executing in the seed instance by completing the initialization of the virtual machine body program in the seed instance process corresponding to the seed virtual machine instance created based on the executable file and correspondingly recording the context of the virtual machine body program; when a new virtual machine instance needs to be created, a new instance process is cloned from the seed instance process, and then the control program is only needed to realize that the execution environment of the virtual machine body program is restored according to the context of the virtual machine body program in the new instance process, and the virtual machine body program is allowed to continue to execute in the new instance process, so that the creation of the new virtual machine instance can be completed, the initialization of the virtual machine body program in the new instance process is completed without the cooperation of an operating system of a host machine, and the creation of the virtual machine instance can be completed more quickly.
In addition, the method and the device realize that the instantiation of the virtual machine for running the functions, the language runtime and other components is more quickly completed under the condition that the execution logic of the functions, the language runtime and other components running through the virtual machine instance is not required to be changed, are more friendly to the developers of the functions and the developers of the language runtime, and are beneficial to improving the development efficiency and the user experience.
In addition, for the non-shared memory segment in the process space corresponding to the seed virtual machine instance, the non-shared memory segment is mapped in a private mode instead of being mapped in a shared mode, so that each new virtual machine instance created based on the seed virtual machine instance can be ensured to be completed, and normal access to the memory content corresponding to the related non-shared memory segment can be performed through the completion without interference.
Fig. 2 is a flowchart of an extension method of a virtual machine instance provided in an embodiment of the present disclosure. The method may be performed by a computing device deployed with an operating system (i.e., host operating system), which may be Linux, unix, or other type of operating system. The virtual machine instance may be a virtual machine comprising a single computing device or a cluster of devices comprising a plurality of computing devices for running a target application. The target application may be, for example, a function written by a developer in the FaaS platform, or it may be another application that is securely isolated by the virtual machine due to privacy protection requirements. Where the developer-written functions may be directly integrated with the corresponding language runtime.
An executable file in a computing device for creating a virtual machine instance includes a control program and a virtual machine ontology program.
The virtual machine ontology program includes a virtual machine operating system and/or a device simulator.
In a first possible scenario, the virtual machine ontology program comprises a virtual machine operating system, e.g., gVisor, which corresponds to a separate sandbox (sadbox). The language runtime and user-written functions run on the virtual machine operating system.
In a second possible scenario, the virtual machine ontology program comprises a virtual machine operating system, which may be, for example, a Linux operating system, a Unix operating system, or other type of operating system, and a device simulator, which may be, for example, a QEMU. The language runtime and user-written functions may run on a virtual machine operating system that runs on a device simulator.
In a third possible scenario, the virtual machine ontology program comprises a device simulator, such as QEMU. The language runtime and user-written functions run on the device simulator.
Referring to fig. 2, the method may include, but is not limited to, some or all of the following steps S201 to S205.
Step S201, a seed instance process corresponding to the seed virtual machine instance is created.
The computing device may create, with the support of its deployed operating system (i.e., host operating system), a seed instance process corresponding to a seed virtual machine instance based on an executable file containing a control program and a virtual machine ontology program.
The seed instance process may operate in a single-threaded or multi-threaded mode. When the seed instance process operates in a multithreading mode, the seed instance process may include a first control thread corresponding to the control program and a first service thread corresponding to the virtual machine body program. When the seed instance process operates in a single-threaded mode, a main thread may be included in the seed instance process, where the main thread may include a first control co-thread corresponding to a control program and a first service co-thread corresponding to a virtual machine ontology program.
Step S203, in a seed instance process corresponding to the seed virtual machine instance, executes a first operation by a control program, including: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; and responding to a first request for requesting to create the virtual machine instance, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance.
The control program needs to provide an inter-process communication mechanism, such as socket, pipe, or other inter-process communication mechanism, so that the seed instance process receives a request/message initiated by the control program from the requestor requesting creation of the virtual machine instance. The control program and the virtual machine ontology program may complete initialization in the seed instance process. Initialization of a virtual machine ontology program is accomplished by the fact that certain specific transactions defined by a developer in the virtual machine ontology program are successfully executed, i.e., by the completion of some specific functions, such as log functions, provided by the start/ready developer through the virtual machine ontology program. The control program finishes initialization, which can be understood in a logic sense as that after the control program finishes prohibiting the virtual machine body program from continuing to execute in the seed instance process and recording the context of the virtual machine body program, the control program starts to wait for a request/message initiated by a requesting party according to the identification of the seed instance process and used for requesting the seed virtual machine instance to create a new virtual machine instance.
Depending on the specific program implementation, the control program may also open at least one non-shared file during its initialization, e.g. open a type of non-shared file such as a pipe and/or epoll, to correspondingly obtain at least one non-shared file descriptor. In this case, the first operation performed by the control program further includes clearing the at least one unshared file descriptor; more specifically, the control program may clear at least one of its acquired non-shared file descriptors after the virtual machine ontology program completes initialization, before it begins waiting for a request/message initiated by the requesting party according to the identity of the seed instance process for requesting the seed virtual machine instance to create a new virtual machine instance.
When the seed instance process operates in the multithreading mode, the first operation may be performed by a first control thread corresponding to the control program. That is, referring to fig. 3, after the initialization of the corresponding first service thread is completed, the first control thread may prohibit the continuous scheduling of the first service thread, so as to prohibit the continuous execution of the virtual machine body program in the seed instance process, and correspondingly record the context thereof; then, a request for requesting to create a virtual machine instance is initiated by a waiting requester according to the identification of the seed instance process, and the seed instance process is cloned under the trigger of the received first request, so as to obtain a first new instance process corresponding to the first new virtual machine instance.
When the seed instance process is running in a single-threaded mode, the aforementioned first operation may be performed by a first control routine corresponding to the control program. That is, after the virtual machine body program completes initialization in the corresponding first service cooperative program, the first control cooperative program can prohibit the continuous scheduling of the first service cooperative program, thereby realizing prohibition of the continuous execution of the virtual machine body program in the seed instance process and corresponding recording of the context thereof; then, a request for requesting to create a virtual machine instance is initiated by a waiting requester according to the identification of the seed instance process, and the seed instance process is cloned under the trigger of the received first request, so as to obtain a first new instance process corresponding to the first new virtual machine instance.
The context of the virtual machine body program, used to describe the execution environment corresponding to when the virtual machine body program is prohibited from continuing to execute in the seed instance process after the initialization in the seed instance process, that is, the execution environment corresponding to when the "first service thread" or the "first service co-program" is prohibited from continuing to schedule, may include, but is not limited to, a related data structure corresponding to a value on each register in the processor and a basic data unit (the first service thread or the first service co-program).
When the seed instance process runs in the multithreading mode, the first service thread can be destroyed, blocked or the corresponding processor is triggered to stop running the first service thread by the interrupt of the processor, so that the continuous scheduling of the first service thread is forbidden. Similarly, the first service cooperation program can be forbidden to be continuously scheduled by destroying the first service cooperation program, blocking the first service cooperation program or triggering the corresponding processor to stop running the first service cooperation program through processor interrupt.
And system call can be initiated to the system kernel of the host operating system to clone the seed instance process. With continued reference to fig. 3, for example, the first request may be received by the first control thread, and under the trigger of the first request, a corresponding call is made to a fork system call in a system kernel of the Unix operating system, or a corresponding call is made to a clone system call in a system kernel of the Linux operating system, so that the system kernel clones the seed instance process.
It should be noted that, the system kernel may return, to the seed instance process, the identifier of the new instance process (the first new instance process) cloned by the system kernel, and return a predetermined message to the new instance process (the first new instance process).
Step S205, in the first new instance process, of executing, by the control program, a second operation, including: restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first newly-added instance process.
The first new instance process is a slave seed instance process gram Long Erlai, which has the same running state as the seed instance process.
The first add-on instance process may identify itself as an add-on instance process by receiving a predetermined message from the system kernel, such that the second operation is performed by the control program based on a trigger of the predetermined message.
It should be noted that, depending on the specific program implementation, if the first operation performed by the control program in the seed instance process includes clearing at least one non-shared file descriptor corresponding to at least one non-shared file; in the first new instance process, the second operation executed by the control program further includes reconstructing the non-shared file descriptors corresponding to the at least one non-shared file.
When the seed instance process comprises a first control thread and a first service thread, the cloned first newly-added instance process comprises a second control thread with the same running state as the first control thread, namely the second control thread records the context corresponding to the virtual machine body program. Accordingly, referring to fig. 3, the second operation may be performed by the second control thread, that is, the second control thread may resume, in the first newly added instance process, the execution environment of the second service thread corresponding to the first service thread according to the context corresponding to the virtual machine body program, and allow the second service thread to continue to be scheduled.
Corresponding to the operation of prohibiting the continuous scheduling of the first service thread, the continuous scheduling of the second service thread can be finally completed by restoring the data structure of the second service thread, waking up the second service thread, triggering the processor to continue to run the second service thread based on the restored execution environment of the second service thread through corresponding interrupt, and the like.
When the seed instance process comprises a first control cooperative program and a first service cooperative program, the cloned first newly-added instance process comprises a second control cooperative program with the same running state as the first control cooperative program. The second operation of the second control protocol Cheng Zhihang is that, in the first newly added instance process, the execution environment of the second service coordination process corresponding to the first service coordination process is restored according to the context corresponding to the virtual machine body program, and the second service coordination process is allowed to be continuously scheduled.
After the cloning of the first new instance process is completed, the seed instance process may continue to wait for other requests to create the virtual machine instance, for example, in response to the identification of the first new instance process received from the system kernel, perform clearing of redundant data in the seed instance process and checking of the state of the seed instance process, specifically, after it is determined that the virtual machine body program is always in a state of being prohibited to be executed in the seed instance process, and after the context corresponding to the virtual machine body program recorded in the control program has not been changed, the state of the seed instance process passes the checking, and after the self state passes the checking, the seed instance process may continue to wait for other requests initiated by the requester to create the virtual machine instance. In other words, the foregoing first operation performed by the control program may further include: responding to a second request for requesting to create the virtual machine instance, performing process cloning on the seed instance process to obtain a second newly-added instance process corresponding to the second newly-added virtual machine instance; correspondingly, similar to the first newly added instance process, the computing device may further perform, in the second newly added instance process, a third operation by the control program, including: restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the second newly-added instance process.
Based on the same conception as the foregoing method embodiments, a computing device 400 is also provided in the present description embodiments. Referring to fig. 4, the computing device 400 includes a seed instance process 401 corresponding to a seed virtual machine instance, an executable file for creating a virtual machine instance includes a control program and a virtual machine body program, where the virtual machine body program includes a virtual machine operating system and/or a device simulator, and an unshared memory segment in a process space corresponding to the seed virtual machine instance is mapped in a private manner; wherein: the seed instance process 401 is configured to perform a first operation by the control program, where the first operation includes: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process 401, and recording the context corresponding to the virtual machine body program; and, in response to a first request for creating a virtual machine instance, performing process cloning on the seed instance process 401 to obtain a first new instance process 403 corresponding to the first new virtual machine instance; the first new instance process 403 is configured to perform a second operation by the control program, where the second operation includes: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first newly-added instance process 403.
Those of skill in the art will appreciate that in one or more of the examples described above, the functions described herein may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the computer programs corresponding to these functions may be stored in a computer readable medium or transmitted as one or more instructions/codes on a computer readable medium, so that the computer programs corresponding to these functions are executed by a computer, by which the methods described in any of the embodiments of the present specification are implemented.
There is also provided in embodiments of the present specification a computer readable storage medium having stored thereon a computer program/instructions which, when executed in a computing device, performs a method of expanding a virtual machine instance provided in any of the embodiments of the present specification.
The embodiment of the specification also provides a computing device, which comprises a memory and a processor, wherein executable codes/instructions are stored in the memory, and when the processor executes the executable codes/instructions, the expansion method of the virtual machine instance provided in any embodiment of the specification is realized.
In this specification, each embodiment is described in a progressive manner, and the same and similar parts in each embodiment are referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention in further detail, and are not to be construed as limiting the scope of the invention, but are merely intended to cover any modifications, equivalents, improvements, etc. based on the teachings of the invention.

Claims (11)

1. An extension method of a virtual machine instance is used for creating an executable file of the virtual machine instance and comprises a control program and a virtual machine body program, wherein the virtual machine body program comprises a virtual machine operating system and/or a device simulator, and an unshared memory section in a process space corresponding to a seed virtual machine instance is mapped in a private mode; the method comprises the following steps:
in a seed instance process corresponding to the seed virtual machine instance, executing a first operation by the control program, wherein the first operation comprises: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; and responding to a first request for requesting to create the virtual machine instance, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance;
in the first new instance process, performing, by the control program, a second operation, the second operation comprising: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first new instance process.
2. The method of claim 1, wherein the seed instance process includes a first control thread corresponding to the control program and a first business thread corresponding to the virtual machine body program; wherein,,
the executing, by the control program, a first operation includes: and after the first service thread finishes initialization, the first control thread prohibits continuous scheduling of the first service thread and records the context of the first service thread.
3. The method of claim 2, wherein the first added instance process includes a second control thread corresponding to the control program; wherein,,
the performing, by the control program, a second operation includes: and the second control thread restores the execution environment of a second service thread corresponding to the first service thread in the first newly-added instance process according to the context, and allows the second service thread to be continuously scheduled.
4. The method of claim 2, the prohibiting continued scheduling of the first business thread, comprising:
destroying the first service thread;
or blocking the first service thread;
or triggering the corresponding processor to terminate running the first service thread.
5. The method of claim 1, wherein the seed instance process includes a first control coroutine corresponding to the control program and a first business coroutine corresponding to the virtual machine body program; wherein,,
the executing, by the control program, a first operation includes: and after the first service cooperation program finishes initialization, the first control cooperation program prohibits continuous scheduling of the first service cooperation program and records the context of the first service cooperation program.
6. The method of claim 5, wherein the first new instance process includes a second control protocol corresponding to the control program; wherein,,
the performing, by the control program, a second operation includes: and the second control cooperative program restores the execution environment of a second service cooperative program corresponding to the first service cooperative program in the first newly-added example process according to the context, and allows the second service cooperative program to be continuously scheduled.
7. The method of claim 1, the process cloning the seed instance process, comprising: and initiating a system call to a system kernel of the host operating system to clone the seed instance process.
8. The method of claim 1, the method further comprising: the seed instance process is created based on the executable file.
9. The method of any of claims 1-7, the first operation further comprising: responding to a second request for requesting to create a virtual machine instance, performing process cloning on the seed instance process to obtain a second newly-added instance process corresponding to a second newly-added virtual machine instance;
wherein the method further comprises: in the second added instance process, executing a third operation by the control program, wherein the third operation comprises: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the second newly-added instance process.
10. A computing device, which includes a seed instance process corresponding to a seed virtual machine instance, wherein an executable file for creating the virtual machine instance includes a control program and a virtual machine body program, the virtual machine body program includes a virtual machine operating system and/or a device simulator, and an unshared memory segment in a process space corresponding to the seed virtual machine instance is mapped in a private manner; wherein:
the seed instance process is configured to perform a first operation by the control program, the first operation comprising: after the initialization of the virtual machine body program is completed, prohibiting the virtual machine body program from continuing to execute in the seed instance process, and recording the context corresponding to the virtual machine body program; and responding to a first request for requesting to create the virtual machine instance, performing process cloning on the seed instance process to obtain a first new instance process corresponding to the first new virtual machine instance;
the first added instance process is configured to execute a second operation through the control program, and the second operation comprises: and restoring the execution environment of the virtual machine body program according to the context, and allowing the virtual machine body program to continue to execute in the first new instance process.
11. A computer readable storage medium having stored thereon a computer program which, when executed in a computing device, performs the method of any of claims 1-9.
CN202310954947.5A 2023-07-31 2023-07-31 Extension method of virtual machine instance and computing equipment Pending CN116974697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310954947.5A CN116974697A (en) 2023-07-31 2023-07-31 Extension method of virtual machine instance and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310954947.5A CN116974697A (en) 2023-07-31 2023-07-31 Extension method of virtual machine instance and computing equipment

Publications (1)

Publication Number Publication Date
CN116974697A true CN116974697A (en) 2023-10-31

Family

ID=88481105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310954947.5A Pending CN116974697A (en) 2023-07-31 2023-07-31 Extension method of virtual machine instance and computing equipment

Country Status (1)

Country Link
CN (1) CN116974697A (en)

Similar Documents

Publication Publication Date Title
JP4866864B2 (en) Method and program for managing access to shared resources in a multi-processor environment
US8176485B2 (en) Launching hypervisor under running operating system
EP2143001B1 (en) Master and subordinate operating system kernels for heterogeneous multiprocessor systems
US8429669B2 (en) Virtual machine switching control by prefetching information out of and updating a set of processor control information based on a bitmap having update status
US20070124729A1 (en) Method, apparatus and program storage device for providing an anchor pointer in an operating system context structure for improving the efficiency of accessing thread specific data
US20160274931A1 (en) Coordinating joint operation of multiple hypervisors in a computer system
TWI783034B (en) System and method for implementing drive
JP6941154B2 (en) Workflow-based object destruction
US10241829B2 (en) Information processing device, information processing method, recording medium, calculation processing device, calculation processing method
US7546600B2 (en) Method of assigning virtual process identifier to process within process domain
US20050251803A1 (en) Method of performing kernel task upon initial execution of process at user level
EP3719645B1 (en) Extension application mechanisms through intra-process operation systems
JPH02153434A (en) Data processing system
US10496433B2 (en) Modification of context saving functions
CN107315631B (en) Task scheduling method and device
CN110858164A (en) Inter-process communication method, device and computer readable medium
US8918799B2 (en) Method to utilize cores in different operating system partitions
US10691471B2 (en) Conflict resolution for strong symbols
CN116974697A (en) Extension method of virtual machine instance and computing equipment
US11144329B2 (en) Processor microcode with embedded jump table
US11385927B2 (en) Interrupt servicing in userspace
RU2718235C1 (en) Operating system architecture for supporting generations of microkernel
US9547522B2 (en) Method and system for reconfigurable virtual single processor programming model
US10678909B2 (en) Securely supporting a global view of system memory in a multi-processor system
US11423148B2 (en) Preventing discovery of unique identifiers in firmware

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