Backup method and device of virtual machine and electronic equipment

By automating the virtual machine backup process in cloud infrastructure and leveraging the API interfaces of Kubernetes and KubeVirt, the shortcomings of manual operations in virtual machine backup and migration are resolved, enabling efficient and secure virtual machine backup and cross-cluster migration.

CN120892252APending Publication Date: 2025-11-04CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511062218.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

In cloud infrastructure and containerized environments, existing technologies require administrators to manually perform multiple steps during virtual machine backup and cross-cluster migration, lacking atomicity guarantees. This leads to extended migration time windows and the risk of business interruption. Furthermore, backups need to be downloaded to a cache address before being transferred to an address outside the containerized management cluster, resulting in data transmission efficiency and resource consumption issues.

Method used

By creating snapshots of virtual machine instances based on target custom resources and automatically performing snapshot creation, data transfer, and status monitoring in the containerized management cluster, the system leverages the API interfaces of Kubernetes and KubeVirt to automate the backup process of virtual machine copies. This includes the direct upload of virtual machine description information and storage volumes, avoiding the need for caching and downloading steps.

Benefits of technology

It has enabled automated management of virtual machine backups, improved the reliability and efficiency of backup tasks, simplified the operation process, ensured the security and consistency of data transmission, and reduced the risk of business interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892252A_ABST
    Figure CN120892252A_ABST
Patent Text Reader

Abstract

The invention discloses a backup method and device of a virtual machine and electronic equipment. The method comprises the following steps: creating a snapshot of a virtual machine instance to be backed up according to a target self-defined resource; under the condition that the state indication information is in a copy state, creating a virtual machine copy of the virtual machine instance to be backed up according to the snapshot, and converting the state indication information from the copy state into a ready state; under the condition that the state indication information is in a ready state, virtual machine description information in the virtual machine copy is uploaded to a target address by creating a first transmission task in a containerized management cluster, and the state indication information is converted from the ready state to a virtual machine backup state; and when the state indication information is in the backup state of the virtual machine, creating a second transmission task in the containerized management cluster to upload the storage volume in the copy of the virtual machine to the target address. The technical problem that the virtual machine backup is downloaded to the cache address and then transmitted to the address outside the containerized management cluster running the virtual machine is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of cloud computing, in particular to a virtual machine backup method and device and electronic equipment. BACKGROUND

[0002] In the current cloud infrastructure and containerized environment, such as Kubernetes (K8s, an open source system for automating deployment, scaling, and management of containerized applications), managing and migrating virtual machines (VMs) has become a key link in enterprise IT architecture. With the popularization of virtualization technology, more and more applications and services rely on virtual machines to provide elastic and scalable computing resources. However, when dealing with the backup and cross-cluster migration of virtual machines, the methods in the related art often face a series of challenges, requiring administrators to manually perform multi-step operations, and the entire process lacks atomicity guarantee. For virtual machines running critical business, this fragmented operation can lead to an extended migration time window, increasing the risk of business interruption. In addition, if you want to backup a virtual machine, you need to download it to a cache address first, and then transfer it to an address outside the containerized management cluster running the virtual machine (for example, a server of a cloud storage service), resulting in problems in data transmission efficiency, resource occupation, and fault recovery capability.

[0003] In view of the above problems, no effective solution has been proposed so far. SUMMARY

[0004] The embodiments of the present application provide a virtual machine backup method, device and electronic equipment to at least solve the technical problem that a virtual machine is first downloaded to a cache address and then transferred to an address outside the containerized management cluster running the virtual machine.

[0005] According to an aspect of some embodiments of the present application, a backup method of a virtual machine is provided, including: creating a snapshot of a to-be-backed-up virtual machine instance according to a target custom resource, and changing state indication information of the target custom resource from a new state to a copy state, wherein the target custom resource at least includes a target address and the state indication information, the state indication information is used to reflect a full life cycle of the to-be-backed-up virtual machine for backup, an initial state of the state indication information is the new state, and the target address is an address for backing up the to-be-backed-up virtual machine instance outside a containerized management cluster running the to-be-backed-up virtual machine instance; in a case where the state indication information is in the copy state, creating a virtual machine copy of the to-be-backed-up virtual machine instance according to the snapshot, and changing the state indication information from the copy state to a ready state; in a case where the state indication information is in the ready state, uploading virtual machine description information in the virtual machine copy to the target address by creating a first transmission task in the containerized management cluster, and changing the state indication information from the ready state to a virtual machine backup in state, wherein the virtual machine description information at least includes configuration information of the virtual machine copy; and in a case where the state indication information is in the virtual machine backup in state, uploading a storage volume in the virtual machine copy to the target address by creating a second transmission task in the containerized management cluster, and changing the state indication information from the virtual machine backup in state to a backup success state.

[0006] According to some embodiments of the present application, creating a snapshot of a to-be-backed-up virtual machine instance according to a target custom resource, and changing state indication information of the target custom resource from a new state to a copy state includes: locating the to-be-backed-up virtual machine instance according to a to-be-backed-up virtual machine name in the target custom resource, and verifying a running state of the to-be-backed-up virtual machine instance; in a case where the running state of the to-be-backed-up virtual machine instance meets a creation condition of the snapshot, initiating a virtual machine snapshot resource creation request to a containerized management cluster to create the snapshot; and in a case where it is monitored that the snapshot is created, changing the state indication information of the target custom resource from the new state to the copy state.

[0007] According to some embodiments of the present application, creating a virtual machine copy of a to-be-backed-up virtual machine instance according to a snapshot includes: creating a target virtual machine instance according to the snapshot, wherein the target virtual machine instance uses the same configuration parameters as the to-be-backed-up virtual machine instance; determining the target virtual machine instance as the virtual machine copy, and setting a state of the virtual machine copy as a shutdown state.

[0008] According to some embodiments of the present application, the state indication information is changed from the copy state to the ready state, including: creating a storage volume for the virtual machine copy in the shutdown state, and restoring the data in the storage volume of the to-be-backed-up virtual machine instance in the snapshot in the storage volume; in the case that all storage volumes of the virtual machine copy restore the data in the storage volume of the corresponding to-be-backed-up virtual machine instance in the snapshot, the state indication information is changed from the copy state to the ready state.

