CN111414232A - Method and device for processing template data of virtual machine - Google Patents

Method and device for processing template data of virtual machine Download PDF

Info

Publication number
CN111414232A
CN111414232A CN202010194717.XA CN202010194717A CN111414232A CN 111414232 A CN111414232 A CN 111414232A CN 202010194717 A CN202010194717 A CN 202010194717A CN 111414232 A CN111414232 A CN 111414232A
Authority
CN
China
Prior art keywords
virtual machine
template
editing
task
state
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.)
Granted
Application number
CN202010194717.XA
Other languages
Chinese (zh)
Other versions
CN111414232B (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
China Construction Bank Corp
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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
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

Images

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 method and a device for processing template data of a virtual machine, 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 subjected to 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 the multiple virtualization management platforms, and reduce the operation and maintenance cost.

Description

Method and device for processing template data of virtual machine
Technical Field
The application relates to the field of data processing, in particular to a method and a device for processing template data of a virtual machine.
Background
Currently, cloud environments mainly have two implementation routes: virtualization and containerization. Virtualization is a resource management technology, which is mainly used for pooling physical resources including servers, CPUs, memories, networks, storages and the like, and further dynamically and flexibly allocating the physical resources to users. Through virtualization technology, a plurality of mutually independent virtual machines can be created on one physical machine, and different operating systems are allowed to be installed in the virtual machines to configure different network IP addresses. Currently, enterprises typically deploy virtualized private clouds based on Vmware (desktop-to-datacenter virtualized cloud environment), Citrix, KVM, and like technologies.
In a virtualized cloud environment implemented based on Vmware, a user can make a common operating system and software into a template, and quickly deploy a new virtual machine through the operation of copying the template when necessary. However, this deployment operation requires that the template and the new virtual machine must be in the same VCenter (virtualization management platform). Therefore, if there are multiple VCenter, all templates need to be configured for each VCenter. For a large enterprise, due to the long time span of cloud environment construction and the large resource scale, a plurality of VCenter clusters often exist in a private cloud, and the VCenter versions and the Esxi versions of the clusters, the virtual machine versions and the compatibility with an operating system are different, so that a complex heterogeneous private cloud environment is finally formed. When the templates are added, deleted, modified, and returned, etc., it is a very challenging problem how to ensure the correctness and consistency of the VCenter templates and avoid too much repetitive labor of operation and maintenance personnel.
Currently, the industry relates to template-related management, and there is no complete and systematic template management platform, and generally, an operation and maintenance person sequentially goes to each VCenter to modify a template or uses an OVF as an intermediary to realize template synchronization. Specifically, the second method is to export the modified template on a certain VCenter into an OVF file, then import the modified template to other VCenter by deploying OVF operation, and finally convert the virtual machine created by importing into the template.
Operation and maintenance personnel sequentially modify the templates in each VCenter, or realize template synchronization by using OVF as an intermediary cannot effectively realize automation, visualization, traceability and rollback, and the following defects inevitably occur in a large-scale cloud environment:
firstly, when the number of VCenter clusters is large, the operation and maintenance personnel are completely relied on for manual operation, the efficiency is low, and the accuracy of the operation is difficult to ensure. For example, when one template involves multiple operations, the first way to modify the templates on each VCenter separately is likely to cause inconsistent operations. For template change, if a problem is found in a period of time later, repair or rollback is needed, and whether the first mode or the second mode is needed, a synchronization operation needs to be performed on each VCenter, so that the workload involved is extremely large.
Secondly, the two modes cannot provide a uniform and visual operation interface for operation and maintenance personnel. Operation and maintenance operators need to log in each VCenter to operate, efficiency is low, confusion is easy to occur, and misoperation is caused.
Finally, the business logic is ignored, and complicated template version control and query cannot be realized. Because the two modes cannot effectively record the relevant information of each template change, such as the change content, the change level, the change date and the like, complex operations of querying the state of the VCenter template, rolling back the template to the formulated version and the like cannot be effectively realized.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a method and a device for processing template data of a virtual machine, 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 method for processing template data of a virtual machine, 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 edited virtual machine template 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;
and if the permission verification result is passed, creating a corresponding editing task, modifying the task state of the editing task to be a first state, sequentially executing 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 to be a second state, otherwise, judging that the permission verification result of the virtual machine editing request is failed.
Further, the synchronizing the edited virtual machine template 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 managing a corresponding analog machine;
and judging whether the virtual machine template exists in the virtual machine management platform, if so, cloning the edited virtual machine template and synchronizing the edited virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task to a third state, otherwise, directly modifying the task state of the editing task to the third state.
Further, still include:
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 edited virtual machine template to the 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 to be a first state if the permission verification result is passed, sequentially executing 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 to be a second state, otherwise, judging that the permission verification result of the virtual machine editing request is failed.
Further, the virtual machine template editing synchronization module includes:
the connection receiving unit is used for establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request and receiving and managing the corresponding analog machine;
and the template synchronization unit is used for judging whether the virtual machine template exists in the virtual machine management platform or not, if so, cloning the edited virtual machine template and synchronizing the edited virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task to a third state, otherwise, directly modifying the task state of the editing task to the third state.
Further, still include:
and the platform-to-template machine synchronization unit is used for synchronizing the 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, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the virtual machine template data processing method when executing the computer program.
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 described herein.
According to the technical scheme, after the virtual machine template editing request is received, the corresponding virtual machine template is determined from the preset template machine according to the virtual machine template editing request, the corresponding editing processing is executed on the virtual machine template, and then the edited virtual machine template is synchronized to the 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 needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for processing template data of a virtual machine according to an embodiment of the present disclosure;
FIG. 2 is a second flowchart illustrating a method for processing template data of a virtual machine according to an embodiment of the present application;
FIG. 3 is a third flowchart illustrating a method for processing template data of a virtual machine according to an embodiment of the present application;
fig. 4 is one of the structural 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 illustrating a method for processing template data of a virtual machine according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection 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-scale enterprise, due to long time span of cloud environment construction and large resource scale, a plurality of VCenter clusters often exist in a private cloud, and the VCenter versions, the Esxi versions, the virtual machine versions and the compatibility with an operating system of the clusters are different, and finally a complex heterogeneous private cloud environment is formed, so that the template correctness and consistency are difficult to guarantee, and the operation and maintenance cost is high, the application provides a method and a device for processing virtual machine template data, 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 is executed with corresponding editing processing, and then the edited virtual machine template is synchronized to a corresponding virtual machine management platform, according to the template management method and device, the template machine is introduced to serve as an intermediary for template modification and synchronization, a complete template management process is achieved, the template operation can be traced on the basis of a template editing task, the correctness and consistency of the templates on a plurality of virtualization management platforms are effectively guaranteed, and the operation and maintenance cost is reduced.
In order to effectively ensure correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the present application provides an embodiment of a virtual machine template data processing method, and referring to fig. 1, the virtual machine template data processing method specifically includes the following contents:
step S101: 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 the following VMWARE in this application refers to: desktop to data center virtualization solution providers. The enterprise-level cloud environment based on the virtualization technology scheme can be deployed and realized through products such as VCenter, Esxi and Vsphere provided by the system.
It should be understood that the following virtual machine templates (also referred to simply as templates) in the present application refer to: through virtualization technology, a plurality of mutually independent virtual machines can be created on one physical machine. In a cloud environment implemented based on the VMWARE, a user can rapidly deploy a virtual machine by copying a template, instead of installing and configuring the virtual machine through an installation medium of an operating system each time. The new virtual machine has virtual hardware, installed software, and other attributes configured for the template.
It is understood that the following VPSHERE SDK in the present application refers to: the Vsphere-oriented software development kit provided by VMWARE corporation, through which various virtualized resources of VCenter/Vsphere can be accessed and operated.
It is understood that the following Django in the present application refers to: and the Web application framework of the open source code is written by Python. The framework model of MTV, namely model M, view V and template T, is adopted. The main objective is to develop database-driven websites easily and quickly, emphasize code reuse, and multiple components can conveniently serve the entire framework in a 'plug-in' form.
It is understood that the following VUE in this application refers to: a progressive framework for constructing a user interface. Unlike other large frames, Vue is designed to be applied layer by layer from the bottom up. Vue, the core library only focuses on the viewing layer, not only is it easy to get on hand, but also it is easy 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 tool chains and various supporting class libraries.
Optionally, in the present application, a virtual machine template editing request (for example, specifically, a template change request) sent by a front end is received, a change record is created and stored in a database, and a bottom-layer implementation function module is called through a message queue to complete implementation.
Optionally, the bottom layer implementation function module of the present application may implement functions of hosting/removing a physical machine, renaming a virtual machine/template, cloning a virtual machine, converting a virtual machine into a template, and the like of a VCenter based on the Vpshere SDK specification, and implement a template migration operation between the VCenter and the template machine through a combination of these functions.
It will be appreciated that the template machine may be a physical machine on which the ESXI operating system is installed, a virtual machine with all template generation, named template name plus SWAP suffix end. After the user can modify the virtual machine on the server, the virtual machine is synchronized to other VCenters, and templates on other VCenters can be copied to the template machine.
Optionally, the corresponding virtual machine template may be determined from the 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 edited virtual machine template to a corresponding virtual machine management platform.
Optionally, considering that the operation of the template in the bottom-layer implementation is often slow, the application avoids the front-end page from continuously waiting by introducing a message queue for decoupling by the front-end component.
As can be seen from the above description, the method for processing template data of a virtual machine according to the embodiment of the present application can determine a corresponding virtual machine template from a preset template machine and perform corresponding editing processing on the virtual machine template according to a received virtual machine template editing request, and then synchronize the edited virtual machine template to a corresponding virtual machine management platform.
In order to ensure that the editing process is legal and can be sequentially executed, 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 performing authority verification on the virtual machine template editing request.
Step S202: and if the permission verification result is passed, creating a corresponding editing task, modifying the task state of the editing task to be a first state, sequentially executing 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 to be a second state, otherwise, judging that the permission verification result of the virtual machine editing request is failed.
Optionally, because the message queue is introduced to implement front-back decoupling, the operation flow from the template machine to the certain VCenter can be decomposed into two relatively independent stages.
Specifically, the first stage process may be: the user selects the template name and the VCenter to be imported on the front-end page, submits the import task, the business processing layer receives the front-end data and passes the authority verification, if the verification fails, the flow is ended, otherwise, the task information is stored in the database, and the task state is set as the first state 'created'. And then informing a bottom layer implementation layer to implement the task through the message queue, and setting the task state in the database to be in the second state 'queue' after the successful sending.
In order to ensure that the templates after the editing process can be sequentially synchronized, in an embodiment of the virtual machine template data processing method of the present application, referring to fig. 3, the following may be further included:
step S301: and establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request, and managing the corresponding simulation machine.
Step S302: and judging whether the virtual machine template exists in the virtual machine management platform, if so, cloning the edited virtual machine template and synchronizing the edited virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task to a third state, otherwise, directly modifying the task state of the editing task to the third state.
Optionally, the monitoring process of the message queue receives the task ID in the queue, obtains task information from the database, and sets the task state to "executing". Establishing session connection to a designated VCenter, calling a function of a physical host for hosting the template machine, after successful hosting, searching whether a virtual machine named as 'template name' 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 and date', then calling a virtual machine cloning function, calling the name of the template machine as 'template name', cloning the virtual machine named as 'template name' into the virtual machine named as 'template name', calling the virtual machine into the template method to mark the template method as the template after successful cloning, and finally updating the task state in the database to be the third state 'completed'.
In order to implement reverse synchronization of the virtual machine template, that is, the virtual machine template of the virtual machine management platform is 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, similar to importing a specific template from a templating machine to a certain VCenter operation, the process flow from VCenter to the templating machine can also be decomposed into two relatively independent stages.
Specifically, the first stage process may be: the user selects the template name and the 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 service processing layer creates a template task to be stored in a database and informs the bottom layer implementation layer to implement the task through a message queue.
The second stage process is that the monitoring process of the message queue receives the task ID in the queue, obtains the task information from the database, and sets the task state as 'executing'. Establishing session connection to a designated VCenter, calling a management physical machine function to manage a template machine, searching whether a virtual machine named as a template name and SWAP exists on the template machine after management is successful, calling a virtual machine renaming method to modify the name of the virtual machine into a form of the template name and the SWAP date if the virtual machine named as the template name exists, then calling a virtual machine cloning function, cloning the template named as the template name into the virtual machine named as the template name and the SWAP, calling the virtual machine to convert the template method into the template method to mark the template method as the template after cloning is successful, and finally updating the task state in the database.
In order to effectively ensure correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the present application provides an embodiment of a virtual machine template data processing apparatus for implementing all or part of contents of the virtual machine template data processing method, and referring to fig. 4, the virtual machine template data processing apparatus 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.
And the virtual machine template editing and synchronizing module 20 is configured to perform corresponding editing processing on the virtual machine template, and synchronize the edited virtual machine template to a corresponding virtual machine management platform.
As can be seen from the above description, the virtual machine template data processing apparatus provided in the embodiment of the present application can determine a corresponding virtual machine template from a preset template machine and perform corresponding editing processing on the virtual machine template according to a virtual machine template editing request after receiving the virtual machine template editing request, and then synchronize the edited virtual machine template to a corresponding virtual machine management platform.
In order to ensure that the editing process is legal and can be executed sequentially, 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 checking unit 21 is configured to perform authority checking on the virtual machine template editing request.
And the editing processing unit 22 is configured to create a corresponding editing task and modify the task state of the editing task to be the first state if the result of the permission check is that the permission check is passed, sequentially execute corresponding editing processing on the editing tasks with the task state being the first state through a message queue, and modify the task state of the editing tasks to be the second state at the same time, otherwise, determine that the result of the permission check of the virtual machine editing request is a failure.
In order to ensure that the templates after the 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 configured to establish session connection with the virtual machine management platform corresponding to the virtual machine editing request, and admit the corresponding analog machine.
And the template synchronization unit 24 is configured to determine whether the virtual machine template exists in the virtual machine management platform, clone the edited virtual machine template and synchronize the edited virtual machine template to the virtual machine management platform if the virtual machine template exists in the virtual machine management platform, modify the task state of the editing task to a third state, and otherwise directly modify the task state of the editing task to the third state.
In order to achieve the reverse synchronization of the virtual machine template, that is, the virtual machine template of the virtual machine management platform is reversely synchronized to the template machine, in an embodiment of the virtual machine template data processing apparatus of the present application, the following contents are further specifically included:
and the platform-to-template machine synchronization unit is used for synchronizing the preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
To further illustrate the present solution, the present application further provides a specific application example of implementing the method for processing the template data of the virtual machine by using the above apparatus for processing the template data of the virtual machine, which specifically includes 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 VUE technology, and the main elements of the page are a form which comprises a VCenter drop-down box, a template name drop-down box, an operation type drop-down box, a remark information input box and a submit button. After information is filled in, the data can be transmitted to the service processing layer component by clicking the submit button, and task creation is realized.
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 a front end, creates a change record and stores the change record in a database, and calls a bottom layer realization function module through a message queue to complete implementation.
The bottom layer implementation layer is based on the Vpshere SDK specification, functions of managing/removing a physical machine, renaming a virtual machine/template, cloning a virtual machine, converting the virtual machine into the template and the like of the VCenter are achieved, and template migration operation between the VCenter and the template machine is achieved through combination of the functions. The template machine here is the physical machine on which the ESXI operating system is 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 virtual machine is synchronized to other VCenters, and templates on other VCenters can be copied to the template machine.
Considering that the operation of the template in the bottom implementation is often slow, a message queue is introduced for front-end component decoupling, avoiding the front-end page to wait continuously.
Because the message queue is introduced to realize front-back decoupling, the operation flow from the template machine to the specific template introduction to a certain VCenter can be decomposed into two relatively independent stages.
Specifically, the first stage process may be: the user selects the template name and the VCenter to be imported on the front-end page, submits the import task, the business processing layer receives the front-end data and passes the authority verification, if the verification fails, the flow is ended, otherwise, the task information is stored in the database, and the task state is set as 'created'. Then, the bottom layer implementation layer is informed to implement the task through the message queue, and after the successful sending, the task state in the database is set to be in the queue.
The second stage flow specifically comprises: and receiving the task ID in the queue for the monitoring process of the message queue, acquiring task information from the database, and setting the task state as 'executing'. Establishing session connection to a designated VCenter, calling a function of a physical host for hosting and taking in a template machine, after successful hosting, searching whether a virtual machine named as ' template name ' exists on the template machine, SWAP ' is further searched, if so, a template renaming method is called to modify the name of the virtual machine into the form of ' template name and date ', then a virtual machine cloning function is called to call the name of the template machine named as ' template name ', the virtual machine named as ' SWAP ' is cloned into the virtual machine named as ' template name ', after successful cloning, the virtual machine is called to be converted into the template method to mark the template, and finally, the task state in a database is updated to be ' completed '.
Similar to the process from template machine importing a specific template to a certain VCenter operation, the process from VCenter exporting a template to a template machine operation can also be decomposed into two relatively independent stages.
Specifically, the first stage process may be: the user selects the template name and the 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 service processing layer creates a template task to be stored in a database and informs the bottom layer implementation layer to implement the task through a message queue.
The second stage process is that the monitoring process of the message queue receives the task ID in the queue, obtains the task information from the database, and sets the task state as 'executing'. Establishing session connection to a designated VCenter, calling a management physical machine function to manage a template machine, searching whether a virtual machine named as a template name and SWAP exists on the template machine after management is successful, calling a virtual machine renaming method to modify the name of the virtual machine into a form of the template name and the SWAP date if the virtual machine named as the template name exists, then calling a virtual machine cloning function, cloning the template named as the template name into the virtual machine named as the template name and the SWAP, calling the virtual machine to convert the template method into the template method to mark the template method as the template after cloning is successful, and finally updating the task state in the database.
As can be seen from the above, the present application can achieve at least the following technical effects:
1. the design realizes a complete template management process, and realizes the traceability and visualization of template operation on the basis of a template task.
2. A template engine is introduced as an intermediary for template modification and synchronization.
3. Based on VsphereSDK specification, the operations of physical machine nano-tube, virtual machine cloning, virtual machine renaming and the like are realized through Python codes, and the automatic implementation of template operation is realized.
In terms of hardware, in order to effectively ensure correctness and consistency of templates on a plurality of virtualization management platforms and reduce operation and maintenance costs, the present application provides an embodiment of an electronic device for implementing all or part of contents in the virtual machine template data processing method, where the electronic device specifically includes 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 mutual communication through the bus; the communication interface is used for realizing information transmission between the virtual machine template data processing device and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but 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 embodiment for implementation, and the contents thereof are incorporated herein, and repeated details are not repeated.
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), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence 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. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 8, the electronic device 9600 can 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 structure to implement telecommunications or other functions.
In one embodiment, the functions of the virtual machine template data processing method may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step S101: 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 edited virtual machine template to a corresponding virtual machine management platform.
As can be seen from the above description, according to the electronic device provided in 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 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 function of the virtual machine template data processing method may be implemented by the 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 also does not necessarily include all of the components shown in fig. 8; further, the electronic device 9600 may further include components not shown in fig. 8, which may be referred to in the art.
As shown in fig. 8, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can 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 relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
An input unit 9120 provides input to the cpu 9100, the input unit 9120 is, for example, a key or a touch input device, a power supply 9170 supplies power to the electronic apparatus 9600, a display 9160 displays display objects such as images and characters, and the display may be, for example, an L CD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. 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 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store 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 for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
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, 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 receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all steps in the virtual machine template data processing method in which the execution subject is the server or the client in the foregoing embodiments, where the computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the computer program implements all steps of the virtual machine template data processing method in which the execution subject is the server or the client in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step S101: 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 edited virtual machine template to a corresponding virtual machine management platform.
As can be seen from the above description, in the computer-readable storage medium provided in 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.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for processing template data of a virtual machine is characterized by comprising 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;
and executing corresponding editing processing on the virtual machine template, and synchronizing the edited virtual machine template to a corresponding virtual machine management platform.
2. The method for processing the template data of the virtual machine according to claim 1, wherein the executing the corresponding editing process on the template of the virtual machine comprises:
performing authority verification on the virtual machine template editing request;
and if the permission verification result is passed, creating a corresponding editing task, modifying the task state of the editing task to be a first state, sequentially executing 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 to be a second state, otherwise, judging that the permission verification result of the virtual machine editing request is failed.
3. The method for processing the template data of the virtual machine according to claim 1, wherein the synchronizing the template of the virtual machine 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 managing a corresponding analog machine;
and judging whether the virtual machine template exists in the virtual machine management platform, if so, cloning the edited virtual machine template and synchronizing the edited virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task to a third state, otherwise, directly modifying the task state of the editing task to the third state.
4. The virtual machine template data processing method according to claim 1, further comprising:
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.
5. 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;
and the virtual machine template editing and synchronizing module is used for executing corresponding editing processing on the virtual machine template and synchronizing the edited virtual machine template to the corresponding virtual machine management platform.
6. The vm-template data processing apparatus according to claim 5, wherein the vm-template editing synchronization module comprises:
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 to be a first state if the permission verification result is passed, sequentially executing 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 to be a second state, otherwise, judging that the permission verification result of the virtual machine editing request is failed.
7. The vm-template data processing apparatus according to claim 5, wherein the vm-template editing synchronization module comprises:
the connection receiving unit is used for establishing session connection of the virtual machine management platform corresponding to the virtual machine editing request and receiving and managing the corresponding analog machine;
and the template synchronization unit is used for judging whether the virtual machine template exists in the virtual machine management platform or not, if so, cloning the edited virtual machine template and synchronizing the edited virtual machine template to the virtual machine management platform, and then modifying the task state of the editing task to a third state, otherwise, directly modifying the task state of the editing task to the third state.
8. The virtual machine template data processing apparatus according to claim 5, further comprising:
and the platform-to-template machine synchronization unit is used for synchronizing the preset virtual machine template of the virtual machine management platform to the template machine according to the virtual machine template editing request.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the virtual machine template data processing method according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the virtual machine template data processing method according to any one of claims 1 to 4.
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 true CN111414232A (en) 2020-07-14
CN111414232B 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 (8)

