Virtual machine checkpoint operation method, device, storage medium and computer equipment
By providing virtual machine checkpoint operation methods and integrating checkpoint operations of multiple virtual machine management platforms, the problems of low operation efficiency and high learning cost are solved, and more efficient virtual machine checkpoint operations are achieved.
Patent Information
- Application Number
- CN202210332641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-03-30
AI Technical Summary
In the prior art, the operation of virtual machine of multiple virtual machine management platforms leads to high learning costs and low operational efficiency.
It provides a method of operating virtual machine checkpoints. By displaying the checkpoint operation interface, obtaining the virtual machine IP address entered by the user, querying whether multiple virtual machine management platforms have target virtual machines, and querying checkpoints in the corresponding platform of the target virtual machine, displaying query results, and calling the corresponding method to perform checkpoint operations according to the platform type.
By integrating the checkpoint operation process of multiple virtual machine platforms, users do not need to open different platforms to operate separately, reducing the complexity and learning cost of virtual machine checkpoint operation and improving operation efficiency.
Smart Images

Figure CN115048180B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual machine management, and in particular to a method, device, storage medium and computer equipment for operating a virtual machine checkpoint. Background Art
[0002] Based on different business needs, enterprises may deploy multiple different types of virtual machine management platforms (for example, Microsoft's Windows virtual machine management platform and VMware virtual machine management platform, etc.) to manage different types of virtual machines, such as virtual machine creation, virtual machine migration, virtual machine deletion, etc. When operation and maintenance personnel perform checkpoint operations on virtual machines in different platforms, they need to open their respective virtual machine management platforms to perform related operations. Different virtual machine management platforms have different user interfaces and operation methods, and operation and maintenance personnel need to learn the operation methods of checkpoints in each virtual machine manager. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, storage medium and computer equipment for operating a virtual machine checkpoint, which can solve the problems of high learning cost and low operating efficiency caused by virtual machine operations in multiple virtual machine management platforms in the prior art.
[0004] The technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for operating a virtual machine checkpoint, the method comprising:
[0006] Displaying a checkpoint operation interface; wherein the checkpoint operation interface includes a virtual machine search area, an operation display area, and a checkpoint operation button;
[0007] Obtaining the virtual machine IP address entered by the user in the virtual machine search area;
[0008] Querying multiple virtual machine management platforms to determine whether there is a target virtual machine indicated by the input virtual machine IP address;
[0009] If yes, query the checkpoint in the virtual machine management platform corresponding to the target virtual machine to obtain the checkpoint query result;
[0010] Displaying the checkpoint query result in the operation display area, and displaying the platform type in a designated area in the checkpoint operation interface;
[0011] When a trigger instruction of the checkpoint operation button is detected, a corresponding checkpoint operation is performed on the target virtual machine.
[0012] In a second aspect, an embodiment of the present application provides a device for operating a virtual machine checkpoint, the device comprising:
[0013] A display unit, used to display a checkpoint operation interface; wherein the checkpoint operation interface includes a virtual machine search area, an operation display area and a checkpoint operation button;
[0014] An acquisition unit, used to acquire a virtual machine IP address input by a user in the virtual machine search area;
[0015] A query unit, used to query whether there is a target virtual machine indicated by the input virtual machine IP address in multiple virtual machine management platforms;
[0016] The query unit is further configured to, if yes, query the checkpoint in the virtual machine management platform corresponding to the target virtual machine to obtain a checkpoint query result;
[0017] The display unit is further used to display the checkpoint query result in the operation display area, and to display the platform type in a designated area in the checkpoint operation interface;
[0018] The execution unit is used to execute the corresponding checkpoint operation on the target virtual machine when a trigger instruction of the checkpoint operation button is detected.
[0019] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0020] In a fourth aspect, an embodiment of the present application provides a computer device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0021] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0022] The operation point check interface integrates the checkpoint operation process of multiple different virtual machine platforms. Users can automatically identify the platform type of the virtual machine through virtual IP address retrieval, and call different methods according to different platform types to implement virtual machine checkpoint query, creation, deletion, restoration and other operations. In this way, users do not need to open different virtual machine management platforms for operation, nor do they need to learn the operation methods of different virtual machine management platforms, which can reduce the efficiency of virtual machine checkpoint operation and reduce learning costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 It is a schematic diagram of the network architecture provided by the embodiment of the present application;
[0025] Figure 2 It is a flowchart of a method for operating a virtual machine checkpoint provided in an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of an interface for a checkpoint operation provided in an embodiment of the present application;
[0027] Figure 4 is another interface schematic diagram of the checkpoint operation provided in an embodiment of the present application;
[0028] Figure 5 It is a structural schematic diagram of an operating device for a virtual machine checkpoint provided by the present application;
[0029] Figure 6 It is a structural schematic diagram of a computer device provided by this application. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0031] It should be noted that the virtual machine checkpoint operation method provided in the present application is generally executed by a computer device, and accordingly, the virtual machine checkpoint operation device is generally set in the computer device.
[0032] Figure 1 An exemplary system architecture that can be applied to the virtual machine checkpoint operation method or virtual machine checkpoint operation device of the present application is shown.
[0033] like Figure 1 As shown, the system architecture may include: a computer device 101, a host 102 and a host 103. The computer device 101, the host 102 and the host 103 may communicate with each other through a network, and the network is used as a medium for providing a communication link between the above-mentioned units. The network may include various types of wired communication links or wireless communication links, for example: a wired communication link includes an optical fiber, a twisted pair or a coaxial cable, etc., and a wireless communication link includes a Bluetooth communication link, a wireless fidelity (WIreless-FIdelity, Wi-Fi) communication link or a microwave communication link, etc.
[0034] Among them, virtual machines are deployed in the host 102 and the host 103, and the host 102 and the host 103 use different virtual machine management platforms to manage the deployed virtual machines. For example, the host 102 uses the Windows virtual machine management platform to manage one or more deployed virtual machines, and the host 103 uses the VMware virtual machine management platform to manage one or more deployed virtual machines. A checkpoint operation application is installed on the computer device 102, and the checkpoint query, creation, deletion and restoration operations are performed on the virtual machines on the host 102 and the host 103 through the application.
[0035] It should be noted that the host 102 and the host 103 of the present application are hardware, which can also be called physical machines, and can be implemented as a distributed host cluster consisting of multiple hosts, or as a single host.
[0036] Various communication client applications can be installed on the computer device of the present application, such as: video recording applications, video playback applications, voice interaction applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0037] The computer device may be hardware or software. When the computer device is hardware, it may be various computer devices with a display screen, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers. When the computer device is software, it may be installed in the computer devices listed above. It may be implemented as multiple software or software modules (for example, to provide distributed services), or it may be implemented as a single software or software module, which is not specifically limited here.
[0038] When the computer device is hardware, a display device and a camera may be installed thereon. The display device may be any device capable of realizing a display function, and the camera is used to collect video streams; for example, the display device may be a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a liquid crystal display (LCD), a plasma display panel (PDP), etc. The user may use the display device on the computer device to view displayed text, pictures, videos and other information.
[0039] It should be understood that Figure 1 The number of computer devices, networks and hosts in the embodiment is only for illustration. Any number of computer devices, networks and hosts may be used as required.
[0040] The following will be combined with the attached Figure 2 , the operation method of the virtual machine checkpoint provided in the embodiment of the present application is described in detail. Among them, the operation device of the virtual machine checkpoint in the embodiment of the present application can be Figure 1 Computer equipment shown.
[0041] See also Figure 2 , is a flowchart of a method for operating a virtual machine checkpoint according to an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0042] S201, displaying a checkpoint operation interface.
[0043] After the computer device opens the checkpoint operation application, the display unit displays the checkpoint operation interface including: a virtual machine search area, an operation display area, and a checkpoint operation button; the virtual machine search area is used to input the virtual machine IP address, the virtual machine IP address is used to uniquely represent the network address of the virtual machine, and the virtual machines in each virtual machine management platform have different virtual machine IP addresses. The operation display area is used to display the operation results; the checkpoint operation button is used to perform checkpoint operations, such as: creating a new checkpoint, deleting a checkpoint, and restoring a checkpoint.
[0044] For example: Checkpoint operation interface Figure 3 and Figure 4 As shown, the checkpoint operation interface includes a virtual machine retrieval area, an operation display area, a platform type display area, a checkpoint button, a restore checkpoint button, a new checkpoint button and a delete checkpoint button. The operation display area is located below the virtual machine retrieval area. The platform type display area is used to display the type of platform where the virtual machine is located. The checkpoint button is used to trigger the query of the virtual machine's checkpoint. The restore checkpoint button, the new checkpoint button and the delete checkpoint button are used to trigger the operations of restoring the virtual machine's checkpoint, creating a new virtual machine's checkpoint and deleting the virtual machine's checkpoint, respectively.
[0045] In one or more possible embodiments, before S201, the method further includes:
[0046] When receiving an opening instruction of the checkpoint operation application, obtaining the current version number of the checkpoint operation application and the latest version number on the FTP server;
[0047] If the latest version number is greater than the current version number;
[0048] Download the latest checkpointing application from the FTP server.
[0049] For example: when a computer device detects an instruction to open a checkpoint application, it obtains the current version number now_version of the checkpoint operation application, and then obtains the latest version number new_version on the FTP server. The version number can be represented by a number. The larger the version number, the newer the application. If the current version number is less than the latest version number, the latest checkpoint operation application is downloaded from the FTP server.
[0050] S202: Acquire the virtual machine IP address entered by the user in the virtual machine search area.
[0051] The user enters the virtual machine name in the virtual machine search area through an input device, which may be a keyboard, a mouse, or a touch screen. Furthermore, the IP addresses of various virtual machines are generally in the same network segment, that is, some of the numbers in the IP address are the same. To simplify the input, the user can only enter the different numbers in the IP address in the virtual machine search area, for example: Figure 3 In the checkpoint operation interface shown, the first two digits of the IP address are the same, the IP address of the virtual machine is 10.51.61.99, and the virtual machine IP address entered by the user in the virtual machine search area is the "6199" set. Figure 4 In the checkpoint operation interface shown, the IP address of the virtual machine is 10.51.75.10, and the IP address of the virtual machine entered by the user in the virtual machine search area is "7510".
[0052] S203: Query multiple virtual machine management platforms to see whether there is a target virtual machine indicated by the input virtual machine IP address.
[0053] Among them, the multiple virtual machine management platforms have different platform types, such as Windows virtual machine management platform or VMware virtual machine management platform. The virtual machine management platform deploys multiple virtual machines. The virtual machine management platform is also called a virtual machine manager, which is used to manage the virtual machines deployed on the host. The computer device traverses the multiple virtual machine management platforms to determine whether there is a target virtual machine indicated by the input virtual machine IP address.
[0054] In the embodiment of the present application, when multiple virtual machine management platforms are VMware virtual machine management platform and Windows virtual machine management platform, considering that the running speed of Python code in calling VMware virtual machine management platform operation is faster than that of Windows virtual machine management platform. First, the computer device uses the connect method in Python pyVim library to connect to the host of VMware virtual machine management platform through IP address, port, user name and password, obtains all virtual machine management objects ManagedObject on the host, and then obtains the name (ManagedObject.name) and virtual machine IP address of each virtual machine management object through a for loop and stores them in a list in Python, compares the virtual machine IP address entered by the user with each element in the list, and if an element in the list contains the virtual machine IP address entered by the user, assigns the virtual machine name to the value machine_name entered by the user and displays the platform name in the specified position of the checkpoint operation interface, and if the virtual machine IP address entered by the user does not exist in the list, continues to search in the Windows virtual machine management platform.
[0055] The retrieval method includes: the computer device calls the get_all_VM.psl powershell script through the python subprocess library (the subprocess library is mainly used to call the windows cmd command and receive the return value of the cmd command) to obtain the virtual machine IP address of each virtual machine in the Windows virtual management platform, uses the Get-VMMserver method provided by the Windows operating system to connect to the host through the host's IP and port through the get_all_VM.psl powershell script, and then obtains all virtual machine IP addresses through the get-vm.name method and stores them in a python list, compares the virtual machine IP address entered by the user with each element in the list, and if the element of the list contains the virtual machine IP address entered by the user, assigns the virtual machine name to the value machine_name entered by the user and displays the platform name at a specified position in the checkpoint operation interface.
[0056] Furthermore, if the target virtual machine indicated by the virtual machine IP address input by the user does not exist in any virtual machine platform, a prompt message indicating that the virtual machine does not exist or that an incorrect virtual machine IP address is input is fed back through a QMessageBox pop-up window.
[0057] S204: If yes, query the checkpoint in the virtual machine management platform corresponding to the target virtual machine to obtain the checkpoint query result.
[0058] When the target virtual machine indicated by the input virtual machine IP address exists in multiple virtual machine management platforms, a checkpoint is queried in the virtual machine platform where the target virtual machine is located. The checkpoint can also be called a snapshot. The checkpoint query result includes: name, creation time, modification time, and description.
[0059] The query process includes: when the platform type of the target virtual machine is identified, different methods are automatically called, and at this time, the virtual machine name machine_name has been obtained through the virtual machine IP address input by the user.
[0060] If the target virtual machine is under the Windows virtual machine management platform, the computer device uses the Python subprocess library (the subprocess library is mainly used to call the Windows cmd command and receive the return value of the cmd command) to call the get_allCheckpoint.psl PowerShell script to obtain the checkpoint list of the target virtual machine and then display it in QT5QListView (the get_allCheckpoint.psl PowerShell script uses the method Get-VMMserver provided by Microsoft to connect to the host through the host's IP and port, and then obtains the checkpoint name of the virtual machine through Get-VMCheckpoint-VM virtual machine name);.
[0061] If the target virtual machine is under the VMware Vsphere virtual machine management platform, use the Python pyVmomi library and pyVim library. First, the computer device uses the connect method in the pythonpyVim library to connect to the host through the VMware vSphere host ip, port, username, and password to obtain all virtual machine management objects Managed Object, and then compare each virtual machine management object name (ManagedObject.name) with the input virtual machine IP address through a for loop. If they are equal, the current virtual machine's managed object ManagedObject definition is obtained as vmobj, and then the method vmobj.snapshot.rootSnapshotList provided by vmobj is used to obtain all snapshot definitions of the target virtual machine as snapshots (type is a python dictionary). Snapshots contains the name, creation time, modification time, description and other information of each snapshot. Finally, the snapshot name snapshot.name of each snapshot is obtained through a for loop and then displayed in QT5 QListView.
[0062] S205: Display the checkpoint query result in the operation display area, and display the platform type in a designated area in the checkpoint operation interface.
[0063] See also Figure 3 and Figure 4 As shown, the checkpoint query result of the target virtual machine includes the creation date and creation time of each checkpoint.
[0064] S206: When a trigger instruction of the checkpoint operation button is detected, a corresponding checkpoint operation is performed on the target virtual machine.
[0065] Among them, the operation method of checkpoint / snapshot includes creation, deletion and restoration. The computer device realizes creation, deletion and restoration of checkpoints by clicking the option (checkpoint operation button) in QT5QListView (checkpoint operation interface). If the target virtual machine is under the Windows virtual machine management platform, the Python subprocess library is used to call the powershell script to return the execution value success or failure, and then the returned value is displayed in a QMessageBox pop-up window; if the target virtual machine is under the VMware Vsphere virtual machine management platform, the Python pyVmomi library and pyVim library are used to call different codes to realize the creation, deletion, restoration and other operations of the snapshot, and the defined value is returned and then displayed in a QMessageBox pop-up window.
[0066] In the embodiment of the present application, the new operation of the checkpoint / snapshot includes: if the target virtual machine is under the Windows virtual machine management platform, the Python subprocess library (the subprocess library is mainly used to call the Windows cmd command and receive the return value of the cmd command) is used to call the creat_newpoint.psl PowerShell script (the creat_newpoint.psl PowerShell script uses the method Get-VMMserver provided by Microsoft to connect to the host through the host's IP and port, and then creates a new restore point $Checkpoint through the New-VMCheckpoint method, $Checkpoint includes the name, time, virtual machine name, etc. of the restore point, and returns the virtual machine name, restore point name, and time from $Checkpoint, which is defined as $resultall), and the relevant information of the newly created checkpoint is returned and displayed in a QMessageBox pop-up window. If the target virtual machine is under the Vmware Vsphere platform, the Python pyVmomi library and the pyVim library are used. When obtaining the checkpoint name, the management object of the virtual machine has been obtained and defined as vmobj, and the method Createsnapshot provided by vmobj is used to create a new snapshot, and the returned result is defined as result, and finally the result information is displayed through a QMessageBox pop-up window.
[0067] In an embodiment of the present application, the checkpoint / snapshot deletion operation includes: if the target virtual machine is under the Windows virtual machine management platform, use the Python subprocess library (the subprocess library is mainly used to call the Windows cmd command and receive the return value of the cmd command) to call the delete_checkpoint.psl PowerShell script (the delete_checkpoint.psl PowerShell script uses the Microsoft method Get-VMMserver to connect to the host where the target virtual machine is located through the host's IP and port, obtains all checkpoint names $allcheckpoint, and then uses a Foreach loop to determine if the checkpoint name selected by the user is equal to one of the $allcheckpoints, then deletes the restore point through the Remove-VMCheckpoint-VMCheckpoint checkpoint name, returns the virtual machine name, the deleted restore point name, and the deletion time, which is defined as $resultall), and returns the relevant information of the deleted restore point to be displayed in a QMessageBox pop-up window. If the target virtual machine is under the VMware Vsphere platform, use the Python pyVmomi library and pyVim library. When obtaining the checkpoint name, the management object definition of the virtual machine has been obtained as vmobj. The management object collection of the snapshot is defined as snapshots through vmobj.snapshot.rootSnapshotList. Then use the for loop to obtain the management object definition of the snapshot whose target name is consistent with the snapshot name selected by the user as snap_obj. Finally, the snapshot is deleted through the snap_obj.RemoveSnapt_Task method. The returned result is defined as result. Finally, the result information is displayed through the QMessageBox pop-up window.
[0068] In an embodiment of the present application, the checkpoint / snapshot restore operation includes: if the virtual machine is under the Windows virtual machine management platform, use the Python subprocess library (the subprocess library is mainly used to call the Windows cmd command and receive the return value of the cmd command) to call the restore_checkpoint.psl PowerShell script (the restore_checkpoint.psl PowerShell script uses the Microsoft method Get-VMMserver to connect to the host through the host's IP and port, obtains all checkpoint names $allcheckpoint, and then uses the Foreach loop to determine if the checkpoint name selected by the user is equal to one of the $allcheckpoints, then restores the checkpoint through the Restore-VMCheckpoint-VMCheckpoint restore point name to return the virtual machine name, restore point name, and restore time, which are defined as $resultall), and returns the relevant information of the restore point to be displayed in a QMessageBox pop-up window; if the virtual machine is under the Vmware Vsphere platform, use the Python pyVmomi library and the pyVim library, and when obtaining the checkpoint name, use the Python pyVmomi library and the pyVim The library, when getting the checkpoint name, has already obtained the management object definition of the virtual machine as vmobj, and through vmobj.snapshot.rootSnapshotList to get the snapshot management object collection definition as snapshots, and then use the for loop to get the snapshot management object definition snap_obj whose target name is consistent with the snapshot name selected by the user, and finally delete the snapshot through the snap_obj.RevertSnapt_Task method, and return the result definition as result, and finally display the result information through the QMessageBox pop-up window.
[0069] Furthermore, for each button in the checkpoint operation interface, in the user motor button, the clicked button is highlighted and displayed in red font, and the other buttons are converted to black font. This allows the operator to clearly know the button he is currently clicking, and can also be used to reproduce the fault in time when the software fails.
[0070] The embodiment of the present application integrates the checkpoint operation process of multiple different virtual machine platforms through the operation point check interface. The user automatically identifies the platform type of the virtual machine through the virtual IP address search, and calls different methods according to different platform types to implement virtual machine checkpoint query, creation, deletion, restoration and other operations. In this way, the user does not need to open different virtual machine management platforms separately for operation, nor does he need to learn the operation methods of different virtual machine management platforms separately, which can reduce the efficiency of virtual machine checkpoint operation and reduce the learning cost.
[0071] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0072] See also Figure 5 , which shows a schematic diagram of the structure of a virtual machine checkpoint operation device provided by an exemplary embodiment of the present application, hereinafter referred to as device 5. The device 5 can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device 5 includes: a display unit 501, an acquisition unit 502, a query unit 503, and an execution unit 504.
[0073] A display unit, used to display a checkpoint operation interface; wherein the checkpoint operation interface includes a virtual machine search area, an operation display area and a checkpoint operation button;
[0074] An acquisition unit, used to acquire a virtual machine IP address input by a user in the virtual machine search area;
[0075] A query unit, used to query whether there is a target virtual machine indicated by the input virtual machine IP address in multiple virtual machine management platforms;
[0076] The query unit is further configured to, if yes, query the checkpoint in the virtual machine management platform corresponding to the target virtual machine to obtain a checkpoint query result;
[0077] The display unit is further used to display the checkpoint query result in the operation display area, and to display the platform type in a designated area in the checkpoint operation interface;
[0078] The execution unit is used to execute the corresponding checkpoint operation on the target virtual machine when a trigger instruction of the checkpoint operation button is detected.
[0079] In one or more possible embodiments, querying the checkpoint in the virtual machine management platform corresponding to the target virtual machine to obtain the checkpoint query result includes:
[0080] If the virtual machine management platform is a Windows virtual machine management platform, the get_allCheckpoint.psl PowerShell script is called through the subprocess library to obtain the checkpoint information of the target virtual machine in the Windows virtual machine management platform to generate a checkpoint query result; or
[0081] If the virtual machine management platform is a VMware virtual machine management platform, define the virtual machine management object vmobj of the virtual machine, then obtain all the checkpoint information of the target virtual machine through the vmobj.snapshot.rootSnapshotList method provided by vmobj, and generate a checkpoint query result; wherein the checkpoint information includes: name, creation time, modification time and description.
[0082] In one or more possible embodiments, if the checkpoint operation button is used to perform a checkpoint creation operation;
[0083] The performing a corresponding checkpoint operation on the target virtual machine includes:
[0084] If the virtual machine management platform is Windows virtual machine management platform, call the creat_newpoint.psl PowerShell script through the subprocess library and use the Get-VMMserver method to link to the host where the target virtual machine is located;
[0085] Create a new checkpoint via the New-VMCheckpoint method; or
[0086] If the virtual machine management platform is a VMware virtual machine management platform, a new checkpoint is created using the Createsnapshot method provided by the virtual machine management object vmobj.
[0087] In one or more possible embodiments, if the checkpoint operation button is used to perform a checkpoint deletion operation;
[0088] The performing a corresponding checkpoint operation on the target virtual machine includes:
[0089] Selecting a checkpoint in the virtual machine detection result based on a user's selection instruction;
[0090] If the virtual machine management platform is a Windows virtual machine management platform, delete the selected checkpoint using the Remove-VMCheckpoint method; or
[0091] If the virtual machine management platform is the VMware virtual machine management platform, delete the selected checkpoint through the snap_obj.RemoveSnapt_Task method.
[0092] In one or more possible embodiments, if the checkpoint operation button is used to perform a checkpoint restore operation;
[0093] The performing a corresponding checkpoint operation on the target virtual machine includes:
[0094] Selecting a checkpoint in the virtual machine detection result based on a user's selection instruction;
[0095] If the virtual machine management platform is a Windows virtual machine management platform, restore the selected checkpoint using the Restore-VMCheckpoint method; or
[0096] If the virtual machine management platform is the VMware virtual machine management platform, restore the selected checkpoint through the snap_obj.RevertSnapt_Task method.
[0097] In one or more possible embodiments, it further includes:
[0098] An updating unit, configured to obtain a current version number of the checkpoint operation application and a latest version number on the FTP server upon receiving an opening instruction of the checkpoint operation application;
[0099] If the latest version number is greater than the current version number;
[0100] Download the latest checkpointing application from the FTP server.
[0101] It should be noted that, when the device 5 provided in the above embodiment executes the operation method of the virtual machine checkpoint, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the operation device of the virtual machine checkpoint provided in the above embodiment and the operation method embodiment of the virtual machine checkpoint belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0102] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0103] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.
[0104] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the virtual machine checkpoint operation method described in the above embodiments.
[0105] See also Figure 6 , which is a schematic diagram of the structure of a computer device according to an embodiment of the present application. Figure 6 As shown, the computer device 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .
[0106] The communication bus 602 is used to realize the connection and communication between these components.
[0107] The user interface 603 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 603 may also include a standard wired interface and a wireless interface.
[0108] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0109] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect the various parts of the entire computer device 600, and executes various functions and processes data of the computer device 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.
[0110] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 605 may optionally be at least one storage device located away from the aforementioned processor 601. As Figure 6 As shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program.
[0111] exist Figure 6 In the computer device 600 shown in FIG. 1 , the user interface 603 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 601 can be used to call the application program stored in the memory 605 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.
[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0113] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for operating a virtual machine checkpoint, characterized in that: include: Displaying a checkpoint operation interface; wherein the checkpoint operation interface includes a virtual machine search area, an operation display area, and a checkpoint operation button; Obtaining the virtual machine IP address entered by the user in the virtual machine search area; Querying multiple virtual machine management platforms to determine whether there is a target virtual machine indicated by the input virtual machine IP address; If yes, if the virtual machine management platform is a Windows virtual machine management platform, the get_allCheckpoint.psl PowerShell script is called through the subprocess library to obtain the various checkpoint information of the target virtual machine in the Windows virtual machine management platform, and a checkpoint query result is generated; or if the virtual machine management platform is a VMware virtual machine management platform, the virtual machine management object vmobj of the virtual machine is defined, and then the vmobj.snapshot.rootSnapshotList method provided by vmobj is used to obtain all the checkpoint information of the target virtual machine, and a checkpoint query result is generated; wherein the checkpoint information includes: name, creation time, modification time and description; Displaying the checkpoint query result in the operation display area, and displaying the platform type in a designated area in the checkpoint operation interface; When a trigger instruction of the checkpoint operation button is detected, a corresponding checkpoint operation is performed on the target virtual machine.
2. The method according to claim 1, characterized in that The multiple virtual machine management platforms are composed of a Windows virtual machine management platform and a VMware virtual machine management platform; The querying in multiple virtual machine management platforms whether there is a virtual machine associated with the input virtual machine IP address includes: Call the connect method in the pyVim library to obtain the virtual machine IP address of each virtual machine in the VMware virtual machine management platform to obtain the first virtual machine IP address list; Calling the get_all_VM.psl PowerShell script through the subprocess library to obtain the virtual machine IP address of each virtual machine in the Windows virtual machine management platform to obtain a second virtual machine IP address list; Determine whether the input virtual machine IP address exists in the first virtual machine IP address list and the second virtual machine IP address list.
3. The method according to claim 1, characterized in that: If the checkpoint operation button is used to perform a checkpoint creation operation; The performing a corresponding checkpoint operation on the target virtual machine includes: If the virtual machine management platform is Windows virtual machine management platform, call the creat_newpoint.psl PowerShell script through the subprocess library and use the Get-VMMserver method to link to the host where the target virtual machine is located; Create a new checkpoint via the New-VMCheckpoint method; or If the virtual machine management platform is a VMware virtual machine management platform, a new checkpoint is created using the Createsnapshot method provided by the virtual machine management object vmobj.
4. The method according to claim 1, 2 or 3, characterized in that: If the checkpoint operation button is used to perform a checkpoint deletion operation; The performing a corresponding checkpoint operation on the target virtual machine includes: Selecting a checkpoint in the virtual machine detection result based on a user's selection instruction; If the virtual machine management platform is a Windows virtual machine management platform, delete the selected checkpoint using the Remove-VMCheckpoint method; or If the virtual machine management platform is the VMware virtual machine management platform, delete the selected checkpoint through the snap_obj.RemoveSnapt_Task method.
5. The method according to claim 4, characterized in that If the checkpoint operation button is used to perform a checkpoint restore operation; The performing a corresponding checkpoint operation on the target virtual machine includes: Selecting a checkpoint in the virtual machine detection result based on a user's selection instruction; If the virtual machine management platform is a Windows virtual machine management platform, restore the selected checkpoint using the Restore-VMCheckpoint method; or If the virtual machine management platform is the VMware virtual machine management platform, restore the selected checkpoint through the snap_obj.RevertSnapt_Task method.
6. The method according to claim 5, characterized in that Before displaying the checkpoint operation interface through the display unit, the method further includes: When receiving an opening instruction of the checkpoint operation application, obtaining the current version number of the checkpoint operation application and obtaining the latest version number on the FTP server; If the latest version number is greater than the current version number; Download the latest checkpointing application from the FTP server.
7. A virtual machine checkpoint operation device, characterized in that: include: A display unit, used to display a checkpoint operation interface; wherein the checkpoint operation interface includes a virtual machine search area, an operation display area and a checkpoint operation button; An acquisition unit, used to acquire a virtual machine IP address input by a user in the virtual machine search area; A query unit, used to query whether there is a target virtual machine indicated by the input virtual machine IP address in multiple virtual machine management platforms; The query unit is further used for, if yes, if the virtual machine management platform is a Windows virtual machine management platform, to obtain the various checkpoint information of the target virtual machine in the Windows virtual machine management platform through the subprocess library to generate a checkpoint query result; or if the virtual machine management platform is a VMware virtual machine management platform, to define the virtual machine management object vmobj of the virtual machine, and then to obtain all the checkpoint information of the target virtual machine through the vmobj.snapshot.rootSnapshotList method provided by vmobj to generate a checkpoint query result; wherein the checkpoint information includes: name, creation time, modification time and description; The display unit is further used to display the checkpoint query result in the operation display area, and to display the platform type in a designated area in the checkpoint operation interface; The execution unit is used to execute the corresponding checkpoint operation on the target virtual machine when a trigger instruction of the checkpoint operation button is detected.
8. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 6.
9. A computer device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
VMWare virtual machine remote detection method
CN103236963A
Virtual machine management method and device
CN108322325A