[0009] According to some embodiments of the present application, the virtual machine description information in the virtual machine copy is uploaded to the target address by creating a first transmission task in the containerized management cluster, including: converting the virtual machine description information in the virtual machine copy into a preset data format to obtain the virtual machine description information after format conversion; storing the virtual machine description information after format conversion into a configuration mapping object of the containerized management cluster, wherein the configuration mapping object is a resource object in the containerized management cluster for storing configuration data, and at least injecting access credentials of the target address into a secret volume of the containerized management cluster, and presetting a first environment variable, wherein the first environment variable is used to define the transmission rule of the virtual machine description information; creating a first transmission task at least according to the first environment variable, and uploading the virtual machine description information after format conversion to the target address through a first transmission task node running the first transmission task according to the configuration mapping object and the secret volume.

[0010] According to some embodiments of the present application, the storage volume in the virtual machine copy is uploaded to the target address by creating a second transmission task in the containerized management cluster, and the state indication information is changed from the virtual machine backup to the backup success state indication information, including: creating a second transmission task for each persistent volume claim in the virtual machine copy, wherein each storage volume corresponds to a persistent volume claim; for each second transmission task, mounting the corresponding storage volume reading path according to the type of the persistent volume claim, and adding the target address to the second transmission task node running the second transmission task; reading the data of the storage volume in the storage volume reading path through the second transmission task node, and uploading to the target address; in the case that all second transmission task nodes are detected to have executed the second transmission task, the state indication information is changed from the virtual machine backup to the backup success state.

[0011] According to some embodiments of the present application, the data of the storage volume is read in the storage volume reading path through the second transmission task node and uploaded to the target address, including: adding a second environment variable to the second transmission task node running the second transmission task, wherein the second environment variable is used to define a preset compression format; compressing the data of the storage volume according to the preset compression format in the second environment variable through the second transmission task node to obtain compressed data, and uploading the compressed data to the target address.

[0012] According to a further aspect of the embodiments of the present application, a backup apparatus of a virtual machine is also provided, comprising: a first creating module configured to create a snapshot of a to-be-backed-up virtual machine instance according to a target customized resource, and change state indication information of the target customized resource from a new state to a copying state, wherein the target customized resource at least comprises a target address and the state indication information, the state indication information is used to reflect a full life cycle of the to-be-backed-up virtual machine during backup, an initial state of the state indication information is the new state, and the target address is an address for backing up the to-be-backed-up virtual machine instance outside a containerized management cluster running the to-be-backed-up virtual machine instance; a second creating module configured to create a virtual machine copy of the to-be-backed-up virtual machine instance according to the snapshot when the state indication information is in the copying state, and change the state indication information from the copying state to a ready state; a first uploading module configured to upload virtual machine description information in the virtual machine copy to the target address by creating a first transmission task in the containerized management cluster when the state indication information is in the ready state, and change the state indication information from the ready state to a virtual machine backup in state, wherein the virtual machine description information at least comprises configuration information of the virtual machine copy; and a second uploading module configured to upload storage volumes in the virtual machine copy to the target address by creating a second transmission task in the containerized management cluster when the state indication information is in the virtual machine backup in state, and change the state indication information from the virtual machine backup in state to a backup success state.

[0013] According to a further aspect of the embodiments of the present application, a nonvolatile storage medium is also provided, which stores a program, wherein the program, when running, controls a device where the nonvolatile storage medium is located to perform the above backup method of a virtual machine.

[0014] According to a further aspect of the embodiments of the present application, an electronic device is also provided, which comprises a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, performs the above backup method of a virtual machine.

[0015] According to a further aspect of the embodiments of the present application, a computer program product is also provided, which comprises computer instructions, the computer instructions being executed by a processor to implement the above backup method of a virtual machine.

[0016] In the embodiment of the present application, a snapshot of the to-be-backed-up virtual machine instance is created according to the target custom resource, and the state indication information of the target custom resource is changed from the new state to the copy state, wherein the target custom resource at least includes a target address and state indication information, the state indication information is used to reflect the whole life cycle of the to-be-backed-up virtual machine during backup, the initial state of the state indication information is the new state, and the target address is an address for backing up the to-be-backed-up virtual machine instance outside the containerized management cluster running the to-be-backed-up virtual machine instance; in the case that the state indication information is in the copy state, a virtual machine copy of the to-be-backed-up virtual machine instance is created according to the snapshot, and the state indication information is changed from the copy state to the ready state; in the case that the state indication information is in the ready state, virtual machine description information in the virtual machine copy is uploaded to the target address by creating a first transmission task in the containerized management cluster, and the state indication information is changed from the ready state to the virtual machine backup in state, wherein the virtual machine description information at least includes configuration information of the virtual machine copy; in the case that the state indication information is in the virtual machine backup in state, a storage volume in the virtual machine copy is uploaded to the target address by creating a second transmission task in the containerized management cluster, and the state indication information is changed from the virtual machine backup in state to the backup success state; by executing different steps of the virtual machine instance backup process under different state indication information, creating a virtual machine copy in the containerized management cluster, and then directly uploading to the target address outside the containerized management cluster through a transmission task in the containerized management cluster, the purpose that the virtual machine backup no longer needs to be downloaded to a cache first and then transmitted to the target address is achieved, thereby solving the technical problem that the virtual machine backup is first downloaded to a cache and then transmitted to an address outside the containerized management cluster running the virtual machine. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0018] Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal for implementing a virtual machine backup method according to an embodiment of the present application;

[0019] Figure 2 FIG. 2 is a flowchart of a virtual machine backup method according to an embodiment of the present application;

[0020] Figure 3 FIG. 3 is another flowchart of a virtual machine backup method according to an embodiment of the present application;

[0021] Figure 4 FIG. 4 is a structural schematic diagram of a virtual machine backup device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person of ordinary skill in the art without creative labor should belong to the scope of protection of the present application.

[0023] The information collected by the embodiments of the present application is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, necessary security measures are taken, public order and good customs are not violated, and corresponding operation entrances are provided for the user to choose authorization or refuse automatic decision results; if the user chooses to refuse, the expert decision process is entered.

[0024] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not have to be used to describe a particular order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0026] Virtual Machine (VM): A software-implemented machine that can run an operating system and applications like a physical computer. In the context of Kubernetes and KubeVirt, a Virtual Machine Instance (VMI) refers to a specific instance of a virtual machine running in a Kubernetes cluster. It is the actual virtual machine that is managed by KubeVirt as a first-class resource in the Kubernetes ecosystem, allowing virtual machines to be scheduled and managed like containers.

[0027] DataVolume (DV): A resource type specific to KubeVirt, DataVolume is used to manage the lifecycle of virtual machine disks. DVs can pull disk images from various data sources, convert them into Kubernetes PersistentVolumeClaims (PVCs), and provide persistent storage for VMIs.

[0028] Containerized Data Importer (CDI): Containerized Data Importer is an important component of KubeVirt, responsible for handling DataVolume objects and loading external data onto PVCs for VMI usage. CDI supports multiple data source formats and provides flexible data import and management mechanisms. CDI simplifies the process of importing virtual machine images and improves the workflow of Kubevirt and its storage.

[0029] VirtualMachineSnapshot: A resource in KubeVirt used to create snapshots of virtual machine disks. Unlike traditional virtual machine snapshots, VirtualMachineSnapshot leverages the capabilities of Kubernetes and CDI to create live or incremental snapshots of virtual machine disks, supporting subsequent backup, restore, and migration operations.

[0030] Simple Storage Service (S3) object storage is a cloud storage architecture based on key-value pair management, designed for massive unstructured data. Its core features include decentralized flat structure, unlimited expansion capability, and metadata self-definition support, achieving efficient access through a globally unique identifier. It is widely used in scenarios such as log archiving, multimedia resource library, AI training data set, and has become a basic storage solution for modern distributed systems.

[0031] In the related art, the backup of the virtual machine often faces a series of challenges, requiring the administrator to manually perform multi-step operations, and the entire process lacks atomicity guarantee. For virtual machines running critical business, such fragmented operations can cause the migration time window to be extended, increasing the risk of business interruption. In addition, if you want to implement a backup virtual machine, you need to download it to a cache address first, and then transfer it to an address outside the containerized management cluster of the running virtual machine (for example, a server of a cloud storage service). Therefore, there is a technical problem that the virtual machine backup is first downloaded to the cache address and then transferred to the address outside the containerized management cluster of the running virtual machine. In order to solve this problem, the related solutions are provided in the embodiments of the present application, which are described in detail below.

[0032] According to an embodiment of the present application, an embodiment of a virtual machine backup method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0033] The method embodiment provided by the embodiments of the present application can be executed in a computer terminal or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal for implementing a virtual machine backup method is shown. As Figure 1 shown, the computer terminal 10 can include one or more (shown in the figure as 102a, 102b, …, 102n) processors 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication function. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand, Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or fewer components than Figure 1 shown, or have a structure different from that shown.Figure 1 different configurations.

[0034] It should be noted that the one or more processors 102 and / or other data processing circuitry described above can be generally referred to herein as "data processing circuitry". The data processing circuitry can be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuitry can be a single standalone processing module or incorporated in whole or in part within any of the other elements of the computer terminal 10. As referred to in embodiments of the present application, the data processing circuitry functions as a processor to control, for example, selection of variable resistance terminal paths in connection with an interface.

[0035] The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage means corresponding to the backup method of virtual machine in embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, i.e. implements the backup method of virtual machine described above. The memory 104 can include a high-speed random access memory and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include a memory disposed remotely with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (NIC) that can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module used to communicate with the Internet in a wireless manner.

[0037] The display can be, for example, a touch screen type liquid crystal display (LCD) that can enable a user to interact with a user interface of the computer terminal 10.

[0038] In the above-described operating environment, embodiments of the present application provide a backup method of virtual machine. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] As shown in Figure 2 FIG. 1 is a flowchart of a backup method of a virtual machine according to an embodiment of the present application, comprising:

[0040] In step S202, a snapshot of the to-be-backed-up virtual machine instance is created according to the target custom resource, and the state indication information of the target custom resource is changed from the new state to the copy state. In the context of virtual machine (VM) management, a snapshot refers to the process of copying or recording the disk state of a virtual machine at a specific time point for backup and recovery purposes. The snapshot preserves the hierarchy of all files and file systems of the virtual machine at the time the snapshot is created, and can be used to restore to the state represented by the snapshot when needed.

[0041] In the technical solution provided in step S202, the target custom resource at least includes a target address and state indication information, the state indication information is used to reflect the full life cycle of the to-be-backed-up virtual machine during backup, and the initial state of the state indication information is a new state. The target address is an address for backing up the to-be-backed-up virtual machine instance outside the containerized management cluster running the to-be-backed-up virtual machine instance.

[0042] Before step S202 is executed, the user first needs to create and configure the target custom resource (for example, named VMUploader) in the containerized management cluster (for example, a Kubernetes cluster). The target custom resource includes defining and configuring resource specifications and resource states.

[0043] The resource specification includes the following fields: destination: defines the server address of the cloud storage service to which the backup data will be transmitted, for example, an address using an S3-compatible interface; source: used to specify the virtual machine instance to be backed up, including an Application Programming Interface (API) group field (apiGroup) used to identify the KubeVirt extension API group to which the virtual machine instance belongs, a type field (kind) used to specify the type of virtual machine instance managed by KubeVirt, and a to-be-backed-up virtual machine name (name) used to define the virtual machine name; volumeFormat: the aforementioned second environment variable, used to specify a preset compression algorithm, for example, the preset compression algorithm is zstd or gzip (zstd is a high-efficiency compression algorithm designed to provide high-speed compression and decompression performance, especially in cloud-native environments that require high-efficiency data transmission and storage; gzip is a widely used file format and compression algorithm, commonly used to compress individual files, it can provide good compression ratio, while supporting the ability to preserve original file attributes such as timestamps and permissions and perform error detection), to optimize storage space and transmission speed. The setting of this parameter is crucial to the performance of the entire backup process, especially when dealing with large-scale virtual machine storage volumes; uploadName: used to identify a specific backup upload task; accessKeySecretRef: references a Secret (in the Kubernetes environment, Secret is an object type used to store sensitive data, Secret can store data in text or binary form, and is encapsulated in an opaque data structure, once Secret is created, it can be configured in a container or higher-level resource, as a secret volume or environment variable injected into the container, thus providing sensitive information to the application at runtime) resource in the Kubernetes cluster, which stores the authentication information required to access the cloud storage service. This is a necessary condition for secure and compliant data transmission, ensuring the confidentiality and integrity of the backup data.

[0044] The resource state includes the condition and health state fields (condition) and the virtual machine description file (VMSpec).

[0045] Condition and health status field (condition): provides a set of timestamps and status identifiers for monitoring the health status and event progress of the VMUploader resource. In each condition entry, the following information is included: lastProbeTime: indicates the timestamp of the last time the condition was probed, in UTC time format; lastTransitionTime: records the time when the last change of the condition state occurred; message: provides specific information or description related to the state, such as detailed description of any warnings or errors encountered during the backup process; reason: explains the reason for the state change, for example, the reason for backup success, failure or in progress; status: indicates the condition state as a Boolean value; type: the type of condition, used to classify various health checks or operation states. Current operation task (phase): that is, the above state indication information, used to reflect the full life cycle of the virtual machine to be backed up during the backup process, initially in the new state (New), and the following states: virtual machine copying state (i.e. the above copying state, represented by Copying), ready to upload state (i.e. the above ready state, represented by Ready), uploading state (i.e. the above virtual machine backup state, represented by Uploading), success state (i.e. the above backup success state, represented by Success), and failure state (Failed).

[0046] Virtual Machine Specification (VMSpec): Stores the complete description of a virtual machine instance in YAML format. This file contains detailed parameters such as computing resources (e.g., CPU and memory), storage resources (e.g., disk size and type), and configuration information, including but not limited to the number of CPUs, memory size, disk configuration, network interface settings, and any additional storage volumes and other configuration parameters. During backup and recovery operations, the virtual machine description file ensures consistency in virtual machine definitions, allowing for quick reconstruction of virtual machine instances with the same configuration based on backup files without the need for reconfiguration. The virtual machine description file includes the data volume state and backup progress field (volumes): The volumes field is an array that tracks the backup status of data volumes in the virtual machine instance. Each data volume entry includes: Backup name (name): Indicates the name of the backed-up storage volume (or data volume), Progress (progress): Displays the current progress of the storage volume (or data volume) backup in percentage. Original name (volumeName): Refers to the original name of the corresponding storage volume (or data volume) in the virtual machine instance, which is the storage volume (or data volume) identifier in the virtual machine definition before backup, used to associate the backup file with the original disk.

[0047] The controller for virtual machine backup (e.g., named VMUploaderReconciler) automatically performs a series of backup operations such as virtual machine snapshot creation, data transfer, and state monitoring in the containerized management cluster according to the configuration of the target custom resource, without the need for manual intervention, achieving automated management of the virtual machine backup process. This design not only simplifies backup operations but also improves the reliability and efficiency of backup tasks, while ensuring the security of data transfer through the security mechanisms within the cluster.

[0048] There are multiple ways to create a snapshot of the virtual machine instance to be backed up according to the target custom resource and change the state indication information of the target custom resource from the new state to the copy state, such as: locating the virtual machine instance to be backed up according to the virtual machine name in the target custom resource, and verifying the running state of the virtual machine instance to be backed up; in the case that the running state of the virtual machine instance to be backed up meets the snapshot creation condition, initiating a virtual machine snapshot resource creation request to the containerized management cluster to create a snapshot; in the case that the snapshot creation is monitored to be completed, changing the state indication information of the target custom resource from the new state to the copy state.

[0049] As some embodiments of the present application:

[0050] The controller first parses the data source (source) field in the resource specification in the target custom resource, extracting the apiGroup, kind, and the name of the virtual machine to be backed up. Then, through the API interface of KubeVirt, it queries the virtual machine instance with the name of the virtual machine to be backed up in the specified apiGroup and kind, i.e., locates the virtual machine instance to be backed up. Then, the running state of the virtual machine instance to be backed up is verified: whether the virtual machine is in a stable running state or a shutdown state, and if it is in a stable running or shutdown state, the verification is passed. Once the state of the virtual machine is verified, it is determined that the running state of the virtual machine instance to be backed up meets the conditions for creating a snapshot. The controller initiates a virtual machine snapshot (virtualmachine snapshot) resource creation request to the containerized management cluster. In this request, the VolumeSnapshotClass of the underlying storage must be specified. VolumeSnapshotClass is a custom resource in Kubernetes that defines the class of storage snapshot operations. It determines how to create and manage snapshots of storage volumes on specific storage backends, such as local storage or cloud storage services (S3-compatible storage, etc.). VolumeSnapshotClass contains all the configuration information required for snapshot creation, such as snapshot drivers, parameters, and where and how to store snapshot metadata. The controller strictly checks the configuration of VolumeSnapshotClass to ensure that it meets the compatibility and performance requirements of the target address (e.g., cloud storage services such as S3), avoiding snapshot creation failures or data recovery problems due to improper configuration. After receiving the request, KubeVirt of the containerized management cluster creates a virtual machine snapshot (virtualmachine snapshot) resource and creates a snapshot of the virtual machine instance to be backed up. During the creation of the snapshot of the virtual machine instance to be backed up, the controller will enable an asynchronous listener to continuously monitor the progress of snapshot creation. Specifically, it listens for changes in the readyToUse state field of the virtual machine snapshot (virtualmachine snapshot) resource (when readyToUse becomes true, it indicates that the snapshot has been successfully created and can be used for subsequent operations such as data transfer or the creation of backup files). When the readyToUse state becomes true, i.e., the snapshot creation is complete and ready for use, the controller changes the state indication information of the target custom resource from the new state to the copying state. This state change marks the completion of the snapshot creation phase, and the copying state indicates that the step of creating a virtual machine copy based on the snapshot will be performed.

[0051] In step S204, when the state indication information is in the copying state, a virtual machine copy of the virtual machine instance to be backed up is created based on the snapshot, and the state indication information is changed from the copying state to the ready state.

[0052] In the technical solution provided in step S204, there are various implementation manners for creating the virtual machine copy of the virtual machine instance to be backed up according to the snapshot, for example: creating a target virtual machine instance according to the snapshot, wherein the target virtual machine instance uses the same configuration parameters as the virtual machine instance to be backed up; determining the target virtual machine instance as the virtual machine copy, and setting the state of the virtual machine copy as the shutdown state. There are various implementation manners for changing the state indication information from the copying state to the ready state, for example: creating a storage volume for the virtual machine copy when the virtual machine copy is in the shutdown state, and restoring the data in the storage volume of the virtual machine instance to be backed up in the snapshot in the storage volume; in the case where all the storage volumes of the virtual machine copy have restored the data in the storage volumes of the corresponding virtual machine instance to be backed up in the snapshot, changing the state indication information from the copying state to the ready state.

[0053] As some embodiments of the present application:

[0054] In the case of the state indication information being a copy state, the controller extracts the content of the snapshot created in the previous stage to obtain the configuration parameters (such as the number of CPUs, the size of memory, network configuration, and the like) of the virtual machine instance to be backed up, creates a target virtual machine instance using the same configuration parameters as the virtual machine instance to be backed up, determines the target virtual machine instance as a virtual machine copy, and sets the state of the virtual machine copy to a shutdown state, thereby ensuring data silence when the disk data is restored and avoiding the risk of data inconsistency caused by the running of the copy. When the virtual machine copy is in the shutdown state, the controller automatically links the CDI to create a storage volume (or data volume) associated with the virtual machine copy. Each storage volume (or data volume) corresponds to a storage volume (or data volume) of the virtual machine instance to be backed up, and is used for the restoration of the snapshot data of the storage volume (or data volume) to realize storage layer isolation replication. The CDI extracts data from the snapshot according to the mechanism specified by the volume snapshot class and restores the data into the new storage volume (or data volume) of the virtual machine copy. In order to monitor the configuration validation of the virtual machine copy and the resource readiness state, the controller starts the K8s watch mechanism (K8s Watch mechanism is a low-level event notification system that allows clients (such as controllers and applications) to subscribe and receive real-time change events of Kubernetes resources) to create a listener that continuously monitors the metadata.generation field of the virtual machine copy (the metadata.generation field is a field used to track the configuration change history of the resource, and once a change in metadata.generation is observed, a configuration update event occurs). Upon observing the change event (i.e., a change in the metadata.generation field), it is confirmed that all configuration changes have been correctly applied. At the same time, the restoration state of the storage volume (or data volume) associated with the virtual machine copy is monitored until the restoration state of all storage volumes (or data volumes) is Succeeded, indicating that all storage volumes (or data volumes) have successfully restored. Then, the binding of each storage volume (or data volume) to the corresponding PVC is checked to ensure that each PVC has been successfully bound to the corresponding storage volume (or data volume) and that the capacity size matches that of the storage volume (or data volume) of the original virtual machine instance.

[0055] The case of simultaneously satisfying the above conditions determines that all storage volumes of the virtual machine copy have restored the data in the storage volumes of the virtual machine instance to be backed up in the snapshot, changes the state indication information from the copy state to the ready state, indicating that the snapshot-based virtual machine copy creation stage is complete, and the virtual machine copy is in the ready state and can perform further data transmission or storage operations.

[0056] Step S206, in the case of the state indication information being the ready state, uploading the virtual machine description information in the virtual machine copy to the target address by creating a first transfer task in the containerized management cluster, and changing the state indication information from the ready state to the virtual machine backup in state.

[0057] In the technical solution provided in step S206, the virtual machine description information at least includes configuration information of the virtual machine copy. There are various implementation manners for uploading the virtual machine description information in the virtual machine copy to the target address by creating a first transfer task in the containerized management cluster, for example: converting the virtual machine description information in the virtual machine copy into a preset data format to obtain the virtual machine description information after format conversion; storing the virtual machine description information after format conversion into a configuration mapping object of the containerized management cluster, wherein the configuration mapping object is a resource object in the containerized management cluster for storing configuration data, adding access credentials of the target address in a secret volume of the containerized management cluster, and presetting a first environment variable, wherein the first environment variable is used to define a transfer rule of the virtual machine description information; creating the first transfer task at least according to the first environment variable, and uploading the virtual machine description information after format conversion to the target address by a first transfer task node running the first transfer task according to the configuration mapping object and the secret volume.

[0058] As some embodiments of the present application:

[0059] In the case of the state indication information being the ready state, the description information of the virtual machine copy (i.e., obtained from the target custom resource) is converted into a preset data format (for example, data in YAML format), and then stored in a configuration mapping object (for example, the configuration mapping object is a ConfigMap resource of Kubernetes) of the containerized management cluster (the ConfigMap is a standard resource in Kubernetes, used to store and manage non-confidential configuration data, and the ConfigMap serves as a container for configuration data, ensuring the persistence and accessibility of the description information). Then the access credentials of the target address are injected into a secret volume of the containerized management cluster, that is, the access credentials (sensitive data related to the target address, such as the access endpoint (endpoint refers to the access entry address) of the target address service and the access credentials (used for identity verification)) of the target address are injected into the secret volume (Secret is also a resource type in Kubernetes, used to store and manage sensitive information such as passwords, keys, certificates, access tokens, etc.), while a first environment variable is preset to define the transmission path rule of the virtual machine description information (including the target path on the target address uploaded, the file name, etc., to ensure that the data is uploaded to the correct storage location). According to the first environment variable, a first transmission task (Job object, Job is a batch task in Kubernetes, used to perform one-time work until the completion of the scheduled task) is created, and when the virtual machine description information converted in the format is uploaded to the target address through a first transmission task node (for example, a container (Pod) in a K8s cluster) running the first transmission task according to the configuration mapping object and the secret volume, the first transmission task node will be configured to use the previously created configuration mapping object and secret volume as the data source and authentication information. The program in the first transmission task node will read these information and perform the operation of uploading data to the target according to the preset transmission path rule. Specifically: first, initialize the client of the target address (for example, S3 client) through the first transmission task node, and perform identity verification with the target address and the injected access credentials of the target address. After successful verification, create a directory structure with version control in the target address according to the upload task name in the target custom resource. Apply the checksum verification mechanism to transmit the virtual machine description information converted in the format stored in the configuration mapping object to the target address, and after the upload is completed, write a success marker file to confirm the integrity of the upload process and trigger the subsequent backup state update. In the case that the checksum verification mechanism passes, the controller updates the state indication information of the target custom resource instance, changes the state indication information from the ready state to the virtual machine backup state, indicating that the transmission backup process is in progress. Being in the virtual machine backup state means that the step of uploading the storage volume in the virtual machine copy to the target address by creating a second transmission task in the containerized management cluster will be performed.

[0060] In step S208, in the case that the state indication information is in the virtual machine backup in progress state, the storage volumes in the virtual machine copy are uploaded to the target address by creating a second transfer task in the containerized management cluster, and the state indication information is changed from the virtual machine backup in progress state to the backup success state. There are various implementation manners for uploading the storage volumes in the virtual machine copy to the target address by creating a second transfer task in the containerized management cluster, and changing the state indication information from the virtual machine backup in progress state to the backup success state indication information. For example, a second transfer task is created for each persistent volume claim in the virtual machine copy, wherein each storage volume corresponds to a persistent volume claim; the following steps are performed for each second transfer task: mounting the corresponding storage volume read path according to the type of the persistent volume claim; reading the data of the storage volume in the storage volume read path by the second transfer task node, and uploading the data to the target address. In the case that all second transfer task nodes have executed the second transfer task, the state indication information is changed from the virtual machine backup in progress state to the backup success state.

[0061] In the above steps, there are various implementation manners for reading the data of the storage volume in the storage volume read path by the second transfer task node and uploading the data to the target address. For example, a second environment variable is added to each second transfer task, wherein the second environment variable is used to define a preset compression format; the data of the storage volume is compressed by the second transfer task node according to the preset compression format in the second environment variable to obtain compressed data, and the compressed data is uploaded to the target address.

[0062] As some embodiments of the present application:

[0063] For each persistent volume declaration (PVC) in the virtual machine replica, a corresponding second transfer task (e.g., a Job object) is created. Each storage volume corresponds to one persistent volume declaration, ensuring the number of tasks matches the number of storage volume declarations. Each second transfer task mounts its corresponding PVC and is configured to read data from the storage volume (or data volume). For each second transfer task, the corresponding storage volume read path is mounted according to the type of the persistent volume declaration (PVC): for PVCs existing as raw block devices, the raw device path is directly mounted to enable direct reading of the storage volume data. For PVCs of filesystem type, the mount path (i.e., which directory within the container will serve as the access point for the storage volume corresponding to the mount path) is resolved to locate the storage volume file, facilitating subsequent data reading and processing. Then, the data of the storage volume is read from the storage volume read path and uploaded to the target address. For example, the following method can be used: A second environment variable (defining a compression algorithm such as gzip or zstd) is added to each second transmission task node. Before adding the preset second environment variable to the second transmission task, the transmission rules and secret volume of the virtual machine description information indicated by the first environment variable in step S206 need to be injected into each second transmission task. After completing the above steps, each second transmission task node compresses the data of the corresponding storage volume (or data volume) according to the preset compression format specified in the second preset environment variable. Segmented compression technology is used during compression to ensure efficient processing of large files. The compressed data is uploaded to the target address in a segmented, compressed-while-uploading manner. Each second transmission task node embeds a Hypertext Transfer Protocol (HTTP) server and obtains real-time progress information through the / progress endpoint exposed by the HTTP server (the / progress endpoint refers to a specific Uniform Resource Locator (URL) path opened in the embedded HTTP server for reporting the real-time progress of data upload). The controller periodically (e.g., every 1 second) collects the percentage of upload progress data from each secondary transmission task node from these / progress endpoints. Upon detecting an abnormal state (such as upload failure, timeout, etc.), it automatically triggers the secondary transmission task restart mechanism to ensure the continuity and stability of data transmission. After verifying that the completion time (status.completionTime, representing the moment when a specific task or job (e.g., Job) is fully completed) of all secondary transmission tasks exists and there are no failure records, it is confirmed that all secondary transmission task nodes have completed their secondary transmission tasks.The change of the status indicator from "Backing up the virtual machine" to "Backing up successfully" signifies the successful completion of the entire virtual machine backup process.

[0064] When any of the steps S202-S208 above occurs abnormally (such as network failure, data transmission failure, or resource conflict), the status indication information of the target custom resource will immediately change to a failure status, and abnormal handling will be performed. This includes resource cleanup (automatically deleting or rolling back temporary resources created in the abnormal step, such as incomplete snapshots, partially uploaded files, and tasks in an abnormal state, to avoid resource waste and system state inconsistency) and generating an audit event (recording the abnormal status and the timestamp of the abnormal occurrence). Then, the backup process ends. The method in this embodiment supports breakpoint resumption, and can continue subsequent operations from the identified status of the target custom resource.

