Virtual machine initialization method and device, equipment and medium
By acquiring and integrated target function scripts, using Windows operating systems to run these services, the complexity of the low -version Windows operating system on the cloud computing platform is solved, and the simplified initialization process and reduced costs are achieved.
Patent Information
- Application Number
- CN202411444430.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-24
AI Technical Summary
The existing technology is difficult to effectively initialize the lower version of Windows operating system on cloud computing platforms, resulting in complex and inefficient virtual machine deployment and management.
By obtaining the target function script based on initialization, the preset service registration component uses these scripts into the target system service of the Windows operating system, and run these services through the Windows operating system to achieve the initialization of the virtual machine on the cloud computing platform.
Simplify the initialization operation of the virtual machine on the cloud computing platform, reduce the initialization cost, and improve the user experience.
Smart Images

Figure CN119356800A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual machine technology, and in particular to a virtual machine initialization method, device, equipment and medium. Background Art
[0002] Currently, many companies choose to migrate their computing resources to cloud computing platforms to achieve higher flexibility and greater resource utilization.
[0003] Although modern operating systems are designed with many features to optimize the performance and management of cloud computing platforms, there are still a large number of low-version Windows operating systems that need to run on cloud computing platforms due to their huge application base and specific system features. However, the features and configuration requirements of these low-version Windows operating systems are different from those of modern cloud computing platforms. That is, existing initialization tools often cannot fully and effectively support low-version Windows systems, or difficult-to-solve failures such as missing system dependencies may occur when installing virtual machines with low-version Windows operating systems, making the deployment and management of the above-mentioned virtual machines in cloud computing platforms complicated and inefficient.
[0004] As can be seen from the above, how to simplify the initialization operation of the virtual machine on the cloud computing platform during the virtual machine initialization process is a problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a virtual machine initialization method, device, equipment and medium, which can integrate several target function scripts into a target system service by using a preset service registration component, and use the Windows operating system to run the target system service, thereby realizing the initialization operation of the target virtual machine on the cloud computing platform, thereby simplifying the initialization operation of the target virtual machine on the cloud computing platform and reducing the cost of performing the initialization operation. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a virtual machine initialization method, comprising:
[0007] Acquire several target function scripts developed based on initialization requirements and a preset general scripting language; the target function scripts are used to modify the target system core components in the target virtual machine to adjust the system setting parameters in the target system core components; the target virtual machine is installed with a Windows operating system whose system version is a preset lower version; the target system core components are system core components in the Windows operating system;
[0008] Integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component;
[0009] The Windows operating system in the target virtual machine is started, and the target system service is run by the started Windows operating system to initialize the target virtual machine on the cloud computing platform.
[0010] Optionally, after obtaining several target function scripts developed based on initialization requirements and a preset general scripting language, the method further includes:
[0011] Modular management is performed on a plurality of the target function scripts so as to extract the corresponding target function script based on user requirements, and the target function script is used to perform system settings and modify system parameters of the target virtual machine.
[0012] Optionally, after obtaining several target function scripts developed based on initialization requirements and a preset general scripting language, the method further includes:
[0013] Determine whether there is a preset type of target function script among the plurality of target function scripts; the preset type of target function script is a target function script that is currently unable to obtain the target data required by itself during execution;
[0014] If the target function script of the preset type exists, a corresponding configuration file is configured for the target function script of the preset type, so that the target function script of the preset type obtains the target data by using the configuration information read from the configuration file;
[0015] The target data includes metadata of the target virtual machine.
[0016] Optionally, after integrating the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component, the method further includes:
[0017] The target system service corresponding to the Windows operating system is configured in the target virtual machine, so that the target virtual machine uses the target system service to perform initialization operations on the cloud computing platform.
[0018] Optionally, after starting the Windows operating system in the target virtual machine and running the target system service through the started Windows operating system, the method further includes:
[0019] Utilizing the target system service to automatically respond to a failure of the Windows operating system;
[0020] The automatic response operation includes an automatic service restart operation, a configuration information reset operation, or an alarm notification sending operation.
[0021] Optionally, after using the target system service to respond to the failure of the Windows operating system, the method further includes:
[0022] The response operation of the target system service to the target virtual machine is recorded in a preset system service log, so as to use the operation recorded in the preset system service log to troubleshoot and solve the problem in the target virtual machine.
[0023] Optionally, the preset universal scripting language is PowerShell scripting language, the preset service registration component is SrvAny component, and the target system core components include Windows management tools and a registry of the Windows operating system.
[0024] In a second aspect, the present application provides a virtual machine initialization device, comprising:
[0025] A script acquisition module is used to acquire a number of target function scripts developed based on initialization requirements and a preset general scripting language; the target function scripts are used to modify a target system core component in a target virtual machine to adjust system setting parameters in the target system core component; a Windows operating system with a preset lower version of the system version is installed in the target virtual machine; the target system core component is a system core component in the Windows operating system;
[0026] A system service integration module, used to integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component;
[0027] The system service running module is used to start the Windows operating system in the target virtual machine and run the target system service through the started Windows operating system to achieve the initialization of the target virtual machine on the cloud computing platform.
[0028] In a third aspect, the present application provides an electronic device, including:
[0029] Memory, used to store computer programs;
[0030] The processor is used to execute the computer program to implement the aforementioned virtual machine initialization method.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned virtual machine initialization method when executed by a processor.
[0032] As can be seen from the above, before initializing the virtual machine, the present application needs to obtain several target function scripts developed based on the initialization needs and the preset general scripting language; the target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system with a preset lower version of the system version; the target system core component is the system core component in the Windows operating system; the preset service registration component is used to integrate the several target function scripts into the target system service corresponding to the Windows operating system; the Windows operating system in the target virtual machine is started, and the target system service is run by the Windows operating system after startup to realize the initialization of the target virtual machine on the cloud computing platform. It can be seen that the present application integrates several target function scripts into the target system service by using the preset service registration component, and uses the Windows operating system to run the target system service, thereby realizing the initialization operation of the target virtual machine on the cloud computing platform. In this way, the initialization operation of the target virtual machine on the cloud computing platform is simplified, the cost required for the initialization operation is reduced, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0034] Figure 1 A flow chart of a virtual machine initialization method disclosed in this application;
[0035] Figure 2 A schematic diagram comparing the deployment process of a target function script disclosed in this application with that of a traditional deployment process;
[0036] Figure 3 A schematic diagram of a target function script architecture disclosed in this application;
[0037] Figure 4 This is a structural flow chart of a virtual machine initialization device disclosed in this application;
[0038] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] At present, there are a large number of low-version Windows operating systems that need to be run on cloud computing platforms due to their huge application base and specific system characteristics. However, the characteristics and configuration requirements of these low-version Windows operating systems are different from those of modern cloud computing platforms, which makes the deployment and management of virtual machines in cloud computing platforms complicated and inefficient. To this end, the present application provides a virtual machine initialization method that can simplify the initialization operation of a target virtual machine on a cloud computing platform and reduce the cost required for the initialization operation.
[0041] See also Figure 1 As shown, an embodiment of the present invention discloses a method for initializing a virtual machine, comprising:
[0042] Step S11, obtaining several target function scripts developed based on initialization requirements and a preset general scripting language; the target function scripts are used to modify the target system core components in the target virtual machine to adjust the system setting parameters in the target system core components; the target virtual machine is installed with a Windows operating system with a preset lower version of the system version; the target system core components are system core components in the Windows operating system.
[0043] In the cloud computing platform environment, the initialization of virtual machines is a key step to ensure the efficient operation of services. Although some common Windows cloud initialization tools currently perform well in modern cloud services, the above Windows cloud initialization tools still face many challenges and limitations when initializing low-version Windows operating systems.
[0044] In the first specific implementation, Cloudbase-Init (i.e., an open source project that provides initialization services for instances in a cloud environment) implemented based on Python is difficult to install and run on an earlier version of the Windows operating system due to the dependency on the language and library versions. This not only limits its application on the system, but also increases the complexity of maintenance and adaptation.
[0045] In the second specific implementation, although Azure Custom Script Extension (i.e. Custom Script Extension, an extension function for executing custom scripts in a virtual machine) provides custom script execution capabilities, its complex configuration management makes the script debugging process difficult. In addition, Azure Custom Script Extension's dependence on the network makes it unusable in offline or closed network environments, and it is only an initialization tool provided by the Azure platform and does not have cross-platform scalability;
[0046] In the third specific implementation, the script configured in AWS EC2 User Data (i.e., a function for specifying a custom script when creating an EC2 instance) (EC2: elastic compute cloud) can only be executed at the first startup, which makes it difficult to cope with scenarios where configuration information needs to be dynamically updated, and also faces the problems of platform dependence and difficulty in debugging.
[0047] It is understandable that, due to the relatively basic application functions of the low-version Windows operating system and the limited custom configuration options, the flexibility and scalability of the above-mentioned low-version Windows operating system in the modern cloud computing environment are low compared to modern operating systems. However, at the same time, since there are still a large number of legacy systems that need to run on the cloud computing platform due to specific applications or compatibility requirements, there are a large number of requirements for initializing the low-version Windows operating system on the market. To this end, this application is based on the initialization needs and uses a preset general scripting language to develop several target function scripts that can achieve different functions. After obtaining several target function scripts, it is necessary to modularly manage the above-mentioned several target function scripts. Specifically, after obtaining several target function scripts developed based on the initialization needs and the preset general scripting language, it can also include: modularly managing several target function scripts, so as to extract the corresponding target function scripts based on user needs, and use the target function script to modify the system settings and system parameters of the target virtual machine. Among them, the preset general scripting language is the PowerShell scripting language, the preset service registration component is the SrvAny component, and the target system core components include Windows management tools and the registry of the Windows operating system.
[0048] It is worth mentioning that lower versions of Windows operating systems include but are not limited to Windows XP, Windows Server 2003, Windows 7, and Windows Server 2008R2, which are no longer officially supported Windows systems and will not be listed here one by one.
[0049] In this embodiment, after obtaining a number of target function scripts, it is necessary to configure a corresponding configuration file for a preset type of target function script, so that the preset type of target function script can obtain the target data using the configuration information read from the configuration file. Specifically, after obtaining a number of target function scripts developed based on initialization needs and a preset general scripting language, it can also include: determining whether there is a preset type of target function script among the several target function scripts; the preset type of target function script is a target function script that is currently unable to obtain the target data required by itself during execution; if the preset type of target function script exists, then configuring a corresponding configuration file for the preset type of target function script, so that the preset type of target function script can obtain the target data using the configuration information read from the configuration file; wherein, the target data includes metadata of the target virtual machine.
[0050] In addition, since the process of installing and configuring several target function scripts is not complicated, the system initialization can be completed by using only system functions and utilizing the above-mentioned several target function scripts. There is no need to rely on external applications or library functions, and in the process of debugging the system, there is no need to repeatedly create or start virtual machines. It supports users to customize the design of functions and the configuration of data, so the above-mentioned several target function scripts can be expanded to various cloud computing platforms to complete the adaptation.
[0051] Step S12: using a preset service registration component to integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system.
[0052] In this embodiment, after integrating several target function scripts into the target system service corresponding to the Windows operating system by using the preset service registration component, the target system service needs to be configured in the target virtual machine. Specifically, after integrating the several target function scripts into the target system service corresponding to the Windows operating system by using the preset service registration component, the method may further include: configuring the target system service corresponding to the Windows operating system in the target virtual machine, so that the target virtual machine uses the target system service to perform initialization operations on the cloud computing platform. That is, only after the target system service is configured in the target virtual machine first, the target virtual machine can use the function of the target system service to operate.
[0053] Step S13: start the Windows operating system in the target virtual machine, and run the target system service through the started Windows operating system to initialize the target virtual machine on the cloud computing platform.
[0054] In this embodiment, after the target system service is run by the Windows operating system after startup, the target system service can respond to the running state of the Windows operating system accordingly, and when the running state of the Windows operating system fails, an automatic response operation can also be performed. Specifically, after the Windows operating system in the target virtual machine is started and the target system service is run by the Windows operating system after startup, it can also include: using the target system service to automatically respond to the failure of the Windows operating system; wherein the automatic response operation includes an automatic service restart operation, a configuration information reset operation or an alarm notification sending operation. It is worth mentioning that after performing the corresponding response operation, the response operation performed needs to be recorded in the preset system service log. Specifically, after the target system service is used to respond to the failure of the Windows operating system, it can also include: recording the response operation performed by the target system service on the target virtual machine in the preset system service log, so as to use the operations recorded in the preset system service log to troubleshoot and solve the problems in the target virtual machine.
[0055] As can be seen from the above, before initializing the virtual machine, the present application needs to obtain several target function scripts developed based on the initialization needs and the preset general scripting language; the target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system with a preset lower version of the system version; the target system core component is the system core component in the Windows operating system; the preset service registration component is used to integrate the several target function scripts into the target system service corresponding to the Windows operating system; the Windows operating system in the target virtual machine is started, and the target system service is run by the Windows operating system after startup to realize the initialization of the target virtual machine on the cloud computing platform. It can be seen that the present application integrates several target function scripts into the target system service by using the preset service registration component, and uses the Windows operating system to run the target system service, thereby realizing the initialization operation of the target virtual machine on the cloud computing platform. In this way, the initialization operation of the target virtual machine on the cloud computing platform is simplified, the cost required for the initialization operation is reduced, and the user experience is improved.
[0056] Further, to illustrate the configuration process of the function script for virtual machine initialization, see Figure 2 As shown, including:
[0057] In this embodiment, the present application develops several target function scripts based on initialization requirements and a preset general scripting language, which can effectively reduce the cost of initializing the virtual machine and improve the deployment efficiency of the function scripts. Figure 2 The deployment process of the target function script created by the present invention is compared with the traditional deployment process. From the comparison results, it can be obtained that the present invention can automatically perform initialization operations after the deployment is completed by pre-configuring the target function script in the low-version Windows operating system. After it is put into production, the system service can automatically respond to the system according to preset rules, and record the operations of automatic response processing in the system service log, so that the operations recorded in the preset system service log can be used to troubleshoot and solve the problems encountered in the target virtual machine, wherein the automatic response processing includes but is not limited to automatically restarting the service, resetting the configuration information or sending an alarm notification.
[0058] In this embodiment, the target function script architecture of the present invention is as follows Figure 3As shown: In a specific implementation, by using the target function script developed by PowerShell language to modify the contents of two system core components, WMI (Windows Management Instrumentation, i.e., a method for providing a common interface and object model to access management information about operating systems, devices, applications and services) and registry, the stable implementation of the initialization operation of the lower version Windows operating system is promoted; that is, the embodiment of the present application can develop PowerShell scripts based on the needs of developers and using PowerShell language, so as to use the developed PowerShell scripts to accurately modify the WMI content and registry items, thereby using the modified WMI content and registry items to automatically perform system setting operations, reducing the need for manual configuration and potential errors. Among them, the system setting operations include but are not limited to setting account data operations, installing device drivers, configuring network parameters operations, and adjusting disk specifications operations.
[0059] It is worth mentioning that the embodiment of the present application realizes highly personalized system configuration operation by modularly managing each function script after development and adjusting system settings and system parameters according to specific needs. At the same time, a corresponding local configuration file is configured for the PowerShell script so that the PowerShell script can obtain metadata by reading the information in the pre-configured local configuration file using the information read from the local configuration file; in this way, by modularly managing each function script and adding a local configuration file to each function script, the present application realizes flexible initialization configuration, that is, allowing users to enable functions and configure specific parameters according to their own needs.
[0060] In addition, after completing the development and debugging of each functional script, in a specific implementation, the present invention introduces the SrvAny tool to integrate the above-mentioned functional scripts into Windows services, thereby ensuring that the functional scripts can run automatically when the system starts, and allowing the functional scripts to configure running permissions, dependencies and fault recovery strategies as needed to ensure that the service can function stably.
[0061] It can be understood that the present application provides an efficient, flexible and stable solution for the initialization of low-version Windows operating systems in cloud computing platforms, and its specific advantages are reflected in the following aspects: First, it can automatically configure script information: the present application automatically executes system settings and system services through functional scripts, significantly reducing the need for manual intervention, reducing potential errors caused by improper human operation, and improving the accuracy and efficiency of system deployment; secondly, the system functions can be flexibly configured: the present application takes advantage of PowerShell to perform modular management of initialization tools, thereby realizing a personalized custom initialization process; thirdly, the present application does not require the participation of external applications: the present invention does not need to rely on external applications and tools, but only needs to use initialization scripts to simplify the deployment process and improve the stability of the initialization process; then, the present application can simplify the configuration process: the service-oriented management used in the present application simplifies the configuration and debugging process of system initialization, and ensures the consistency and reliability of the initialization process by setting service parameters, thereby improving the stability of the system; finally, the present application has high scalability: the present application provides a unified solution that can stably perform initialization operations in different operating systems and different cloud computing platforms, reducing adaptation and operation and maintenance costs. It is worth mentioning that the initialization method proposed in this application is independent of the cloud computing platform architecture, can flexibly adapt to different cloud computing platforms and virtualization technologies, has strong versatility and applicability, and provides a unified initialization solution for low-version Windows operating systems in different cloud computing platforms.
[0062] It can be seen that the present invention realizes automatic and rapid response to faults in the system by effectively utilizing the system service function, thereby reducing system downtime. For this reason, the present invention can efficiently complete the initialization task of virtual machines of different operating systems on the cloud computing platform, and provides several reliable, flexible and easy-to-maintain target function scripts, wherein the design of the above target function scripts takes into account the specific requirements of the cloud computing platform and the challenges encountered by the low-version Windows operating system during the deployment process, reduces the operation and maintenance costs, improves the stability and reliability of the system and platform, and provides an effective solution for the initialization of the low-version Windows operating system on the cloud computing platform.
[0063] Accordingly, see Figure 4 As shown, the present application also provides a virtual machine initialization device, including:
[0064] The script acquisition module 11 is used to acquire a plurality of target function scripts developed based on initialization requirements and a preset general scripting language; the target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system whose system version is a preset lower version; the target system core component is a system core component in the Windows operating system;
[0065] The system service integration module 12 is used to integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component;
[0066] The system service running module 13 is used to start the Windows operating system in the target virtual machine, and run the target system service through the started Windows operating system to achieve the initialization of the target virtual machine on the cloud computing platform.
[0067] As can be seen from the above, before initializing the virtual machine, the present application needs to obtain several target function scripts developed based on the initialization needs and the preset general scripting language; the target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system with a preset lower version of the system version; the target system core component is the system core component in the Windows operating system; the preset service registration component is used to integrate the several target function scripts into the target system service corresponding to the Windows operating system; the Windows operating system in the target virtual machine is started, and the target system service is run by the Windows operating system after startup to realize the initialization of the target virtual machine on the cloud computing platform. It can be seen that the present application integrates several target function scripts into the target system service by using the preset service registration component, and uses the Windows operating system to run the target system service, thereby realizing the initialization operation of the target virtual machine on the cloud computing platform. In this way, the initialization operation of the target virtual machine on the cloud computing platform is simplified, the cost required for the initialization operation is reduced, and the user experience is improved.
[0068] In some specific implementations, the script acquisition module 11 may specifically include:
[0069] The script management unit is used to perform modular management on a plurality of the target function scripts so as to extract the corresponding target function scripts based on user requirements, and use the target function scripts to perform system settings and modify system parameters of the target virtual machine.
[0070] In some specific implementations, the script acquisition module 11 may specifically include:
[0071] A script determination unit, used to determine whether there is a target function script of a preset type among the plurality of target function scripts; the target function script of the preset type is a target function script that is currently unable to obtain the target data required by itself during execution;
[0072] A file configuration unit is used to configure a corresponding configuration file for the target function script of the preset type if there is a target function script of the preset type, so that the target function script of the preset type obtains the target data using the configuration information read from the configuration file; wherein the target data includes metadata of the target virtual machine.
[0073] In some specific implementations, the system service integration module 12 may specifically include:
[0074] The service configuration unit is used to configure the target system service corresponding to the Windows operating system in the target virtual machine, so that the target virtual machine uses the target system service to perform initialization operations on the cloud computing platform.
[0075] In some specific implementations, the virtual machine initialization device may further include:
[0076] A fault response unit is used to use the target system service to automatically respond to a fault occurring in the Windows operating system; wherein the automatic response operation includes an automatic service restart operation, a configuration information reset operation, or an alarm notification sending operation.
[0077] In some specific implementations, the virtual machine initialization device may further include:
[0078] The operation recording unit is used to record the response operation of the target system service to the target virtual machine in a preset system service log, so as to use the operations recorded in the preset system service log to troubleshoot and solve problems in the target virtual machine.
[0079] Furthermore, the present application also discloses an electronic device. Figure 5It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the virtual machine initialization method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0080] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0081] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0082] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the virtual machine initialization method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0083] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed virtual machine initialization method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0084] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0085] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0086] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0087] 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 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0088] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A virtual machine initialization method, characterized in that: include: Obtain several target function scripts developed based on initialization requirements and a preset general scripting language; The target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system whose system version is a preset lower version; The target system core component is a system core component in the Windows operating system; Integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component; The Windows operating system in the target virtual machine is started, and the target system service is run by the started Windows operating system to initialize the target virtual machine on the cloud computing platform.
2. The virtual machine initialization method according to claim 1, characterized in that: After obtaining several target function scripts developed based on initialization requirements and a preset general scripting language, the method further includes: Modular management is performed on a plurality of the target function scripts so as to extract the corresponding target function script based on user requirements, and the target function script is used to perform system settings and modify system parameters of the target virtual machine.
3. The virtual machine initialization method according to claim 1, characterized in that: After obtaining several target function scripts developed based on initialization requirements and a preset general scripting language, the method further includes: Determine whether there is a preset type of target function script among the plurality of target function scripts; the preset type of target function script is a target function script that is currently unable to obtain the target data required by itself during execution; If the target function script of the preset type exists, a corresponding configuration file is configured for the target function script of the preset type, so that the target function script of the preset type obtains the target data by using the configuration information read from the configuration file; The target data includes metadata of the target virtual machine.
4. The virtual machine initialization method according to claim 1, characterized in that: After integrating the plurality of target function scripts into the target system service corresponding to the Windows operating system by using the preset service registration component, the method further includes: The target system service corresponding to the Windows operating system is configured in the target virtual machine, so that the target virtual machine uses the target system service to perform initialization operations on the cloud computing platform.
5. The virtual machine initialization method according to claim 1, characterized in that: After starting the Windows operating system in the target virtual machine and running the target system service through the started Windows operating system, the method further includes: Utilizing the target system service to automatically respond to a failure of the Windows operating system; The automatic response operation includes an automatic service restart operation, a configuration information reset operation, or an alarm notification sending operation.
6. The virtual machine initialization method according to claim 5, characterized in that: After the target system service is used to automatically respond to the failure of the Windows operating system, the method further includes: The response operation of the target system service to the target virtual machine is recorded in a preset system service log, so as to use the operation recorded in the preset system service log to troubleshoot and solve the problem in the target virtual machine.
7. The virtual machine initialization method according to any one of claims 1 to 6, characterized in that: The preset universal scripting language is the PowerShell scripting language, the preset service registration component is the SrvAny component, and the target system core components include Windows management tools and a registry of the Windows operating system.
8. A virtual machine initialization device, characterized in that: include: A script acquisition module is used to acquire several target function scripts developed based on initialization requirements and a preset general scripting language; The target function script is used to modify the target system core component in the target virtual machine to adjust the system setting parameters in the target system core component; the target virtual machine is installed with a Windows operating system whose system version is a preset lower version; The target system core component is a system core component in the Windows operating system; A system service integration module, used to integrate the plurality of target function scripts into a target system service corresponding to the Windows operating system by using a preset service registration component; The system service running module is used to start the Windows operating system in the target virtual machine and run the target system service through the started Windows operating system to achieve the initialization of the target virtual machine on the cloud computing platform.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the virtual machine initialization method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the virtual machine initialization method according to any one of claims 1 to 7 are implemented.