CN111651239A - Virtual machine cloning method, device, equipment and medium - Google Patents

Virtual machine cloning method, device, equipment and medium Download PDF

Info

Publication number
CN111651239A
CN111651239A CN202010500392.3A CN202010500392A CN111651239A CN 111651239 A CN111651239 A CN 111651239A CN 202010500392 A CN202010500392 A CN 202010500392A CN 111651239 A CN111651239 A CN 111651239A
Authority
CN
China
Prior art keywords
virtual machine
target
snapshot
cloning
cloned
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010500392.3A
Other languages
Chinese (zh)
Inventor
聂璐
安宇新
洪家楠
刘爽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202010500392.3A priority Critical patent/CN111651239A/en
Publication of CN111651239A publication Critical patent/CN111651239A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The application discloses a virtual machine cloning method, a virtual machine cloning device, a virtual machine cloning equipment and a virtual machine cloning medium, wherein the method comprises the following steps: acquiring a virtual machine cloning instruction; starting a card I/O tool for forbidding issuing of a write instruction according to the virtual machine cloning instruction so as to control the target virtual machine to be cloned to be incapable of performing write operation; snapshot is conducted on the target virtual machine, and a target snapshot is obtained; and cloning the target snapshot to obtain a cloned virtual machine. Therefore, after the virtual machine cloning instruction is obtained, the card I/O tool is started according to the virtual machine cloning instruction to control the target virtual machine to be cloned to be incapable of performing write operation, then the target virtual machine is snapshot, and after the target snapshot is obtained, the target snapshot is cloned to obtain the cloned virtual machine.

Description