[0065] In addition, after the backup process is complete, to maintain system cleanliness and effective resource management, the controller automatically cleans up unnecessary temporary resources according to predefined retention policies (such as retaining the most recent preset number of virtual machine backups). These resources include tasks used in the transfer process (including the first or second task), task nodes corresponding to those tasks, or intermediate data volumes. This helps prevent resource leaks, saves storage space, and maintains a good operating environment. During the backup process, the controller and other related components (such as task nodes executing tasks) generate a series of events. These events record various important states and operations of the backup process, such as job creation, the start and completion of data uploads, and the occurrence of abnormal states. These event streams will be collected by the auditing system for detailed analysis and historical record review, aiding in future problem diagnosis and process auditing. Furthermore, the controller continuously updates the condition and health status fields of the target custom resources to reflect the current health status of the backup process. This includes, but is not limited to, the backup preparation status, upload progress, and the detection and recovery status of abnormal situations. Through this mechanism, external systems or administrators can obtain the latest status of backup tasks for real-time monitoring or automated management.

[0066] The method in this embodiment constructs a complete lifecycle through a four-level state transition (New→Copying→Ready→Uploading→Succeeded), with independent checkpoints and automatic rollback mechanisms at each stage. Fault recovery time is down to the second level, achieving eventual consistency in large-scale transmission scenarios. When restoring a virtual machine via snapshot, it is forcibly set to a shutdown state, triggering the creation of an isolated DataVolume via CDI. The virtual machine copy generation process has zero data conflicts, reducing temporary storage usage. Dynamically identifying storage volume types and combining preset compression algorithms with segmented compression and a simultaneous compression and transmission strategy reduces the time required to transfer a 1TB file by 40%, achieving network bandwidth utilization ≥95%. The controller collects status data in real time and triggers task restarts. Improved operational response speed and reduced need for manual intervention decrease the backup process and performance overhead.

[0067] Figure 3This is a flowchart illustrating another virtual machine backup method provided in this application embodiment. The flowchart shows the process of the method in this application embodiment. First, when the status indicator information of the target custom resource instance is in the "new" state, the controller verifies the status of the virtual machine instance. If the status is compliant, a snapshot of the virtual machine instance is created, and a listening event is initiated to monitor the snapshot creation. After completion, the status indicator information of the target custom resource instance changes to the "Copying" state (i.e., the snapshot of the virtual machine instance to be backed up is created based on the target custom resource, and the status indicator information of the target custom resource is changed from the "new" state to the "copying" state). When the status indicator information of the target custom resource instance is in the "Copying" state, the controller restores the virtual machine copy, creates a DataVolume, and binds it to a PVC. After completion, the status indicator information of the target custom resource instance changes to the "Ready" state (i.e., when the status indicator information is in the "copying" state, a virtual machine copy of the virtual machine instance to be backed up is created based on the snapshot, and the status indicator information is changed from the "copying" state to the "ready" state). When the target custom resource instance's status indicator is in the Ready state, the controller serializes the virtual machine description file and creates a transfer task to perform the upload. After completion, the target custom resource instance's status indicator changes to the Uploading state (i.e., when the status indicator is in the Ready state, the first transfer task is created in the containerized management cluster to upload the virtual machine description information in the virtual machine replica to the target address, and the status indicator changes from the Ready state to the Virtual Machine Backup state). When the target custom resource instance's status indicator is in the Uploading state, the controller creates a transfer task, dynamically mounts the PVC, and segments and compresses the data of the uploaded storage volume, monitoring the task completion status in real time. When all tasks are completed, the backup is successful, and the target custom resource instance's status indicator changes to the Successed state (i.e., when the status indicator is in the Virtual Machine Backup state, the second transfer task is created in the containerized management cluster to upload the storage volume in the virtual machine replica to the target address, and the status indicator changes from the Virtual Machine Backup state to the Backup Successful state), and the process ends. If an anomaly occurs in any of the above stages (e.g., during the new state stage, snapshot creation failure, abnormal DataVolume state during virtual machine copying, failure of the creation task in the ready state, abnormal execution or stagnation of the transmission task during upload), the status indication information of the target custom resource instance will change to the Failed state. The controller will then handle the anomaly, clean up the resources, and generate an audit event.

[0068] This application also provides a schematic diagram of the structure of a virtual machine backup device, as shown in the embodiments. Figure 4As shown, it includes:

[0069] The first creation module 402 is used to create a snapshot of the virtual machine instance to be backed up based on the target custom resource, and change the status indication information of the target custom resource from the new state to the copy state. The target custom resource includes at least the target address and status indication information. The status indication information is used to reflect the entire life cycle of the virtual machine to be backed up. The initial state of the status indication information is the new state, and the target address is the address of the virtual machine instance to be backed up that is located outside the containerized management cluster running the virtual machine instance to be backed up.

[0070] The second creation module 404 is used to create a virtual machine copy of the virtual machine instance to be backed up based on the snapshot when the status indication information is in the copy state, and change the status indication information from the copy state to the ready state.

[0071] The first upload module 406 is used to upload the virtual machine description information in the virtual machine replica to the target address by creating a first transmission task in the containerized management cluster when the status indication information is in the ready state, and change the status indication information from the ready state to the virtual machine backup state. The virtual machine description information includes at least the configuration information of the virtual machine replica.

[0072] The second upload module 408 is used to upload the storage volume in the virtual machine replica to the target address by creating a second transfer task in the containerized management cluster when the status indication information is in the virtual machine backup state, and change the status indication information from the virtual machine backup state to the backup successful state.

[0073] It should be noted that, Figure 4 The virtual machine backup device shown is used to execute Figure 2 The virtual machine backup method shown is therefore Figure 2 The explanations and instructions regarding the backup methods for virtual machines also apply to the backup devices for this virtual machine, and will not be repeated here.

[0074] It should be noted that the modules in the aforementioned virtual machine backup device can be program modules (e.g., a set of program instructions that implement a specific function) or hardware modules. For the latter, they can take the following forms, but are not limited to them: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0075] This application also provides a non-volatile storage medium, which includes a stored program, wherein, when the program is running, it controls the device where the non-volatile storage medium is located to execute the virtual machine backup method of any of the above embodiments.

[0076] This application also provides an electronic device, which includes a processor for running a program, wherein the virtual machine backup method of any of the above embodiments is executed during program execution.

[0077] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the virtual machine backup method of any of the above embodiments.

[0078] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0079] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0080] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0082] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0083] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for backing up a virtual machine, characterized in that, include: A snapshot of the virtual machine instance to be backed up is created based on the target custom resource, and the status indication information of the target custom resource is changed from the new state to the copy state. The target custom resource includes at least a target address and the status indication information. The status indication information is used to reflect the entire lifecycle of the backup of the virtual machine to be backed up. The initial state of the status indication information is the new state. The target address is the address of the backup of the virtual machine instance located outside the containerized management cluster running the virtual machine instance to be backed up. When the status indication information is in the copy state, a virtual machine copy of the virtual machine instance to be backed up is created based on the snapshot, and the status indication information is changed from the copy state to the ready state; When the status indication information is in the ready state, a first transmission task is created in the containerized management cluster to upload the virtual machine description information in the virtual machine replica to the target address, and the status indication information is changed from the ready state to the virtual machine backup state, wherein the virtual machine description information includes at least the configuration information of the virtual machine replica; If the status indication information indicates that the virtual machine is being backed up, a second transfer task is created in the containerized management cluster to upload the storage volume in the virtual machine replica to the target address, and the status indication information is changed from the virtual machine being backed up to the backup successful status.

2. The method according to claim 1, characterized in that, The step of creating a snapshot of the virtual machine instance to be backed up based on the target custom resource, and changing the status indication information of the target custom resource from the newly created status to the copy status, includes: Locate the virtual machine instance to be backed up based on the name of the virtual machine to be backed up in the target custom resource, and verify the running status of the virtual machine instance to be backed up; If the running status of the virtual machine instance to be backed up meets the conditions for snapshot creation, a virtual machine snapshot resource creation request is initiated to the containerized management cluster to create the snapshot; Upon detecting that the snapshot creation is complete, the status indication information of the target custom resource is changed from the newly created status to the copied status.

3. The method according to claim 1, characterized in that, Creating a virtual machine copy of the virtual machine instance to be backed up based on the snapshot includes: Create a target virtual machine instance based on the snapshot, wherein the target virtual machine instance uses the same configuration parameters as the virtual machine instance to be backed up; The target virtual machine instance is identified as the virtual machine copy, and the status of the virtual machine copy is set to the shutdown state.

4. The method according to claim 1, characterized in that, The step of changing the status indication information from the copy state to the ready state includes: While the virtual machine copy is powered off, a storage volume is created for the virtual machine copy, and the data in the storage volume of the virtual machine instance to be backed up in the snapshot is restored in the storage volume; If all storage volumes of the virtual machine replica have restored the data in the storage volume of the virtual machine instance to be backed up in the snapshot, the status indication information will be changed from the copy status to the ready status.

5. The method according to claim 1, characterized in that, The step of uploading the virtual machine description information from the virtual machine replica to the target address by creating a first transmission task in the containerized management cluster includes: The virtual machine description information in the virtual machine copy is converted into a preset data format to obtain the format-converted virtual machine description information. The converted virtual machine description information is stored in the configuration mapping object of the containerized management cluster, and the access credentials of the target address are added to at least the secret volume of the containerized management cluster. A first environment variable is preset, wherein the configuration mapping object is a resource object in the containerized management cluster used to store configuration data, and the first environment variable is used to define the transmission rules of the virtual machine description information. The first transfer task is created based on at least the first environment variable, and the first transfer task node running the first transfer task uploads the virtual machine description information after the format conversion to the target address based on the configuration mapping object and the secret volume.

6. The method according to claim 1, characterized in that, The step of uploading the storage volume in the virtual machine replica to the target address by creating a second transfer task in the containerized management cluster, and changing the status indication information from virtual machine backup to backup success status indication information, includes: Create a second transport task for each persistent volume claim in the virtual machine replica, wherein each storage volume corresponds to one persistent volume claim; For each of the second transfer tasks, mount the corresponding storage volume read path according to the type of the persistent volume declaration; The second transmission task node reads the data of the storage volume from the storage volume read path and uploads it to the target address; If it is detected that all nodes of the second transmission task have completed the second transmission task, the status indication information is changed from "in the virtual machine backup" to "backup successful".

7. The method according to claim 6, characterized in that, The step of reading the data of the storage volume in the storage volume read path through the second transmission task node and uploading it to the target address includes: Add a second environment variable to each of the second transmission task nodes, wherein the second environment variable is used to define a preset compression format; The second transmission task node compresses the data of the storage volume according to the preset compression format in the second environment variable to obtain compressed data, and then uploads the compressed data to the target address.

8. A virtual machine backup device, characterized in that, include: The first creation module is used to create a snapshot of the virtual machine instance to be backed up based on the target custom resource, and change the status indication information of the target custom resource from the new state to the copy state. The target custom resource includes at least a target address and the status indication information. The status indication information is used to reflect the entire lifecycle of the backup of the virtual machine to be backed up. The initial state of the status indication information is the new state. The target address is the address of the backup of the virtual machine instance located outside the containerized management cluster running the virtual machine instance to be backed up. The second creation module is used to create a virtual machine copy of the virtual machine instance to be backed up based on the snapshot when the status indication information is the copy status, and change the status indication information from the copy status to the ready status. The first upload module is configured to, when the status indication information is in the ready state, upload the virtual machine description information in the virtual machine replica to the target address by creating a first transmission task in the containerized management cluster, and change the status indication information from the ready state to the virtual machine backup state, wherein the virtual machine description information includes at least the configuration information of the virtual machine replica; The second upload module is used to upload the storage volume in the virtual machine replica to the target address by creating a second transfer task in the containerized management cluster when the status indication information is in the state of virtual machine backup, and change the status indication information from the state of virtual machine backup to the state of backup success.

9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program is executed, it controls the device where the non-volatile storage medium is located to execute the virtual machine backup method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the virtual machine backup method according to any one of claims 1 to 7.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the virtual machine backup method according to any one of claims 1 to 7.