CN111414232B - Virtual machine template data processing method and device - Google Patents

Virtual machine template data processing method and device Download PDF

Info

Publication number
CN111414232B
CN111414232B CN202010194717.XA CN202010194717A CN111414232B CN 111414232 B CN111414232 B CN 111414232B CN 202010194717 A CN202010194717 A CN 202010194717A CN 111414232 B CN111414232 B CN 111414232B
Authority
CN
China
Prior art keywords
template
virtual machine
task
name
editing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010194717.XA
Other languages
Chinese (zh)
Other versions
CN111414232A (en
Inventor
涂耀旭
刘洋
马涛
王家学
韩兆晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202010194717.XA priority Critical patent/CN111414232B/en
Publication of CN111414232A publication Critical patent/CN111414232A/en
Application granted granted Critical
Publication of CN111414232B publication Critical patent/CN111414232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The embodiment of the application provides a virtual machine template data processing method and device, wherein the method comprises the following steps: receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request; executing corresponding editing processing on the virtual machine template, and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform; the method and the device can effectively ensure the correctness and consistency of the templates on a plurality of virtualization management platforms, and reduce the operation and maintenance cost.

Description

Virtual machine template data processing method and device
Technical Field
The application relates to the field of data processing, in particular to a virtual machine template data processing method and device.
Background
At present, the cloud environment mainly has two implementation routes: virtualization and containerization. A resource management technology is mainly used for pooling of physical resources including servers, CPUs, memories, networks, storages and the like, and is dynamically and elastically distributed to users. Through virtualization technology, multiple independent virtual machines can be created on one physical machine, different operating systems are allowed to be installed in the virtual machines, and different network IP addresses are configured. Currently, enterprises typically deploy virtualized private clouds based on Vmware (desktop-to-data center virtualized cloud environment), citrix, KVM, etc. technologies.
In a virtualized cloud environment based on Vmware implementation, users can make common operating systems and software into templates, and rapidly deploy new virtual machines through operations of copying templates when needed. However, this deployment operation requires that the template and the new virtual machine must be in the same VCenter (virtualization management platform). Thus, if there are multiple VCents, all templates need to be configured for each VCenter. For large enterprises, because the cloud environment is long in construction time span and large in resource scale, a plurality of VCenter clusters exist in private cloud, and the VCenter version, the Esxi version, the virtual machine version and the compatibility of the clusters to an operating system are different, so that a complex heterogeneous private cloud environment is finally formed. When the template is subjected to operations such as adding, deleting, modifying and rollback, how to ensure the correctness and consistency of each VCenter template and avoid excessive repetitive labor of operation and maintenance personnel becomes a very challenging problem.
At present, the industry relates to template related management, and no complete and systematic template management platform is available at present, and the template is generally modified by operation and maintenance personnel to each VCenter in turn, or is synchronized by taking OVF as an intermediary. The second method is specifically to export the modified template on a certain VCenter into OVF file, then import it into other VCenter through deploying OVF operation, and finally transform the imported virtual machine into the template.
The operation and maintenance personnel sequentially go to each VCenter to modify the template, or the mode of realizing template synchronization by taking OVF as an intermediary can not effectively realize automation, visualization, traceability and rollback, and the following defects can be inevitably caused in a large-scale cloud environment:
firstly, when the number of the VCenter clusters is large, the operation and maintenance personnel are completely relied on to operate manually, the efficiency is low, and the operation accuracy is difficult to ensure. For example, when one template involves a plurality of operations, the operation inconsistency is most likely caused by modifying the templates on the respective vcenters in the first manner. For the template modification, if a problem is found in a later period of time, the problem needs to be repaired or rolled back, and the synchronous operation needs to be executed for each VCenter in either the first mode or the second mode, so that the workload is extremely high.
Secondly, the two modes cannot provide a unified and visual operation interface for operation and maintenance personnel. Operation and maintenance operators need to log in each VCenter to operate, so that the efficiency is low, and misoperation is easy to occur due to confusion.
Finally, business logic is ignored, and complex template version control and query cannot be realized. Because the two modes cannot effectively record relevant information of each template change, such as change content, change level, change date and the like, complex operations of VCenter template state inquiry, template rollback to a formulated version and the like cannot be effectively realized.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a virtual machine template data processing method and device, which can effectively ensure the correctness and consistency of templates on a plurality of virtualization management platforms and reduce the operation and maintenance cost.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a virtual machine template data processing method, including:
receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request;
and executing corresponding editing processing on the virtual machine template, and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform.
Further, the executing the corresponding editing process on the virtual machine template includes:
performing authority verification on the virtual machine template editing request;
if the result of the authority verification is passing, creating a corresponding editing task, modifying the task state of the editing task into a first state, sequentially executing corresponding editing processing on the editing task with the task state being the first state through a message queue, simultaneously modifying the task state of the editing task into a second state, and otherwise, judging that the result of the authority verification of the virtual machine editing request is failed.
Further, the synchronizing the virtual machine template after the editing process to the corresponding virtual machine management platform includes:
establishing session connection of a virtual machine management platform corresponding to the virtual machine editing request, and receiving a corresponding simulator;
judging whether the virtual machine template passes through the virtual machine management platform or not, if yes, cloning the virtual machine template after editing processing and synchronizing the virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task into a third state, otherwise, directly modifying the task state of the editing task into the third state.
Further, the method further comprises the following steps:
and synchronizing a preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
In a second aspect, the present application provides a virtual machine template data processing apparatus, including:
the virtual machine template determining module is used for receiving a virtual machine template editing request and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request;
and the virtual machine template editing and synchronizing module is used for executing corresponding editing processing on the virtual machine template and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform.
Further, the virtual machine template editing synchronization module includes:
the authority verification unit is used for performing authority verification on the virtual machine template editing request;
and the editing processing unit is used for creating a corresponding editing task and modifying the task state of the editing task into a first state if the result of the authority verification is passed, sequentially executing corresponding editing processing on the editing task with the task state of the first state through a message queue and simultaneously modifying the task state of the editing task into a second state, otherwise, judging that the authority verification result of the virtual machine editing request is failed.
Further, the virtual machine template editing synchronization module includes:
the connection admission unit is used for establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request and admitting a corresponding simulator;
and the template synchronization unit is used for judging whether the virtual machine template passes through the virtual machine management platform, if yes, cloning the virtual machine template after editing processing and synchronizing the virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task into a third state, otherwise, directly modifying the task state of the editing task into the third state.
Further, the method further comprises the following steps:
and the platform-to-template machine synchronizing unit is used for synchronizing a preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the virtual machine template data processing method when the program is executed.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the virtual machine template data processing method.
According to the technical scheme, after receiving a virtual machine template editing request, the virtual machine template data processing method and device determine a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request, execute corresponding editing processing on the virtual machine template, and then synchronize the virtual machine template after the editing processing to a corresponding virtual machine management platform.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a virtual machine template data processing method according to an embodiment of the present application;
FIG. 2 is a second flow chart of a virtual machine template data processing method according to an embodiment of the present application;
FIG. 3 is a third flow chart of a virtual machine template data processing method according to an embodiment of the present application;
FIG. 4 is one of the block diagrams of the virtual machine template data processing apparatus in the embodiment of the present application;
FIG. 5 is a second block diagram of a virtual machine template data processing apparatus according to an embodiment of the present application;
FIG. 6 is a third block diagram of a virtual machine template data processing apparatus according to an embodiment of the present application;
FIG. 7 is a flowchart of a method for processing virtual machine template data according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Considering that when a plurality of vcenters exist in the prior art, all templates need to be configured for each VCenter, for a large enterprise, due to long cloud environment construction time span and large resource scale, a plurality of VCenter clusters often exist in private cloud, the VCenter versions and the Esxi versions of the clusters, the virtual machine versions and compatibility to an operating system are different, a complex heterogeneous private cloud environment is finally formed, so that the correctness and consistency of the templates are difficult to guarantee, and the operation and maintenance cost is high.
In order to effectively ensure the correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the application provides an embodiment of a virtual machine template data processing method, referring to fig. 1, wherein the virtual machine template data processing method specifically comprises the following contents:
step S101: and receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request.
It is understood that vmwire, as described herein below, refers to: desktop-to-data center virtualization solution providers. Through the VCenter, esxi, vsphere and other products provided by the cloud platform, an enterprise-level cloud environment based on a virtualization technical scheme can be deployed and realized.
It is to be understood that the following virtual machine templates (which may also be simply referred to as templates) refer to: through virtualization technology, multiple virtual machines independent of each other can be created on one physical machine. In a cloud environment based on VMWARE implementation, a user can quickly deploy a virtual machine by copying templates, rather than installing and configuring each time through the installation medium of the operating system. The new virtual machine has virtual hardware configured for the template, installed software, and other attributes.
It is understood that VPSHERE SDK described below in this application refers to: the Vsphere-oriented software development kit provided by vmwire corporation through which various virtualized resources of VCenter/Vsphere can be accessed and operated.
It is understood that the following Django refers to: a Web application framework of open source code is written by Python. The framework modes of MTV, namely model M, view V and template T, are employed. The main purpose is to develop a database driven website simply and quickly, emphasizing code reuse, multiple components can conveniently serve the whole framework in a 'plug-in' form.
It is understood that VUE described below in this application refers to: a set of progressive frameworks for constructing user interfaces. Unlike other large frameworks, vue is designed to be applied layer by layer from bottom up. The core library of Vue only focuses on the view layer, not only is easy to handle, but also is convenient to integrate with third party libraries or existing projects. On the other hand, vue is also fully capable of providing drivers for complex single page applications when used in conjunction with modern toolchains and various supporting class libraries.
Optionally, the application firstly receives a virtual machine template editing request (for example, a template changing request specifically) sent by the front end, creates a changing record and stores the changing record in a database, and calls the bottom layer realization function module through a message queue to finish implementation.
Optionally, the bottom layer implementing functional module of the application can implement functions of VCenter nanotube/removing physical machine, virtual machine/template renaming, virtual machine cloning, virtual machine conversion into template and the like based on the vpshare SDK specification, and the template migration operation between the VCenter and the template machine is implemented through the combination of the functions.
It will be appreciated that the template machine may be a physical machine on which the ESXI operating system is installed, with all template-generated virtual machines on it, named template names plus the SWAP suffix end. After the user can modify the virtual machine on the server, the user can synchronize to other VCents, and can copy other VCents upper templates to the template machine.
Optionally, according to the virtual machine template editing request, a corresponding virtual machine template may be determined from the preset template machine.
Step S102: and executing corresponding editing processing on the virtual machine template, and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform.
Alternatively, considering that the operation of templates in the underlying implementation tends to be slow, the present application avoids front-end pages waiting continuously by introducing message queues for front-end and back-end component decoupling.
As can be seen from the foregoing description, according to the virtual machine template data processing method provided by the embodiment of the present application, after receiving a virtual machine template editing request, according to the virtual machine template editing request, a corresponding virtual machine template is determined from a preset template machine, and corresponding editing processing is performed on the virtual machine template, and then the virtual machine template after the editing processing is synchronized to a corresponding virtual machine management platform.
In order to ensure that the editing process is legal and can be performed sequentially, in an embodiment of the virtual machine template data processing method of the present application, referring to fig. 2, the following may be further specifically included:
step S201: and carrying out authority verification on the virtual machine template editing request.
Step S202: if the result of the authority verification is passing, creating a corresponding editing task, modifying the task state of the editing task into a first state, sequentially executing corresponding editing processing on the editing task with the task state being the first state through a message queue, simultaneously modifying the task state of the editing task into a second state, and otherwise, judging that the result of the authority verification of the virtual machine editing request is failed.
Alternatively, the process of importing a specified template from the template machine to a certain VCenter can be decomposed into two relatively independent phases due to the fact that the message queues are introduced to realize front-to-back decoupling.
Specifically, the first stage flow may be: the user selects the template name and VCenter to be imported in the front page, submits import task, after receiving front data, the business processing layer passes the authority check, if the check is not passed, the process is ended, otherwise, the task information is stored in the database, and the task state is set as the first state which is created. And then notifying the bottom realization layer to implement the task through the message queue, and setting the task state in the database as the second state in the queue after the successful sending.
In order to ensure that templates after editing processing can be sequentially synchronized, in an embodiment of the virtual machine template data processing method of the present application, referring to fig. 3, the method may further specifically include the following:
step S301: and establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request, and receiving a corresponding simulator.
Step S302: judging whether the virtual machine template passes through the virtual machine management platform or not, if yes, cloning the virtual machine template after editing processing and synchronizing the virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task into a third state, otherwise, directly modifying the task state of the editing task into the third state.
Optionally, the listening process of the message queue receives the task ID in the queue, obtains task information from the database, and sets the task status to "in execution". Establishing session connection to a designated VCenter, calling a nanotube physical machine function to nanotube the template machine, after the nanotube is successful, searching whether a virtual machine named as template name SWAP exists on the template machine, if so, further searching whether a target template exists on the VCenter, if so, calling a template renaming method to modify the name of the virtual machine into the form of template name SWAP, then calling a virtual machine cloning function to clone the virtual machine named as template name on the template machine, after the cloning is successful, calling the virtual machine to be converted into the template method to be marked as the template, and finally updating the task state in the database to be the third state.
In order to achieve the reverse synchronization of the virtual machine templates, that is, the virtual machine templates of the virtual machine management platform are reversely synchronized to the template machine, in an embodiment of the virtual machine template data processing method of the present application, the following may be further specifically included:
and synchronizing a preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
Alternatively, the template-to-template operation flow from VCenter may be broken down into two relatively independent phases, similar to the import of a specified template from a template to a VCenter operation.
Specifically, the first stage flow may be: the user selects the template name and VCenter from which the template is to be exported on the front page, and submits the task data. After receiving the front-end data, the business processing layer creates a template task, stores the template task into a database, and informs the bottom realization layer of implementing the task through a message queue.
The second stage is specifically that the monitoring process of the message queue receives the task ID in the queue, acquires task information from the database, and sets the task state as "executing". And establishing session connection to a designated VCenter, calling a nanotube physical machine function to nanotube the template machine, searching whether a virtual machine named as template name SWAP exists on the template machine after the nanotube is successful, calling a virtual machine renaming method to modify the name of the virtual machine into the form of template name SWAP date if the virtual machine is successful, then calling a virtual machine cloning function to clone a template named as template name SWAP as the virtual machine named as template name SWtemplate name, calling the virtual machine to convert the virtual machine into a template method to mark the template after the template name SWAP is successful, and finally updating the task state in a database.
In order to effectively ensure the correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the application provides an embodiment of a virtual machine template data processing device for implementing all or part of contents of the virtual machine template data processing method, see fig. 4, where the virtual machine template data processing device specifically includes the following contents:
the virtual machine template determining module 10 is configured to receive a virtual machine template editing request, and determine a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request.
The virtual machine template editing and synchronizing module 20 is configured to execute corresponding editing processing on the virtual machine template, and synchronize the virtual machine template after the editing processing to a corresponding virtual machine management platform.
As can be seen from the foregoing description, the virtual machine template data processing apparatus provided in the embodiments of the present application is capable of determining, by receiving a virtual machine template editing request, a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request, performing a corresponding editing process on the virtual machine template, and then synchronizing the virtual machine template after the editing process to a corresponding virtual machine management platform.
In order to ensure that the editing process is legal and can be sequentially performed, in an embodiment of the virtual machine template data processing apparatus of the present application, referring to fig. 5, the virtual machine template editing synchronization module 20 includes:
and the authority verification unit 21 is used for performing authority verification on the virtual machine template editing request.
And the editing processing unit 22 is configured to create a corresponding editing task if the result of the permission verification is passed, modify the task state of the editing task to be a first state, sequentially execute corresponding editing processing on the editing task whose task state is the first state through a message queue, and simultaneously modify the task state of the editing task to be a second state, otherwise determine that the result of the permission verification of the virtual machine editing request is failed.
In order to ensure that the templates after editing process can be sequentially synchronized, in an embodiment of the virtual machine template data processing apparatus of the present application, referring to fig. 6, the virtual machine template editing synchronization module 20 includes:
and the connection admission unit 23 is used for establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request and admitting the corresponding simulator.
And the template synchronization unit 24 is configured to determine whether the virtual machine template passes through the virtual machine management platform, if yes, clone the edited virtual machine template and synchronize the virtual machine template to the virtual machine management platform, then modify the task state of the editing task into a third state, and otherwise directly modify the task state of the editing task into the third state.
In order to achieve the reverse synchronization of the virtual machine templates, that is, the virtual machine templates of the virtual machine management platform are reversely synchronized to the template machine, in an embodiment of the virtual machine template data processing apparatus of the present application, the method further specifically includes the following:
and the platform-to-template machine synchronizing unit is used for synchronizing a preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
In order to further explain the scheme, the application also provides a specific application example for implementing the virtual machine template data processing method by applying the virtual machine template data processing device, which specifically comprises the following contents:
referring to fig. 7, the front-end presentation layer is implemented based on VUE technology, and provides a template import export operation interface, an execution result and an execution history query interface for a user. The front-end task creation page uses the VUE technology, and the main element of the page is a form, comprising a VCenter drop-down frame, a template name drop-down frame, an operation type drop-down frame, a remark information input frame and a submit button. After filling in the information, the data can be transmitted to the business processing layer component by clicking the submit button, thereby realizing task creation.
The display page mainly comprises a template task information list, wherein the list comprises task time, related VCenter, related template name, operation type, creation time, creator and the like.
The business logic layer is realized based on Python/Django technology, receives a template change request sent by the front end, creates a change record and stores the change record in a database, and invokes a bottom realization function module through a message queue to finish implementation.
The bottom layer realization layer realizes functions of VCenter nanotube/removing physical machine, virtual machine/template renaming, virtual machine cloning, virtual machine converting into template and the like based on the Vshare SDK specification, and realizes template migration operation between the VCenter and the template machine through the combination of the functions. The template machine is here a physical machine with the ESXI operating system installed, with all template-generated virtual machines on it, named template name plus SWAP suffix end. After the user can modify the virtual machine on the server, the user can synchronize to other VCents, and can copy other VCents upper templates to the template machine.
Considering that the operation of templates in the bottom implementation is often slow, a message queue is introduced for decoupling of front-end and back-end components, so that the front-end pages are prevented from waiting continuously.
Because the message queue is introduced to realize front-back decoupling, the operation flow from the template machine to a certain VCenter by importing a specified template can be decomposed into two relatively independent stages.
Specifically, the first stage flow may be: the user selects the template name and VCenter to be imported in the front page, submits import task, the business processing layer receives the front data, passes the authority check, if the verification is not passed, the process is ended, otherwise, the task information is stored in the database, and the task state is set as 'created'. And then informing the bottom realization layer to implement the task through the message queue, and setting the task state in the database as 'in the queue' after the successful sending.
The second stage flow is specifically as follows: the monitoring process of the message queue receives the task ID in the queue, acquires task information from the database, and sets the task state as 'executing'. Establishing session connection to a designated VCenter, calling a nanotube physical machine function to nanotube the template machine, after the nanotube is successful, searching whether a virtual machine named as template name SWAP exists on the template machine, if so, further searching whether a target template exists on the VCenter, if so, calling a template renaming method to modify the name of the virtual machine into the form of template name SWAP, then calling a virtual machine cloning function to clone the virtual machine named as template name on the template machine, after the cloning is successful, calling the virtual machine to be converted into the template method to be marked as the template, and finally updating the task state in the database to be completed.
Similar to importing a specified template from a template machine to a VCenter operation, the template-to-template machine operational flow from VCenter may also be broken down into two relatively independent phases.
Specifically, the first stage flow may be: the user selects the template name and VCenter from which the template is to be exported on the front page, and submits the task data. After receiving the front-end data, the business processing layer creates a template task, stores the template task into a database, and informs the bottom realization layer of implementing the task through a message queue.
The second stage is specifically that the monitoring process of the message queue receives the task ID in the queue, acquires task information from the database, and sets the task state as "executing". And establishing session connection to a designated VCenter, calling a nanotube physical machine function to nanotube the template machine, searching whether a virtual machine named as template name SWAP exists on the template machine after the nanotube is successful, calling a virtual machine renaming method to modify the name of the virtual machine into the form of template name SWAP date if the virtual machine is successful, then calling a virtual machine cloning function to clone a template named as template name SWAP as the virtual machine named as template name SWtemplate name, calling the virtual machine to convert the virtual machine into a template method to mark the template after the template name SWAP is successful, and finally updating the task state in a database.
From the above, the present application can at least achieve the following technical effects:
1. the design realizes a complete template management flow, and realizes traceability and visualization of template operation based on template tasks.
2. A template machine is introduced as an intermediary for template modification and synchronization.
3. Based on the VlphereSDK specification, operations such as physical machine nanotube, virtual machine cloning, virtual machine renaming and the like are realized through Python codes, and automatic implementation of template operation is realized.
In order to effectively ensure the correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the application provides an embodiment of an electronic device for implementing all or part of contents in a data processing method of a virtual machine template, wherein the electronic device specifically comprises the following contents:
a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the virtual machine template data processing device and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may refer to an embodiment of the virtual machine template data processing method and an embodiment of the virtual machine template data processing apparatus in the embodiments, and the contents thereof are incorporated herein, and are not repeated here.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the virtual machine template data processing method may be executed on the electronic device side as described above, or all operations may be completed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The present application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 of an embodiment of the present application. As shown in fig. 8, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 8 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the virtual machine template data processing method functionality may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
step S101: and receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request.
Step S102: and executing corresponding editing processing on the virtual machine template, and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform.
As can be seen from the foregoing description, after receiving a virtual machine template editing request, the electronic device provided in the embodiment of the present application determines a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request, performs a corresponding editing process on the virtual machine template, and synchronizes the virtual machine template after the editing process to a corresponding virtual machine management platform.
In another embodiment, the virtual machine template data processing apparatus may be configured separately from the central processor 9100, for example, the virtual machine template data processing apparatus may be configured as a chip connected to the central processor 9100, and the virtual machine template data processing method functions are implemented by control of the central processor.
As shown in fig. 8, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 8; in addition, the electronic device 9600 may further include components not shown in fig. 8, and reference may be made to the related art.
As shown in fig. 8, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application further provide a computer readable storage medium capable of implementing all the steps in the virtual machine template data processing method in which the execution subject in the above embodiments is a server or a client, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the virtual machine template data processing method in which the execution subject in the above embodiments is a server or a client, for example, the processor implements the following steps when executing the computer program:
Step S101: and receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request.
Step S102: and executing corresponding editing processing on the virtual machine template, and synchronizing the virtual machine template after the editing processing to a corresponding virtual machine management platform.
As can be seen from the foregoing description, after receiving a virtual machine template editing request, the computer readable storage medium provided in the embodiments of the present application determines a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request, performs a corresponding editing process on the virtual machine template, and synchronizes the virtual machine template after the editing process to a corresponding virtual machine management platform.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (4)

1. A method for processing virtual machine template data, the method comprising:
receiving a virtual machine template editing request, and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request;
performing authority verification on the virtual machine template editing request; if the result of the authority verification is passed, creating a corresponding editing task, modifying the task state of the editing task into a first state, calling an underlying implementation function module to sequentially execute corresponding editing processing on the editing task with the task state being the first state through a message queue, and simultaneously modifying the task state of the editing task into a second state, otherwise, judging that the authority verification result of the virtual machine template editing request is failed; the template machine is specifically a physical machine, and virtual machines generated by all templates are arranged on the template machine and named as template names plus SWAP suffix ends; the bottom layer realization function module realizes functions of managing platform nanotube/removing physical machine, virtual machine/template renaming, virtual machine cloning and virtual machine converting into template based on Vvphree SDK specification, and realizes virtual machine template migration operation between the virtual machine managing platform and the template machine through the combination of the functions;
Establishing session connection of a virtual machine management platform corresponding to the virtual machine template editing request, and calling a template machine corresponding to a nano tube physical machine function nano tube of a bottom layer realization function module; after the nano tube is successful, whether a template name of a virtual machine template corresponding to the virtual machine template editing request is added to the template name of the virtual machine template corresponding to the SWAP suffix end virtual machine exists in the virtual machine management platform or not is searched, if yes, a template renaming function of a bottom layer realization function module is called to modify the name of the template renaming function into the template name added to the form of date suffix end, then a virtual machine cloning function of the bottom layer realization function module is called, the template name of the virtual machine template corresponding to the virtual machine template editing request is added to the template name of the virtual machine template corresponding to the SWAP suffix end virtual machine is cloned to the virtual machine name of the virtual machine template corresponding to the SWAP suffix end virtual machine template editing request and is synchronized to the virtual machine management platform, after cloning is successful, the virtual machine of the bottom layer realization function module is called to be converted into the template function to mark the virtual machine which is cloned and synchronized in the virtual machine management platform as the template, and then the task state of the editing task is modified into the third state, otherwise, the task state of the task is modified into the third state;
Synchronizing a preset virtual machine template of a virtual machine management platform to a template machine according to the virtual machine template editing request; the operation flow of the virtual machine template from the virtual machine management platform to the template machine is divided into two relatively independent stages; the first stage flow is as follows: the user selects the template name and the virtual machine management platform from which the template is to be exported on the front page, submits task data, the service processing layer creates a template task to store in a database after receiving the front data, and informs the bottom layer to realize the function module to implement the task through a message queue; the second stage flow is as follows: the monitoring process of the message queue receives the task ID in the queue, acquires task information from the database, sets the task state as executing, establishes session connection to a designated virtual machine management platform, calls a nano-tube physical machine function to nano-tube the template machine, searches whether a virtual machine with the name of the template selected by a user at a front end page is added with a SWAP suffix end on the template machine after the nano-tube is successful, calls a virtual machine renaming method to modify the name of the virtual machine into the form of the template name selected by the user at the front end page and the SWAP date suffix end if the virtual machine is added with the template name, then calls a virtual machine cloning function to clone a virtual machine template with the name of the template name selected by the user at the front end page into the virtual machine with the name of the template name selected by the user at the front end page and the SWAP suffix end, calls the virtual machine to mark the virtual machine as the template after the cloning is successful, and finally updates the task state in the database.
2. A virtual machine template data processing apparatus, comprising:
the virtual machine template determining module is used for receiving a virtual machine template editing request and determining a corresponding virtual machine template from a preset template machine according to the virtual machine template editing request;
the virtual machine template editing and synchronizing module is used for:
performing authority verification on the virtual machine template editing request; if the result of the authority verification is passed, creating a corresponding editing task, modifying the task state of the editing task into a first state, calling an underlying implementation function module to sequentially execute corresponding editing processing on the editing task with the task state being the first state through a message queue, and simultaneously modifying the task state of the editing task into a second state, otherwise, judging that the authority verification result of the virtual machine template editing request is failed; the template machine is specifically a physical machine, and virtual machines generated by all templates are arranged on the template machine and named as template names plus SWAP suffix ends; the bottom layer realization function module realizes functions of managing platform nanotube/removing physical machine, virtual machine/template renaming, virtual machine cloning and virtual machine converting into template based on Vvphree SDK specification, and realizes virtual machine template migration operation between the virtual machine managing platform and the template machine through the combination of the functions;
Establishing session connection of a virtual machine management platform corresponding to the virtual machine template editing request, and calling a template machine corresponding to a nano tube physical machine function nano tube of a bottom layer realization function module; after the nano tube is successful, whether a template name of a virtual machine template corresponding to the virtual machine template editing request is added to the template name of the virtual machine template corresponding to the SWAP suffix end virtual machine exists in the virtual machine management platform or not is searched, if yes, a template renaming function of a bottom layer realization function module is called to modify the name of the template renaming function into the template name added to the form of date suffix end, then a virtual machine cloning function of the bottom layer realization function module is called, the template name of the virtual machine template corresponding to the virtual machine template editing request is added to the template name of the virtual machine template corresponding to the SWAP suffix end virtual machine is cloned to the virtual machine name of the virtual machine template corresponding to the SWAP suffix end virtual machine template editing request and is synchronized to the virtual machine management platform, after cloning is successful, the virtual machine of the bottom layer realization function module is called to be converted into the template function to mark the virtual machine which is cloned and synchronized in the virtual machine management platform as the template, and then the task state of the editing task is modified into the third state, otherwise, the task state of the task is modified into the third state;
The platform-to-template machine synchronizing unit is used for synchronizing a preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request; the operation flow of the virtual machine template from the virtual machine management platform to the template machine is divided into two relatively independent stages; the first stage flow is as follows: the user selects the template name and the virtual machine management platform from which the template is to be exported on the front page, submits task data, the service processing layer creates a template task to store in a database after receiving the front data, and informs the bottom layer to realize the function module to implement the task through a message queue; the second stage flow is as follows: the monitoring process of the message queue receives the task ID in the queue, acquires task information from the database, sets the task state as executing, establishes session connection to a designated virtual machine management platform, calls a nano-tube physical machine function to nano-tube the template machine, searches whether a virtual machine with the name of the template selected by a user at a front end page is added with a SWAP suffix end on the template machine after the nano-tube is successful, calls a virtual machine renaming method to modify the name of the virtual machine into the form of the template name selected by the user at the front end page and the SWAP date suffix end if the virtual machine is added with the template name, then calls a virtual machine cloning function to clone a virtual machine template with the name of the template name selected by the user at the front end page into the virtual machine with the name of the template name selected by the user at the front end page and the SWAP suffix end, calls the virtual machine to mark the virtual machine as the template after the cloning is successful, and finally updates the task state in the database.
3. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the virtual machine template data processing method of claim 1 when the program is executed by the processor.
4. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the virtual machine template data processing method of claim 1.
CN202010194717.XA 2020-03-19 2020-03-19 Virtual machine template data processing method and device Active CN111414232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010194717.XA CN111414232B (en) 2020-03-19 2020-03-19 Virtual machine template data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010194717.XA CN111414232B (en) 2020-03-19 2020-03-19 Virtual machine template data processing method and device

Publications (2)

Publication Number Publication Date
CN111414232A CN111414232A (en) 2020-07-14
CN111414232B true CN111414232B (en) 2024-01-19

Family

ID=71491179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010194717.XA Active CN111414232B (en) 2020-03-19 2020-03-19 Virtual machine template data processing method and device

Country Status (1)

Country Link
CN (1) CN111414232B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216777A (en) * 2008-01-11 2008-07-09 华中科技大学 Rapid deployment system under multi-dummy machine environment
CN104144173A (en) * 2013-05-06 2014-11-12 上海宏第网络科技有限公司 Campus cloud platform system and method based on distributed virtual service technology
CN105740047A (en) * 2016-01-26 2016-07-06 中标软件有限公司 Cloud computing based virtual machine template management system and method
CN106874062A (en) * 2015-12-11 2017-06-20 三亚中兴软件有限责任公司 A kind of virtual machine update method and device
CN107040416A (en) * 2017-04-12 2017-08-11 大连理工大学 A kind of virtual data center visual management method based on Cairngorm frameworks
CN107193635A (en) * 2017-05-24 2017-09-22 珠海金山网络游戏科技有限公司 A kind of method for realizing virtualization content library, apparatus and system
CN109725985A (en) * 2018-12-28 2019-05-07 云宏信息科技股份有限公司 The management method and device of virtual machine template

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298482B2 (en) * 2011-12-12 2016-03-29 International Business Machines Corporation Plug-in based templatization framework for automating the creation of open virtualization format virtual appliances

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216777A (en) * 2008-01-11 2008-07-09 华中科技大学 Rapid deployment system under multi-dummy machine environment
CN104144173A (en) * 2013-05-06 2014-11-12 上海宏第网络科技有限公司 Campus cloud platform system and method based on distributed virtual service technology
CN106874062A (en) * 2015-12-11 2017-06-20 三亚中兴软件有限责任公司 A kind of virtual machine update method and device
CN105740047A (en) * 2016-01-26 2016-07-06 中标软件有限公司 Cloud computing based virtual machine template management system and method
CN107040416A (en) * 2017-04-12 2017-08-11 大连理工大学 A kind of virtual data center visual management method based on Cairngorm frameworks
CN107193635A (en) * 2017-05-24 2017-09-22 珠海金山网络游戏科技有限公司 A kind of method for realizing virtualization content library, apparatus and system
CN109725985A (en) * 2018-12-28 2019-05-07 云宏信息科技股份有限公司 The management method and device of virtual machine template

Also Published As

Publication number Publication date
CN111414232A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
CN108961033B (en) Multi-service system interaction method and device, storage medium and electronic terminal
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
CN111352653B (en) System development method based on PaaS cloud platform server and server
CN111796838B (en) Automatic deployment method and device for MPP database
CN103077034B (en) hybrid virtualization platform JAVA application migration method and system
KR101086620B1 (en) Smart office system and server for managing the sames and method for managing the sames
JP2021197153A (en) Method and apparatus for recognizing word slot, electronic apparatus, storage medium and computer program
CN111459539A (en) Continuous integration pipeline operation method and device based on mirror layering
CN114911518A (en) Cloud function application release management method, system, equipment and storage medium
WO2016078326A1 (en) Method, apparatus and system for displaying names of virtual machine
CN113656005A (en) Application component library construction method, application component configuration method and related device
CN113204425A (en) Method and device for process management internal thread, electronic equipment and storage medium
CN110807535A (en) Construction method and construction device of unified reservation platform and unified reservation platform system
TWI571747B (en) Data interchange system
CN112579048B (en) Applet integration method, device, electronic equipment and storage medium
CN111414232B (en) Virtual machine template data processing method and device
CN110019059B (en) Timing synchronization method and device
CN110599112A (en) Method and device for developing and maintaining network page
CN114637531A (en) Method and device for dynamically generating application program interface
CN110427260B (en) Host job scheduling method, device and system
Cheng et al. Hadoop environment management App based on mobile cloud computing
CN112463212B (en) Environment building method and device supporting cross-system platform
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN110554906A (en) virtual machine configuration management method and device
CN113641343B (en) High-concurrency python algorithm calling method and medium based on environment isolation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220922

Address after: 12 / F, 15 / F, 99 Yincheng Road, Pudong New Area pilot Free Trade Zone, Shanghai, 200120

Applicant after: Jianxin Financial Science and Technology Co.,Ltd.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant