Virtual machine built-in component management method, system, electronic device and storage medium
By using data planes and control planes in the virtual machine built-in component management architecture, dynamically managing virtual machine built-in components has solved the problem that existing solutions cannot support single-process management, batch reloading and security mechanisms at the same time, and achieve efficient and resource-saving component management.
Patent Information
- Application Number
- CN202411773081.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-08
AI Technical Summary
The existing virtual machine built-in component management solution cannot support single-process management, batch reloading and security mechanisms at the same time, and has high resource requirements, so it cannot adapt to complex scenarios of lightweight virtual machines.
Using a built-in component management architecture, including data planes and control planes, the control planes receive management policies and record them to the container group through the control plane. The data plane reads component status data from the container group, determines and performs component management tasks, including component lifecycle management, hot swapping and hot updates.
It realizes dynamic management of built-in components of virtual machines, supports multi-process management, batch reloading and security mechanisms, reduces resource requirements, improves management efficiency, and has no perception of users.
Smart Images

Figure CN119781900A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of virtual machines, and in particular to a method for managing built-in components of a virtual machine, a management system for built-in components of a virtual machine, an electronic device and a storage medium. Background Art
[0002] At present, the process management solutions of the community are only applicable to single process management, or will invade the business (perceive source code), or do not support batch reload, or do not provide corresponding security mechanisms. In the design based on lightweight virtual machines loading ECI (various components built into lightweight virtual machines) instances, the community solutions are not only complex in function and cannot cover the above scenarios at the same time, but also have high requirements for resources. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a method for managing virtual machine built-in components, a virtual machine built-in component management system, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In order to solve the above problems, in a first aspect of the present invention, an embodiment of the present invention discloses a method for managing a virtual machine's built-in component, which is applied to a built-in component management architecture, wherein the built-in component management architecture includes a data plane and a control plane, and the method includes:
[0005] The control plane receives a management policy;
[0006] The control plane records the management policy into the container group;
[0007] The data plane reads component status data from the container group and determines a component management task;
[0008] The data plane performs the component management tasks.
[0009] Optionally, the data plane reads component status data from the container group and determines the component management task, including:
[0010] The data plane reads component status data from the container group based on the interval heartbeat time;
[0011] The data plane determines whether there is a change in the component status data;
[0012] The data plane generates a component management task based on the component state data in response to a change in the component state data.
[0013] Optionally, the component management task includes a component lifecycle management task; and the data plane performs the component management task, including:
[0014] The data plane encapsulates the component status data to generate a first task to be executed;
[0015] The data plane submits the first task to be executed to the processor.
[0016] Optionally, the data plane includes a reloader and a process management center.
[0017] Optionally, the component management task includes a component hot plug task; and the data plane performs the component management task, including:
[0018] The reloader recognizes the component hot-swap task;
[0019] The reloader registers the process runtime configuration data according to the component hot-swap task;
[0020] The reloader notifies the process management center of the process runtime configuration data;
[0021] When the process management center receives the process runtime configuration data, it starts the proxy process;
[0022] The proxy process monitors the socket, registers the signal and creates the first target process according to the configuration data when the process is running;
[0023] After the first target process is created, the proxy process feeds back a state synchronization completion signal to the process management center, where the state synchronization completion signal is used to indicate that the component hot-swap task is completed.
[0024] Optionally, the component management task includes a component hot update task; and the data plane executes the component management task, including:
[0025] When the process management center identifies the component hot update task, it notifies the proxy process to perform a hot loading operation and issues an update strategy;
[0026] The proxy process creates a second target process based on the update strategy;
[0027] The proxy process sends an exit signal to the first target process;
[0028] After the process management center waits for a waiting time corresponding to the exit signal, the process management center closes the first target process and starts the second target process;
[0029] After the second target process is started, the proxy process notifies the process management center to update the process runtime configuration data.
[0030] Optionally, the data plane further includes: an inspection module; and the method further includes:
[0031] The inspection module accesses the process management center to obtain the runtime configuration data of the process;
[0032] The inspection module detects whether the first target process exists in response to the configuration data of the process being not empty when the process is running;
[0033] In response to the first target process not existing, the inspection module starts the first target process according to the process runtime configuration data.
[0034] In a second aspect of the present invention, an embodiment of the present invention discloses a virtual machine built-in component management system, which is applied to a built-in component management architecture, wherein the built-in component management architecture includes a data plane and a control plane, and the system includes:
[0035] The control plane is used to receive management policies;
[0036] The control plane is used to record the management policy into the container group;
[0037] The data plane is used to read component status data from the container group and determine component management tasks;
[0038] The data plane is used to perform the component management task.
[0039] According to a third aspect of the present invention, an embodiment of the present invention discloses an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for managing built-in components of a virtual machine as described above.
[0040] In a fourth aspect of the present invention, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the virtual machine built-in component management method as described above are implemented.
[0041] The embodiments of the present invention include the following advantages:
[0042] In the embodiment of the present invention, the control plane receives the management policy; the control plane records the management policy in the container group; the data plane reads the component status data from the container group to determine the component management task; and the data plane executes the component management task. By dynamically loading the management policy by providing a container group, the installation and upgrade process of the built-in components of the virtual machine does not affect the business container, and the user is unaware of the entire process. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of the steps of an embodiment of a method for managing a virtual machine's built-in components of the present invention;
[0044] Figure 2 is a flowchart of another embodiment of a method for managing a virtual machine's built-in components according to the present invention;
[0045] Figure 3 It is a schematic diagram of the built-in component management architecture of the present invention;
[0046] Figure 4 It is a schematic diagram of component lifecycle management task processing of the present invention;
[0047] Figure 5 It is a schematic diagram of component hot-swap task processing of the present invention;
[0048] Figure 6 It is a schematic diagram of component hot update task deployment of the present invention;
[0049] Figure 7 It is a schematic diagram of component hot update task processing of the present invention;
[0050] Figure 8 It is a schematic diagram of the strategy distribution and execution of the present invention;
[0051] Fig. 9 It is a structural block diagram of an embodiment of a virtual machine built-in component system of the present invention;
[0052] Fig.10 is a structural block diagram of an electronic device provided by an embodiment of the present invention;
[0053] Fig.11 It is a structural block diagram of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] Reference Figure 1 , shows a flowchart of a method for managing a virtual machine's built-in component according to an embodiment of the present invention, wherein the method for managing a virtual machine's built-in component is applied to a built-in component management architecture, wherein the built-in component management architecture includes a data plane and a control plane. The method for managing a virtual machine's built-in component may specifically include the following steps:
[0056] Step 101, the control plane receives a management policy;
[0057] It should be noted that the virtual machine built-in component described in the embodiment of the present invention may refer to an ECI basic component. The virtual machine is a lightweight virtual machine (LightWeight VirtualMachine, LWVM): capable of providing a simple, lightweight, limited-function virtual environment. LWVM has a single operating system, can support multiple operating systems and applications, and implement a virtualization solution with better performance.
[0058] The built-in component management architecture is the ECI-based built-in component management architecture on the server. It can connect with the client and receive the management policy sent by the client.
[0059] The management policy sent by the client may be received by the control plane.
[0060] Step 102, the control plane records the management policy into the container group;
[0061] The control plane can convert the management policy to determine the component status data and record it in its own container group. Since there is only northbound traffic between the data plane and the control plane, the data plane can only send and read information to the control plane. You can wait for the data plane to read from the container group.
[0062] Step 103, the data plane reads component status data from the container group and determines the component management task;
[0063] The data plane can read component status data from the container group and determine the corresponding component management tasks based on the component status data. Component management tasks include but are not limited to component lifecycle management tasks,
[0064] Process inspection, process hot update tasks and hot update security. Component lifecycle management tasks include operations such as component creation, update, deletion and metadata management. Process inspection tasks include the system periodically detecting the survival status of managed processes and automatically starting processes based on policies when they exit abnormally. Process hot update tasks are processes that implement elegant exit and non-interruption reload of ECI basic component processes based on hot update policies. Hot update security tasks can use mechanisms such as digital signatures to verify component metadata information to prevent invalid files from being sent.
[0065] Step 104: The data plane executes the component management task.
[0066] The data plane can manage the built-in components of the virtual machine accordingly based on different component management tasks to complete the corresponding component management tasks.
[0067] In the embodiment of the present invention, the control plane receives the management policy; the control plane records the management policy in the container group; the data plane reads the component status data from the container group to determine the component management task; and the data plane executes the component management task. By dynamically loading the management policy by providing a container group, the installation and upgrade process of the built-in components of the virtual machine does not affect the business container, and the user is unaware of the entire process.
[0068] Reference Figure 2 , shows a flowchart of another embodiment of a virtual machine built-in component management method of the present invention, the virtual machine built-in component management method is applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane. The data plane includes: a reloader, a process management center and a patrol module. For the built-in component management architecture, please refer to Figure 3 The built-in component management architecture consists of a control plane and a data plane. The control plane is mainly responsible for ECI instance logic management and lightweight virtual machine lifecycle management, and records metadata information and status information through ContainerGroup (CRD, container group). The data plane is mainly responsible for the lifecycle management of basic components and business containers in lightweight virtual machines.
[0069] The virtual machine built-in component management method may specifically include the following steps:
[0070] Step 201, the control plane receives a management policy;
[0071] When users use the client to perform related operations, they can send related instructions to the server, and the server generates corresponding management policies after receiving these instructions. The control plane can receive the management policies.
[0072] Step 202: The control plane records the management policy into the container group;
[0073] The control plane records various component status data in the management policy into the container group, waiting for the data plane to process.
[0074] Step 203, the data plane reads component status data from the container group and determines the component management task;
[0075] The data plane can read component status data from the container group and determine the component management task based on the component status data. The component status data can be various ECI data.
[0076] In an optional embodiment of the present invention, the data plane reads component status data from the container group and determines the component management task, including: the data plane reads the component status data from the container group based on the interval heartbeat time; the data plane determines whether there is a change in the component status data; the data plane generates a component management task based on the component status data in response to the change in the component status data.
[0077] A heartbeat signal can be maintained between the data plane and the control plane. The heartbeat mechanism can be used to enable the data plane to actively synchronize component status data, thereby determining component management tasks.
[0078] The data plane actively reads component status data from the container group based on the heartbeat interval corresponding to the heartbeat mechanism to achieve active synchronization of component status data. The acquired component status data is then compared with the component status data corresponding to the current process to determine whether the component status data has changed.
[0079] When the component status data changes, it means that the state corresponding to the process needs to be changed, that is, there is a corresponding component management task. In response to the change in the component status data, a component management task can be generated based on the component status data. When the component status data does not change, it means that the state corresponding to the process continues to be maintained, and there is no need to perform a corresponding management task.
[0080] Step 204: The data plane executes the component management task.
[0081] The data plane can perform corresponding component management tasks to achieve dynamic management of the built-in components of the virtual machine.
[0082] In one example of the present invention, the component management task includes a component lifecycle management task; the data plane executes the component management task, including: the data plane encapsulates the component status data to generate a first task to be executed; the data plane submits the first task to be executed to the processor.
[0083] Component management tasks may include component lifecycle management tasks. The data plane may encapsulate component status data, generate a first task to be executed, and submit the first task to be executed to the processor. The process management center in the processor is responsible for managing the lifecycle of the component process, such as starting the process, pausing the process, restarting the process, deleting the process, and querying the runtime configuration of the process.
[0084] For example, see Figure 4After the control plane publishes the policy on the ECI control plane, the policy tuner matches the ECI instance according to the Selector and modifies the ECI status information in batches. The data plane senses whether there is an installation or update task for the current lightweight virtual machine at the heartbeat interval of the hot update component. If so, a request is made to the eci-apiserver to obtain the eci instance information. After the hot update component extracts the ECI information, it is encapsulated into a task and submitted to the processor. The process management center (PMC) in the processor completes file (binary file, startup parameters, startup configuration) download, process registration, process startup / process reload, state synchronization and other operations.
[0085] In an example of the present invention, the component management task includes a component hot-plug task; the data plane executes the component management task, including: the reloader identifies the component hot-plug task; the reloader registers the process runtime configuration data based on the component hot-plug task; the reloader notifies the process management center of the process runtime configuration data; when the process management center receives the process runtime configuration data, it starts the agent process; the agent process monitors the socket, registers the signal and creates the first target process based on the process runtime configuration data; after the creation of the first target process is completed, the agent process feeds back a status synchronization completion signal to the process management center, and the status synchronization completion signal is used to indicate the completion of the component hot-plug task.
[0086] In an embodiment of the present invention, the control plane may provide a component version management tool to implement plug-in installation. The following steps may be included:
[0087] (1) The client uploads basic information such as binary files, version information, startup parameters, and startup configuration files in advance, and the server returns a 32-bit UUID (Universally Unique Identifier).
[0088] (2) When the client creates an ECI instance, it injects eci.ctyun.cn / component / kube-proxy:XXXXXXX. After the ECI control plane WebHook recognizes the current identifier, it marks the ECI instance status as requiring the installation of the kube-proxy component.
[0089] (3) After ECI-Agent completes the plug-in installation, it changes the ECI instance status to installed, that is, injects eci.ctyun.cn / component / kube-proxy / status:installed.
[0090] When a component is plugged in or unplugged, a component hot-plugging task is generated. Before the task is performed, the reloader identifies the component hot-plugging task and starts to execute the corresponding processing flow. When the reloader determines that it is a component hot-plugging task, it can first register the process runtime configuration data. The process runtime configuration data is RuntimeConfig, which is used to configure and manage the runtime behavior of the application in a flexible way.
[0091] The reloader notifies the process management center of the process runtime configuration data, so that the process management center starts the proxy process (such as Shim) based on the process management center. The proxy process such as Shim monitors the socket and registers the signal. In this way, the first target process can be created based on the process runtime configuration data. The first target process is the process generated when the component or plug-in is hot-plugged.
[0092] After the first target process is created, the proxy process can feedback a state synchronization completion signal to the process management center. The state synchronization completion signal indicates that the component hot plug task is completed. The process management center updates the corresponding process status information based on the state synchronization completion signal.
[0093] For example, see Figure 5 After the reloader recognizes the installation task, it first registers the process runtime configuration (RuntimeConfig), and then notifies the PMC to start the process based on the current configuration. The PMC starts the Shim through ttRPC (a lightweight remote procedure call protocol) and listens to the socket and registration signals on the Shim. The Shim then creates the corresponding component process based on the runtime configuration. After completing the above process, the Shim notifies the PMC to complete the status synchronization (such as PID status).
[0094] In an example of the present invention, the component management task includes a component hot update task; the data plane executes the component management task, including: when the process management center identifies the component hot update task, notifying the agent process to perform a hot loading operation and issue an update policy; the agent process creates a second target process based on the update policy; the agent process sends an exit signal to the first target process; after the process management center waits for the waiting time corresponding to the exit signal, it closes the first target process and starts the second target process; after the agent process starts the second target process, it notifies the process management center to update the process runtime configuration data.
[0095] In the embodiment of the present invention, the corresponding service is deployed in advance, so that the corresponding hot update process can be implemented. Figure 6The control plane first deploys Issuer-Controller and Policy CRD for hot update policy tuning and distribution. Then deploys VersionManager module (embedded in Matrix) for managing basic component metadata information and uploading and downloading installation files. Finally, deploys Fetcher module (embedded in Apiserver) for Reloader to download component installation files.
[0096] The client first registers component information with VersionManager, then creates a policy object Policy and associates it with the component UUID. Once the Issuer-Controller recognizes the Policy, it notifies the Apiserver to modify the status of the corresponding ECI instance. The reloader (embedded in the ECI-Agent) starts the corresponding process after the heartbeat interval to sense the update or installation task. The Policy object can be declared through a configuration file in YAML format.
[0097] Here is an example in code form:
[0098]
[0099]
[0100] Among them, the policy object Policy is a CRD object, in which spec.compress indicates the compression algorithm used for file download; spec.rule indicates the hot update rules, such as distribution timeout, graceful exit time, restart strategy, whether to allow cross-version overwrite, etc.; spec.scope indicates the scope of application of the current policy, which is matched according to the selector; spec.watchers indicates the list of components that the current policy focuses on, marked as upgraded from the current version to the expected version. spec.ignoreSignature is true, which means that the update file security check is ignored; when spec.updatePolicy is Always, it means that as long as the component concerned has a version update during the spec.scope.deadline period, the hot update process will be triggered. When spec.updatePolicy is UpdateOnVersion, it means that only one change will be triggered.
[0101] When the process management center identifies that the current task is a component hot update task, it can notify the agent process to perform a hot loading operation and send an update strategy to the agent process.
[0102] The proxy process can create a second target process based on the update strategy; the second target process is a process created during the hot plug task, which is used to replace the first target process. That is, when the component hot update task is completed, the second target process is started, and when the first target process is closed, the second target process forms a new first target process. The proxy process can also send an exit signal to the first target process, so that the first target process starts to exit and close.
[0103] After the process management center waits for a waiting time corresponding to the exit signal, the first target process is closed and the second target process is started.
[0104] After the second target process is started, the proxy process notifies the process management center to update the process runtime configuration data, so as to be used in various subsequent management tasks.
[0105] For example, see Figure 7 , the hot update task includes the following steps:
[0106] (1)PMC notifies Shim to perform hot loading and sends down the update strategy.
[0107] (2) After receiving the command, Shim creates a new process (the second target process) based on the new strategy, sends an exit signal to the old process (the first target process), and closes the old process after waiting for the old process to exit.
[0108] (3) Both the old and new processes inherit Shim’s socket file descriptor FD, so the service will not be interrupted during the restart process.
[0109] (4) After Shim completes component restart, it notifies PMC to update runtime configuration (such as PID).
[0110] In addition, in the component thermal management task, there are multiple subtasks to be allocated and processed, which can be processed by the data plane after the control plane determines the thermal update strategy. Figure 8 ,After the new policy is created, the tuner controls the distribution range and records the ,distribution status., After ECI-Agent perceives the updated policy, it starts the ,update process and completes the component hot loading.
[0111] Step 205, the inspection module accesses the process management center to obtain the runtime configuration data of the process;
[0112] The inspection module can periodically access the process management center to obtain the process runtime configuration data corresponding to each process from the process management center.
[0113] Step 206, the inspection module detects whether the first target process exists in response to the configuration data of the process being not empty when the process is running;
[0114] It can be determined whether the configuration data is empty when the process is running. When the configuration data is not empty when the process is running, it means that there is a corresponding process running, or the status data corresponding to the process exists. Anyway, if the configuration data is empty when the process is running, there is no need for subsequent detection, which improves management efficiency.
[0115] It is possible to detect whether the first target process exists, thereby managing the status of each process.
[0116] Step 207 : In response to the first target process not existing, the inspection module starts the first target process according to the process runtime configuration data.
[0117] When the first target process does not exist, that is, the process runtime configuration data exists, but the process corresponding to the process runtime configuration data does not exist or the process status data is empty, the corresponding process can be started based on the process runtime configuration data, that is, the first target process.
[0118] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0119] Reference Fig. 9 , shows a structural block diagram of an embodiment of a virtual machine built-in component system of the present invention, the virtual machine built-in component system is applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane, and the virtual machine built-in component system may specifically include the following modules:
[0120] The control plane 901 is used to receive management policies;
[0121] The control plane 901 is used to record the management policy into the container group;
[0122] The data plane 902 is used to read component status data from the container group and determine component management tasks;
[0123] The data plane 902 is used to perform the component management task.
[0124] In an optional embodiment of the present invention, the data plane 902 is used to read component status data from the container group based on an interval heartbeat time;
[0125] The data plane 902 is used to determine whether the component status data has changed;
[0126] The data plane 902 is used to generate a component management task based on the component state data in response to a change in the component state data.
[0127] In an optional embodiment of the present invention, the component management task includes a component lifecycle management task;
[0128] The data plane 902 is used to encapsulate the component status data to generate a first task to be executed;
[0129] The data plane 902 is used to submit the first task to be executed to the processor.
[0130] In an optional embodiment of the present invention, the data plane includes a reloader and a process management center.
[0131] In an optional embodiment of the present invention, the component management task includes a component hot-plug task; the reloader identifies the component hot-plug task;
[0132] The reloader is used to register the process runtime configuration data according to the component hot-swap task;
[0133] The reloader is used to notify the process management center of the process runtime configuration data;
[0134] The process management center is used to start the proxy process when receiving the process runtime configuration data;
[0135] The proxy process is used to monitor the socket, register the signal and create the first target process according to the configuration data when the process is running;
[0136] After the first target process is created, the proxy process is used to feed back a state synchronization completion signal to the process management center, and the state synchronization completion signal is used to indicate that the component hot-swap task is completed.
[0137] In an optional embodiment of the present invention, the component management task includes a component hot update task;
[0138] The process management center is used to notify the proxy process to perform hot loading operation and issue an update strategy when identifying the component hot update task;
[0139] The proxy process is used to create a second target process based on the update strategy;
[0140] The proxy process is used to send an exit signal to the first target process;
[0141] The process management center is used to close the first target process and start the second target process after waiting for the waiting time corresponding to the exit signal;
[0142] The proxy process is used to notify the process management center to update the process runtime configuration data after the second target process is started.
[0143] In an optional embodiment of the present invention, the data plane further includes: an inspection module; the system further includes:
[0144] The inspection module is used to access the process management center to obtain the runtime configuration data of the process;
[0145] The inspection module is used for detecting whether the first target process exists in response to the configuration data of the process being not empty when the process is running;
[0146] The inspection module is used for starting the first target process according to the configuration data when the process is running in response to the first target process not existing.
[0147] The embodiments of the present invention can support multi-process inspection, automatically pull up abnormally exited processes based on policies, and reduce service unavailability time. Provide CRD mode to dynamically load update policies, support graceful process exit and non-interruption restart, and reduce operation and maintenance costs. Provide a safety mechanism to prevent invalid or illegal hot update operations. Support batch hot update of ECI component processes in a non-invasive manner, and visualize the process. Support metadata management and version management of ECI basic components. Support automatic installation of components such as kube-proxy and log-agent in plug-in mode.
[0148] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0149] Reference Fig.10 , an embodiment of the present invention further provides an electronic device, including:
[0150] A processor 1001 and a storage medium 1002, wherein the storage medium 1002 stores a computer program executable by the processor 1001, and when the electronic device is running, the processor 1001 executes the computer program to perform the method for managing built-in components of a virtual machine as described in any one of the embodiments of the present invention.
[0151] The virtual machine built-in component management method is applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane, and the method includes:
[0152] The control plane receives a management policy;
[0153] The control plane records the management policy into the container group;
[0154] The data plane reads component status data from the container group and determines a component management task;
[0155] The data plane performs the component management tasks.
[0156] Optionally, the data plane reads component status data from the container group and determines the component management task, including:
[0157] The data plane reads component status data from the container group based on the interval heartbeat time;
[0158] The data plane determines whether there is a change in the component status data;
[0159] The data plane generates a component management task based on the component state data in response to a change in the component state data.
[0160] Optionally, the component management task includes a component lifecycle management task; and the data plane performs the component management task, including:
[0161] The data plane encapsulates the component status data to generate a first task to be executed;
[0162] The data plane submits the first task to be executed to the processor.
[0163] Optionally, the data plane includes a reloader and a process management center.
[0164] Optionally, the component management task includes a component hot plug task; and the data plane performs the component management task, including:
[0165] The reloader recognizes the component hot-swap task;
[0166] The reloader registers the process runtime configuration data according to the component hot-swap task;
[0167] The reloader notifies the process management center of the process runtime configuration data;
[0168] When the process management center receives the process runtime configuration data, it starts the proxy process;
[0169] The proxy process monitors the socket, registers the signal and creates the first target process according to the configuration data when the process is running;
[0170] After the first target process is created, the proxy process feeds back a state synchronization completion signal to the process management center, where the state synchronization completion signal is used to indicate that the component hot-swap task is completed.
[0171] Optionally, the component management task includes a component hot update task; and the data plane executes the component management task, including:
[0172] When the process management center identifies the component hot update task, it notifies the proxy process to perform a hot loading operation and issues an update strategy;
[0173] The proxy process creates a second target process based on the update strategy;
[0174] The proxy process sends an exit signal to the first target process;
[0175] After the process management center waits for a waiting time corresponding to the exit signal, the process management center closes the first target process and starts the second target process;
[0176] After the second target process is started, the proxy process notifies the process management center to update the process runtime configuration data.
[0177] Optionally, the data plane further includes: an inspection module; and the method further includes:
[0178] The inspection module accesses the process management center to obtain the runtime configuration data of the process;
[0179] The inspection module detects whether the first target process exists in response to the configuration data of the process being not empty when the process is running;
[0180] In response to the first target process not existing, the inspection module starts the first target process according to the process runtime configuration data.
[0181] The embodiments of the present invention can support multi-process inspection, automatically pull up abnormally exited processes based on policies, and reduce service unavailability time. Provide CRD mode to dynamically load update policies, support graceful process exit and non-interruption restart, and reduce operation and maintenance costs. Provide a safety mechanism to prevent invalid or illegal hot update operations. Support batch hot update of ECI component processes in a non-invasive manner, and visualize the process. Support metadata management and version management of ECI basic components. Support automatic installation of components such as kube-proxy and log-agent in plug-in mode.
[0182] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage system located away from the aforementioned processor.
[0183] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0184] Reference Fig.11 The embodiment of the present invention further provides a computer-readable storage medium 1101, on which a computer program is stored. When the computer program is executed by a processor, the method for managing built-in components of a virtual machine as described in any one of the embodiments of the present invention is executed.
[0185] The virtual machine built-in component management method is applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane, and the method includes:
[0186] The control plane receives a management policy;
[0187] The control plane records the management policy into the container group;
[0188] The data plane reads component status data from the container group and determines a component management task;
[0189] The data plane performs the component management tasks.
[0190] Optionally, the data plane reads component status data from the container group and determines the component management task, including:
[0191] The data plane reads component status data from the container group based on the interval heartbeat time;
[0192] The data plane determines whether there is a change in the component status data;
[0193] The data plane generates a component management task based on the component state data in response to a change in the component state data.
[0194] Optionally, the component management task includes a component lifecycle management task; and the data plane performs the component management task, including:
[0195] The data plane encapsulates the component status data to generate a first task to be executed;
[0196] The data plane submits the first task to be executed to the processor.
[0197] Optionally, the data plane includes a reloader and a process management center.
[0198] Optionally, the component management task includes a component hot plug task; and the data plane performs the component management task, including:
[0199] The reloader recognizes the component hot-swap task;
[0200] The reloader registers the process runtime configuration data according to the component hot-swap task;
[0201] The reloader notifies the process management center of the process runtime configuration data;
[0202] When the process management center receives the process runtime configuration data, it starts the proxy process;
[0203] The proxy process monitors the socket, registers the signal and creates the first target process according to the configuration data when the process is running;
[0204] After the first target process is created, the proxy process feeds back a state synchronization completion signal to the process management center, where the state synchronization completion signal is used to indicate that the component hot-swap task is completed.
[0205] Optionally, the component management task includes a component hot update task; and the data plane executes the component management task, including:
[0206] When the process management center identifies the component hot update task, it notifies the proxy process to perform a hot loading operation and issues an update strategy;
[0207] The proxy process creates a second target process based on the update strategy;
[0208] The proxy process sends an exit signal to the first target process;
[0209] After the process management center waits for a waiting time corresponding to the exit signal, the process management center closes the first target process and starts the second target process;
[0210] After the second target process is started, the proxy process notifies the process management center to update the process runtime configuration data.
[0211] Optionally, the data plane further includes: an inspection module; and the method further includes:
[0212] The inspection module accesses the process management center to obtain the runtime configuration data of the process;
[0213] The inspection module detects whether the first target process exists in response to the configuration data of the process being not empty when the process is running;
[0214] In response to the first target process not existing, the inspection module starts the first target process according to the process runtime configuration data.
[0215] The embodiments of the present invention can support multi-process inspection, automatically pull up abnormally exited processes based on policies, and reduce service unavailability time. Provide CRD mode to dynamically load update policies, support graceful process exit and non-interruption restart, and reduce operation and maintenance costs. Provide a safety mechanism to prevent invalid or illegal hot update operations. Support batch hot update of ECI component processes in a non-invasive manner, and visualize the process. Support metadata management and version management of ECI basic components. Support automatic installation of components such as kube-proxy and log-agent in plug-in mode.
[0216] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0217] Those skilled in the art will appreciate that the embodiments of the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present invention may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0218] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0219] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0220] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0221] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0222] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0223] The above describes in detail a method for managing a virtual machine built-in component, a virtual machine built-in component management system, an electronic device and a storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for managing built-in components of a virtual machine, characterized in that: Applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane, the method includes: The control plane receives a management policy; The control plane records the management policy into the container group; The data plane reads component status data from the container group and determines a component management task; The data plane performs the component management tasks.
2. The method according to claim 1, characterized in that: The data plane reads component status data from the container group and determines a component management task, including: The data plane reads component status data from the container group based on the interval heartbeat time; The data plane determines whether there is a change in the component status data; The data plane generates a component management task based on the component state data in response to a change in the component state data.
3. The method according to claim 1, characterized in that The component management tasks include component lifecycle management tasks; The data plane performs the component management task, including: The data plane encapsulates the component status data to generate a first task to be executed; The data plane submits the first task to be executed to the processor.
4. The method according to claim 1, characterized in that The data plane includes a reloader and a process management center.
5. The method according to claim 4, characterized in that The component management task includes a component hot plug task; the data plane performs the component management task, including: The reloader recognizes the component hot-swap task; The reloader registers the process runtime configuration data according to the component hot-swap task; The reloader notifies the process management center of the process runtime configuration data; When the process management center receives the process runtime configuration data, it starts the proxy process; The proxy process monitors the socket, registers the signal and creates the first target process according to the configuration data when the process is running; After the first target process is created, the proxy process feeds back a state synchronization completion signal to the process management center, where the state synchronization completion signal is used to indicate that the component hot-swap task is completed.
6. The method according to claim 5, characterized in that The component management task includes a component hot update task; the data plane executes the component management task, including: When the process management center identifies the component hot update task, it notifies the proxy process to perform a hot loading operation and issues an update strategy; The proxy process creates a second target process based on the update strategy; The proxy process sends an exit signal to the first target process; After the process management center waits for a waiting time corresponding to the exit signal, the process management center closes the first target process and starts the second target process; After the second target process is started, the proxy process notifies the process management center to update the process runtime configuration data.
7. The method according to claim 6, characterized in that The data plane further includes: an inspection module; the method further includes: The inspection module accesses the process management center to obtain the runtime configuration data of the process; The inspection module detects whether the first target process exists in response to the configuration data of the process being not empty when the process is running; In response to the first target process not existing, the inspection module starts the first target process according to the process runtime configuration data.
8. A virtual machine built-in component management system, characterized in that: Applied to a built-in component management architecture, the built-in component management architecture includes a data plane and a control plane, and the system includes: The control plane is used to receive management policies; The control plane is used to record the management policy into the container group; The data plane is used to read component status data from the container group and determine component management tasks; The data plane is used to perform the component management task.
9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for managing built-in components of a virtual machine as claimed in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of managing the built-in components of a virtual machine according to any one of claims 1 to 7 are implemented.