Virtual machine cloning method, device, equipment and medium
Technical Field
The present application relates to the field of virtual machine technologies, and in particular, to a virtual machine cloning method, apparatus, device, and medium.
Background
In some cases, it is necessary to clone, i.e. completely copy, the virtual machine, and ensure that the external parameters of the virtual machine and the data in the internal operating system are consistent with the original virtual machine. The traditional method for cloning the virtual machine of the database comprises the following steps: all virtual machines to be cloned in the cluster are shut down, and then the virtual machines and the data in the shared storage are cloned one by one, so that the consistency of the data can be ensured. The traditional technology has the following defects that firstly, the shutdown is needed, the service is cut off when the shutdown is needed, and the production loss is brought; secondly, the virtual machines to be cloned cannot be cloned at one time, the external storage is used as shared storage for a common cluster, the virtual machines are cloned, the stored data are independently copied to new external storage, the time required by the whole process is too long, and the efficiency is too low.
Disclosure of Invention
In view of this, an object of the present application is to provide a virtual machine cloning method, apparatus, device, and medium, which can complete cloning of all virtual machines to be cloned at one time without shutdown, save time, and achieve high cloning efficiency. The specific scheme is as follows:
in a first aspect, the present application discloses a virtual machine cloning method, including:
acquiring a virtual machine cloning instruction;
starting a card I/O tool for forbidding issuing of a write instruction according to the virtual machine cloning instruction so as to control the target virtual machine to be cloned to be incapable of performing write operation;
snapshot the target virtual machine to obtain a target snapshot;
and cloning the target snapshot to obtain a cloned virtual machine.
Optionally, the snapshot of the target virtual machine, after obtaining the target snapshot, further includes:
and closing the card I/O tool so that the target virtual machine carries out write operation.
Optionally, the closing the card I/O tool so that after the target virtual machine performs the write operation, further includes:
and issuing the write operation delayed during the starting period of the card I/O tool so as to update the data in the target virtual machine.
Optionally, the snapshot of the target virtual machine to obtain a target snapshot includes:
and shooting a row snapshot on the target virtual machine to obtain a target snapshot.
Optionally, the snapshot of the row on the target virtual machine to obtain the target snapshot includes:
making a row snapshot on the target virtual machine to enable an image file of the original target virtual machine to be in a read-only state;
creating a snapshot file so as to bear read-write operation of the target virtual machine during the snapshot of the row;
and taking the original target virtual machine image file as a target snapshot.
Optionally, the cloning the target snapshot to obtain a cloned virtual machine includes:
and copying the mirror image file of the original target virtual machine to obtain a cloned virtual machine.
Optionally, after cloning the target snapshot to obtain a cloned target virtual machine, the method further includes:
starting the clone virtual machine;
resetting the IP of the cloned virtual machine;
and checking the data consistency of the cloned virtual machine.
In a second aspect, the present application discloses a virtual machine cloning apparatus, including:
the instruction receiving module is used for acquiring a virtual machine cloning instruction;
the tool starting module is used for starting a target card I/O tool according to the virtual machine cloning instruction, so that the target virtual machine to be cloned can not carry out write operation;
the snapshot making module is used for making a snapshot on the target virtual machine to obtain a target snapshot;
and the cloning module is used for cloning the target snapshot to obtain a cloned virtual machine.
In a third aspect, the present application discloses a virtual machine cloning device, including:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the virtual machine cloning method disclosed above.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the virtual machine cloning method disclosed above.
Therefore, the method includes the steps of firstly obtaining a virtual machine cloning instruction, then starting a card I/O tool for forbidding issuing of a writing instruction according to the virtual machine cloning instruction to control a target virtual machine to be cloned to be incapable of writing operation, then snapshotting the target virtual machine to obtain a target snapshot, and cloning the target snapshot to obtain a cloned virtual machine. Therefore, after the virtual machine cloning instruction is obtained, the card I/O tool is started according to the virtual machine cloning instruction to control the target virtual machine to be cloned to be incapable of performing write operation, then the target virtual machine is snapshot, and after the target snapshot is obtained, the target snapshot is cloned to obtain the cloned virtual machine.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a virtual machine cloning method disclosed herein;
FIG. 2 is a flow chart of a particular virtual machine cloning method disclosed herein;
FIG. 3 is a diagram illustrating a specific virtual machine cloning activity process disclosed herein;
FIG. 4 is a flow diagram illustrating a specific virtual machine cloning process disclosed herein;
FIG. 5 is a schematic illustration of a snapshot clone disclosed herein;
fig. 6 is a schematic structural diagram of a virtual machine cloning apparatus disclosed in the present application;
FIG. 7 is a block diagram of a virtual machine cloning device as disclosed herein;
fig. 8 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The traditional method for cloning the virtual machine of the database comprises the following steps: all virtual machines to be cloned in the cluster are shut down, and then the virtual machines and the data in the shared storage are cloned one by one, so that the consistency of the data can be ensured. The traditional technology has the following defects that firstly, the shutdown is needed, the service is cut off when the shutdown is needed, and the production loss is brought; secondly, the virtual machines to be cloned cannot be cloned at one time, the external storage is used as shared storage for a common cluster, the virtual machines are cloned, the stored data are independently copied to new external storage, the time required by the whole process is too long, and the efficiency is too low. In view of this, the present application discloses a virtual machine cloning method, which can complete cloning of all virtual machines to be cloned at one time without shutdown, save time, and achieve high cloning efficiency, and can ensure data consistency of the obtained cloned virtual machines by snapshot.
Referring to fig. 1, an embodiment of the present application discloses a virtual machine cloning method, including:
step S11: and acquiring a virtual machine cloning instruction.
In a specific implementation process, a virtual machine cloning instruction needs to be obtained first, so as to determine which virtual machines need to be cloned and which virtual machines need to be cloned. The virtual machine cloning instruction comprises information of a target virtual machine to be cloned. A Virtual Machine (Virtual Machine) refers to a complete computer system which has complete hardware system functions and is simulated by software and runs in a completely isolated environment.
Step S12: and starting a card I/O tool for forbidding issuing of a write instruction according to the virtual machine cloning instruction so as to control the target virtual machine to be cloned to be incapable of performing write operation.
It can be understood that after the virtual machine clone instruction is acquired, a card I/O (Input/Output) tool for prohibiting issuing of a write instruction needs to be started according to the virtual machine clone instruction, so as to control that a target virtual machine to be cloned cannot perform a write operation. Specifically, after the virtual machine cloning instruction is obtained, the virtual machine cloning instruction is analyzed to determine a target virtual machine to be cloned, and a card I/O tool for prohibiting issuing of a write instruction is started to control the target virtual machine not to perform write operation, so that the target virtual machine maintains data consistency. The data consistency (Transaction consistency) is mainly to ensure consistency at a time point, and the consistency of transactions is maintained by a database self mechanism.
Step S13: and snapshot is carried out on the target virtual machine to obtain a target snapshot.
After the card I/O tool is started, the target virtual machine cannot be subjected to write operation, and then snapshot is also needed to be made on the target virtual machine, so that a target snapshot is obtained. Wherein a Snapshot (Snapshot) is a fully available copy of a given data set, the copy comprising an image of the corresponding data at a point in time, i.e. the point in time at which the copy began.
Step S14: and cloning the target snapshot to obtain a cloned virtual machine.
After the target snapshot is obtained, cloning the target snapshot to obtain a cloned virtual machine.
Therefore, the method includes the steps of firstly obtaining a virtual machine cloning instruction, then starting a card I/O tool for forbidding issuing of a writing instruction according to the virtual machine cloning instruction to control a target virtual machine to be cloned to be incapable of writing operation, then snapshotting the target virtual machine to obtain a target snapshot, and cloning the target snapshot to obtain a cloned virtual machine. Therefore, after the virtual machine cloning instruction is obtained, the card I/O tool is started according to the virtual machine cloning instruction to control the target virtual machine to be cloned to be incapable of performing write operation, then the target virtual machine is snapshot, and after the target snapshot is obtained, the target snapshot is cloned to obtain the cloned virtual machine.
Referring to fig. 2, an embodiment of the present application discloses a specific virtual machine cloning method, including:
step S21: and acquiring a virtual machine cloning instruction.
Step S22: and starting a card I/O tool for forbidding issuing of a write instruction according to the virtual machine cloning instruction so as to control the target virtual machine to be cloned to be incapable of performing write operation.
In a specific implementation process, after the virtual machine cloning instruction is acquired, a card I/O tool for prohibiting issuing of a write instruction is started to control that a target virtual machine to be cloned cannot perform write operation. When the target virtual machines form a complete cluster, all write operations of all the virtual machines in the original cluster can be prohibited at the same time point by using the card I/O tool, and the experience of a database in the cluster to the outside is that the read data is normal, but the write operations are blocked. The Cluster (Cluster) refers to that the same service is deployed on a plurality of servers, and the servers form a Cluster. Specifically, the control that the target virtual machine to be cloned cannot perform write operation is to control that the target virtual machine to be cloned cannot perform write operation on an image file of an original target virtual machine.
Step S23: and shooting a row snapshot on the target virtual machine to obtain a target snapshot.
After the card I/O tool is started, the target virtual machine also needs to be snapshot to obtain a target snapshot, wherein the snapshot includes but is not limited to snapshot of row. Correspondingly, the snapshot of the row on the target virtual machine to obtain the target snapshot includes: making a row snapshot on the target virtual machine to enable an image file of the original target virtual machine to be in a read-only state; creating a snapshot file so as to bear read-write operation of the target virtual machine during the snapshot of the row; and taking the original target virtual machine image file as a target snapshot. Creating a row snapshot takes only a few seconds, is very fast, and therefore has little impact on the user experience, but if data needs to be written at this time, it takes a few seconds for the user.
Step S24: and closing the card I/O tool so that the target virtual machine carries out write operation.
It can be understood that after the target snapshot is obtained, the card I/O tool needs to be shut down so that the target virtual machine performs normal write operation. And the closing the card I/O tool so that after the target virtual machine performs the write operation, further includes: and issuing the write operation delayed during the starting period of the card I/O tool so as to update the data in the target virtual machine. That is, after the snapshot of the target virtual machine is completed, the card I/O tool needs to be closed, so that the target virtual machine can perform normal read-write operation, and then the write operation delayed during the start of the card I/O tool is issued, so that the data in the target virtual machine is updated, and after the data is updated successfully, the original service is recovered to be normal.
Step S25: and cloning the target snapshot to obtain a cloned virtual machine.
In a specific implementation process, cloning the target snapshot to obtain a cloned virtual machine. Wherein, the cloning the target snapshot to obtain a cloned virtual machine includes: and copying the mirror image file of the original target virtual machine to obtain a cloned virtual machine. After the cloning of the target snapshot is performed to obtain the cloned target virtual machine, the method further includes: starting the clone virtual machine; resetting an IP (Internet Protocol) of the cloned virtual machine; and checking the data consistency of the cloned virtual machine. Specifically, the target snapshot is cloned to obtain a cloned virtual machine, the cloned virtual machine is started, an IP in the cloned virtual machine is reset, the data consistency of the cloned virtual machine is verified, and the cloned virtual machine can be normally used after the verification is passed.
Referring to fig. 3, a diagram of a virtual machine cloning activity process is shown. Taking an oracle database as an example, the original oracle database comprises four virtual machines, wherein three virtual machines are used as computing nodes and are responsible for data reading and writing, increasing, deleting, modifying, checking and other operations, and one virtual machine is left to be used as a storage server and provide a shared storage for the three computing nodes. That is, the original virtual machine 1, the original virtual machine 2, and the original virtual machine 3 serve as computing nodes, the original virtual machine 4 serves as a storage server to provide shared storage, and the original virtual machine 1, the original virtual machine 2, and the original virtual machine 3 can all perform read-write operations on the shared storage provided by the original virtual machine 4. Firstly, after a write I/O of an original cluster is clamped by using a card I/O tool, quickly taking a snapshot, creating a snapshot 1 for an original virtual machine 1, creating a snapshot 2 for an original virtual machine 2, creating a snapshot 3 for the original virtual machine 3, creating a snapshot 4 for the original virtual machine 4, cloning the snapshots 1 to 4 respectively to obtain corresponding new virtual machines 1 to 4, and then performing IP reset and data consistency check on each new virtual machine, wherein the new virtual machines 1 to 3 can perform read-write operation on shared storage provided by the new virtual machine 4 to obtain a new cluster.
Referring to fig. 4, a flowchart of virtual machine cloning is shown. Taking virtual machine cluster cloning with four virtual machines as an example, firstly using a card I/O tool to forbid all write operations of all virtual machines in an original cluster to be cloned at the same time point, then making a row snapshot for each virtual machine in the cluster, then removing the write operations of all virtual machines in the original cluster, cloning the four consistent snapshots, and then automatically forming a new cluster consistent with the original cluster snapshot state by the cloned four new virtual machines.
See fig. 5 for a schematic diagram of the cloning from snapshot. The virtual machine is essentially one or more image files, a snapshot is firstly made on the original virtual machine, so that the image file of the original virtual machine becomes read only, the newly created snapshot file is responsible for subsequent read-write operation, when data reading is needed, if target data is not hit in the snapshot file, the target data can be read from internal data of the virtual machine in a physical address of the original virtual machine, after the snapshot is finished, the data in the snapshot file is written into the physical address of the original virtual machine as new data generated by the original virtual machine, the data in the image file of the original virtual machine is copied and stored in a new storage space opened up by the new virtual machine, and the new virtual machine is obtained.
Referring to fig. 6, an embodiment of the present application discloses a virtual machine cloning apparatus, including:
the instruction receiving module 11 is configured to obtain a virtual machine cloning instruction;
the tool starting module 12 is configured to start a target card I/O tool according to the virtual machine cloning instruction, so that a target virtual machine to be cloned cannot perform write operation;
a snapshot module 13, configured to snapshot the target virtual machine to obtain a target snapshot;
and the cloning module 14 is configured to clone the target snapshot to obtain a cloned virtual machine.
Therefore, the method includes the steps of firstly obtaining a virtual machine cloning instruction, then starting a card I/O tool for forbidding issuing of a writing instruction according to the virtual machine cloning instruction to control a target virtual machine to be cloned to be incapable of writing operation, then snapshotting the target virtual machine to obtain a target snapshot, and cloning the target snapshot to obtain a cloned virtual machine. Therefore, after the virtual machine cloning instruction is obtained, the card I/O tool is started according to the virtual machine cloning instruction to control the target virtual machine to be cloned to be incapable of performing write operation, then the target virtual machine is snapshot, and after the target snapshot is obtained, the target snapshot is cloned to obtain the cloned virtual machine.
Further, the virtual machine cloning apparatus further includes:
and the tool closing module is used for closing the card I/O tool so as to facilitate the target virtual machine to perform write operation.
In a specific implementation process, the virtual machine cloning apparatus further includes:
and the operation issuing module is used for issuing the delayed write operation during the starting period of the card I/O tool so as to update the data in the target virtual machine.
Specifically, the snapshot module 13 is specifically configured to:
and shooting a row snapshot on the target virtual machine to obtain a target snapshot.
The snapshot module 13 includes:
the snapshot making unit is used for making a row snapshot on the target virtual machine so that the original target virtual machine image file is in a read-only state;
the file creating unit is used for creating a snapshot file so as to bear read-write operation of the target virtual machine during the snapshot of the row;
and the snapshot determining unit is used for taking the original target virtual machine image file as a target snapshot.
In a specific implementation, the cloning module 14 is specifically configured to:
and copying the mirror image file of the original target virtual machine to obtain a cloned virtual machine.
Further, the virtual machine cloning apparatus further includes:
the virtual machine starting module is used for starting the cloned virtual machine;
the IP resetting module is used for resetting the IP of the cloned virtual machine;
and the consistency checking module is used for checking the data consistency of the cloned virtual machine.
Further, referring to fig. 7, an embodiment of the present application further discloses a virtual machine cloning device, including: a processor 21 and a memory 22.
Wherein the memory 22 is used for storing a computer program; the processor 21 is configured to execute the computer program to implement the virtual machine cloning method disclosed in the foregoing embodiment.
For the specific process of the virtual machine cloning method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Referring to fig. 8, a schematic structural diagram of an electronic device 20 provided in the embodiment of the present application is shown, where the user terminal may specifically include, but is not limited to, a tablet computer, a notebook computer, or a desktop computer.
Generally, the electronic device 20 in the present embodiment has the processor 21 and the memory 22 disclosed in the foregoing embodiments.
The processor 21 may include one or more processing cores, such as a four-core processor, an eight-core processor, and so on. The processor 21 may be implemented by at least one hardware of a DSP (digital signal processing), an FPGA (field-programmable gate array), and a PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit) which is responsible for rendering and drawing images to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor for processing a calculation operation related to machine learning.
Memory 22 may include one or more computer-readable storage media, which may be non-transitory. Memory 22 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used for storing the computer program 221, wherein after being loaded and executed by the processor 21, the steps of the virtual machine cloning method disclosed in any one of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 22 may also include an operating system 222, data 223, and the like, and the storage manner may be a transient storage or a permanent storage. The operating system 222 may be Windows, Unix, Linux, or the like. Data 223 may include a wide variety of data.
In some embodiments, the electronic device 20 may further include a display 23, an input/output interface 24, a communication interface 25, a sensor 26, a power supply 27, and a communication bus 28.
Those skilled in the art will appreciate that the configuration shown in fig. 8 is not limiting to electronic device 20 and may include more or fewer components than those shown.
Further, an embodiment of the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the virtual machine cloning method disclosed in the foregoing embodiments.
For the specific process of the virtual machine cloning method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of other elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device, the equipment and the medium for cloning the virtual machine provided by the application are introduced in detail, a specific example is applied in the description to explain the principle and the implementation of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A virtual machine cloning method is characterized by comprising the following steps:
acquiring a virtual machine cloning instruction;
starting a card I/O tool for forbidding issuing of a write instruction according to the virtual machine cloning instruction so as to control the target virtual machine to be cloned to be incapable of performing write operation;
snapshot the target virtual machine to obtain a target snapshot;
and cloning the target snapshot to obtain a cloned virtual machine.
2. The virtual machine cloning method according to claim 1, wherein the snapshotting the target virtual machine, and after obtaining the target snapshot, further comprises:
and closing the card I/O tool so that the target virtual machine carries out write operation.
3. The virtual machine cloning method of claim 2, wherein, after the shutting down the card I/O tool for the target virtual machine to perform a write operation, further comprising:
and issuing the write operation delayed during the starting period of the card I/O tool so as to update the data in the target virtual machine.
4. The virtual machine cloning method of claim 1, wherein the snapshotting the target virtual machine to obtain a target snapshot comprises:
and shooting a row snapshot on the target virtual machine to obtain a target snapshot.
5. The virtual machine cloning method of claim 4, wherein the snapshotting the target virtual machine to obtain a target snapshot comprises:
making a row snapshot on the target virtual machine to enable an image file of the original target virtual machine to be in a read-only state;
creating a snapshot file so as to bear read-write operation of the target virtual machine during the snapshot of the row;
and taking the original target virtual machine image file as a target snapshot.
6. The virtual machine cloning method according to claim 5, wherein the cloning the target snapshot to obtain a cloned virtual machine comprises:
and copying the mirror image file of the original target virtual machine to obtain a cloned virtual machine.
7. The virtual machine cloning method according to any one of claims 1 to 6, wherein after cloning the target snapshot to obtain a cloned target virtual machine, the method further comprises:
starting the clone virtual machine;
resetting the IP of the cloned virtual machine;
and checking the data consistency of the cloned virtual machine.
8. A virtual machine cloning apparatus, comprising:
the instruction receiving module is used for acquiring a virtual machine cloning instruction;
the tool starting module is used for starting a target card I/O tool according to the virtual machine cloning instruction, so that the target virtual machine to be cloned can not carry out write operation;
the snapshot making module is used for making a snapshot on the target virtual machine to obtain a target snapshot;
and the cloning module is used for cloning the target snapshot to obtain a cloned virtual machine.
9. A virtual machine cloning device, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor configured to execute the computer program to implement the virtual machine cloning method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the virtual machine cloning method of any one of claims 1 to 7.
CN202010500392.3A 2020-06-04 2020-06-04 Virtual machine cloning method, device, equipment and medium Pending CN111651239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010500392.3A CN111651239A (en) 2020-06-04 2020-06-04 Virtual machine cloning method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010500392.3A CN111651239A (en) 2020-06-04 2020-06-04 Virtual machine cloning method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN111651239A true CN111651239A (en) 2020-09-11

Family

ID=72348770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010500392.3A Pending CN111651239A (en) 2020-06-04 2020-06-04 Virtual machine cloning method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111651239A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399774A (en) * 2020-03-09 2020-07-10 星辰天合(北京)数据科技有限公司 Data processing method and device based on snapshot under distributed storage system
CN112181596A (en) * 2020-10-10 2021-01-05 济南浪潮数据技术有限公司 Virtual machine cloning method, device, equipment and storage medium
CN114385076A (en) * 2021-12-09 2022-04-22 苏州浪潮智能科技有限公司 Method and device for accelerating virtual machine disk cloning based on shared storage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011178A1 (en) * 2008-07-14 2010-01-14 Vizioncore, Inc. Systems and methods for performing backup operations of virtual machine files
CN104468734A (en) * 2014-11-18 2015-03-25 国云科技股份有限公司 Virtual cluster expanding method based on cloning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011178A1 (en) * 2008-07-14 2010-01-14 Vizioncore, Inc. Systems and methods for performing backup operations of virtual machine files
CN104468734A (en) * 2014-11-18 2015-03-25 国云科技股份有限公司 Virtual cluster expanding method based on cloning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘振洪 等: "Linux操作系统实用教程", 31 May 2015, 电子科技大学出版社, pages: 148 - 152 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399774A (en) * 2020-03-09 2020-07-10 星辰天合(北京)数据科技有限公司 Data processing method and device based on snapshot under distributed storage system
CN111399774B (en) * 2020-03-09 2021-09-14 星辰天合(北京)数据科技有限公司 Data processing method and device based on snapshot under distributed storage system
CN112181596A (en) * 2020-10-10 2021-01-05 济南浪潮数据技术有限公司 Virtual machine cloning method, device, equipment and storage medium
CN112181596B (en) * 2020-10-10 2023-05-12 济南浪潮数据技术有限公司 Virtual machine cloning method, device, equipment and storage medium
CN114385076A (en) * 2021-12-09 2022-04-22 苏州浪潮智能科技有限公司 Method and device for accelerating virtual machine disk cloning based on shared storage
CN114385076B (en) * 2021-12-09 2023-08-25 苏州浪潮智能科技有限公司 Method and device for accelerating cloning of virtual machine disk based on shared storage