* 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
US20130152080A1 (en) * 2011-12-12 2013-06-13 International Business Machines Corporation Plug-in based templatization framework for automating the creation of open virtualization format virtual appliances
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

Patent Citations (8)

* 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
US20130152080A1 (en) * 2011-12-12 2013-06-13 International Business Machines Corporation Plug-in based templatization framework for automating the creation of open virtualization format virtual appliances
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
CN111414232B (en) 2024-01-19

Similar Documents

Publication Publication Date Title
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
CN112104723B (en) Multi-cluster data processing system and method
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
CN111459539B (en) Continuous integration pipeline operation method and device based on mirror layering
KR101086620B1 (en) Smart office system and server for managing the sames and method for managing the sames
WO2022142601A1 (en) Application program construction method and apparatus, and computer device
CN111796838A (en) MPP database automatic deployment method and device
JP2021197153A (en) Method and apparatus for recognizing word slot, electronic apparatus, storage medium and computer program
CN112131230B (en) Application software as a service (SaaS) realization method, device, equipment and storage medium
CN113448570A (en) Data processing method and device, electronic equipment and storage medium
CN113204425A (en) Method and device for process management internal thread, electronic equipment and storage medium
CN111367561A (en) Software program remote development method and device
CN110019059B (en) Timing synchronization method and device
CN110908644A (en) Configuration method and device of state node, computer equipment and storage medium
CN111414232B (en) Virtual machine template data processing method and device
CN110427260B (en) Host job scheduling method, device and system
CN115630835A (en) Activity-based workflow general parameter configuration method and system
CN110599112A (en) Method and device for developing and maintaining network page
CN114637531A (en) Method and device for dynamically generating application program interface
CN110069417B (en) A/B test method and device
CN113253991A (en) Task visualization processing method and device, electronic equipment and storage medium
CN111813407A (en) Game development method, game running device and electronic equipment
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

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