Similar Documents

Publication Publication Date Title
CN111651239A (en) Virtual machine cloning method, device, equipment and medium
CN107291883B (en) Snapshot method and device of distributed storage system
CN112199162B (en) Disk snapshot method, device and medium based on virtualized disk double-active disaster tolerance
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
WO2020019458A1 (en) Page switching method of hybrid application, framework, computer device and storage medium
CN107562578B (en) Snapshot creating method, device, equipment and storage medium for stored data
CN111625546B (en) Data writing method, device, equipment and medium
US10031948B1 (en) Idempotence service
CN106569904A (en) Information storage method and device and server
US20180139280A1 (en) Methods and apparatuses for cluster switching
CN111857966A (en) Virtual machine snapshot creating method and device and computer readable storage medium
WO2018059565A1 (en) Method and system for backing up flash memory data
CN112732427A (en) Data processing method, system and related device based on Redis cluster
WO2023206926A1 (en) User configuration data recovery method and device, and medium
CN114138424B (en) Virtual machine memory snapshot generation method and device and electronic equipment
CN110658993A (en) Snapshot rollback method, device, equipment and storage medium
CN112269531B (en) Source roll capacity reduction method, device, equipment and medium
CN115145634A (en) System management software self-adaption method, device and medium
CN114461341A (en) Method, device and medium for preventing brain crack of cloud platform virtual machine
CN111881212A (en) Method, device, equipment and storage medium for executing check point operation
CN111399774A (en) Data processing method and device based on snapshot under distributed storage system
CN111400093B (en) Configuration method, configuration device and configuration equipment of NVDIMM (noise, voltage and noise memory Module)
CN111625192B (en) Metadata object access method, device, equipment and medium
US11442668B2 (en) Prioritizing volume accesses in multi-volume storage device based on execution path of a service
CN113868019B (en) Data processing method and device and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination