CN117785564A - Method for instantaneously recovering hyper-V virtual machine - Google Patents

Method for instantaneously recovering hyper-V virtual machine Download PDF

Info

Publication number
CN117785564A
CN117785564A CN202311852641.5A CN202311852641A CN117785564A CN 117785564 A CN117785564 A CN 117785564A CN 202311852641 A CN202311852641 A CN 202311852641A CN 117785564 A CN117785564 A CN 117785564A
Authority
CN
China
Prior art keywords
virtual machine
disk
hyper
local
snapshot
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
CN202311852641.5A
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.)
Chengdu Aomei Technology Co ltd
Original Assignee
Chengdu Aomei Technology 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 Chengdu Aomei Technology Co ltd filed Critical Chengdu Aomei Technology Co ltd
Priority to CN202311852641.5A priority Critical patent/CN117785564A/en
Publication of CN117785564A publication Critical patent/CN117785564A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for instantaneously recovering a hyper-V virtual machine, which comprises the following steps: step S1, starting a domain control server; step S2, creating network sharing; s3, selecting a restore point; s4, setting a disk chain; s5, creating an empty virtual machine in the Hyper-V host; s6, attaching a disk file; step S7, creating a snapshot; step S8, moving the snapshot file to the local; step S9, after the latest disk file is copied to the local, the corresponding network path in the step S6 is modified into the local path of the step S8; step S10, starting a virtual machine; step S11, the disk is migrated in the background. By the method provided by the invention, when the quick recovery is needed, the copying process of the large-capacity backup file is skipped, the backup data is directly mounted from the backup storage server, the data transmission time is reduced, the quick recovery and the starting of the virtual machine are realized in the grading or even second level, and the original backup data is not influenced after the starting.

Description

Method for instantaneously recovering hyper-V virtual machine
Technical Field
The invention belongs to the technical field of data backup, and particularly relates to a method for instantaneously recovering a hyper-V virtual machine.
Background
Since the advent of virtual technology, virtual machines have been increasingly used, and products for virtual machine backup and restoration are also becoming more and more popular. When the production system is in fault or even running, the recovery function of the products is used, so that the loss caused by data loss is effectively avoided.
In the prior art, in view of the efficiency of recovering data by using the products, the recovery speed is low due to the large backup data files, most of the time is spent in the data copying and transferring stage, and some of the time is spent for several hours or even 1-2 days. Therefore, a method for instantaneously restoring the hyper-V virtual machine is needed to quickly restore the virtual machine.
Disclosure of Invention
The invention aims to provide a method for instantaneously recovering a hyper-V virtual machine, which aims to solve the problems of low recovery efficiency caused by slow recovery speed due to large backup data files and most of time spent in a data copying and transferring stage in the prior art.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for instantaneously restoring a hyper-V virtual machine, comprising the steps of:
step S1, starting a domain control server;
step S2, creating network sharing; logging in a backup server by using a domain account number, jumping to a virtual machine backup directory, and creating network sharing based on SMB 3; opening a file resource manager in a Hyper-V host, and inputting configured shared full paths in an address bar;
s3, selecting a restore point;
s4, setting a disk chain;
s5, creating an empty virtual machine in the Hyper-V host;
s6, attaching a disk file; the attached disk file specifically includes: assigning the disk file corresponding to the last incremental backup in the restore point set selected in the step S3 to the created virtual machine;
step S7, creating a snapshot; creating a snapshot prior to starting the virtual machine: the created snapshot is used for restoring the virtual machine, and the original backup data in the backup set cannot be polluted;
step S8, moving the snapshot file to the local; after creating the snapshot, the newly generated snapshot disk file is copied to the local disk of the hyper-V host
Step S9, after the latest disk file is copied to the local, the corresponding network path in the step S6 is modified into the local path of the step S8;
step S10, starting a virtual machine;
and S11, the disk is migrated in the background, and all data of the selected restore point are copied to the local disk of the Hyper-V host computer in the background, so that seamless connection is realized.
According to the above technical solution, in step S2, in the shared permission setting, the network sharing set by the full access of the Hyper-V host is set.
According to the technical scheme, the specific steps of setting the network sharing of the full access setting of the Hyper-V host are as follows:
selecting a folder to be shared, right mouse button attribute, selecting a sharing tab, clicking a sharing button, configuring a user to be shared, selecting a permission tab, adding a Hyper-V host into an access permission list, and giving all access permissions.
According to the above technical solution, in step S4, the setting of the disk chain specifically includes: set-VHD-Path child disk Path-ParentPath parent disk Path-IgnosteIsMatch.
According to the above technical solution, in step S5, creating the virtual machine is specifically: new-VM-VmName < virtual machine name > -MemoryStartupBytes2G-NoVHD-SwitchNameet1000.
According to the above technical solution, in step S9, the modification of the disk file path to the local is specifically:
step S901, copying the snapshot disk file generated in step S8;
step S902, removing the virtual machine disk;
step S903, adding a local disk:
in step S904, the call command Add-vmhard disk is to mount a disk for the virtual machine, where the mounting is a full path of the local disk that needs to be mounted, and the type of disk controller, the number of the disk controller, the number inside the controller, and the need to be specified.
Compared with the prior art, the invention has the following beneficial effects:
by the method provided by the invention, when the production environment system fails or runs, and needs to be quickly recovered, the high-capacity backup file copying process is skipped, backup data is directly mounted from the backup storage server, the data transmission time is reduced, quick recovery and starting of the virtual machine are realized in the steps or even in the seconds, the original backup data are not influenced after the starting, and the selected recovery point disk data can be migrated from the backup server to the Hyper-V host computer in the background after the virtual machine is started.
Drawings
FIG. 1 is a flow chart of the present invention for recovering a hyper-V virtual machine.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
As shown in fig. 1, a method for instantaneously recovering a hyper-V virtual machine is characterized in that: the method comprises the following steps:
step S1, starting a domain control server;
step S2, creating network sharing; logging in a backup server by using a domain account number, jumping to a virtual machine backup directory, and creating network sharing based on SMB 3; opening a file resource manager in a Hyper-V host, and inputting configured shared full paths in an address bar;
s3, selecting a restore point;
in step S3, the restore point refers to a backup at a certain moment before restore, which is a set, and if the selected backup is a full backup, the set has only one record, and if the selected backup is an incremental backup, the restore point contains multiple records.
S4, setting a disk chain;
in step S4, each time an incremental backup is performed, the incremental backup disk file includes the complete path information of the last (parent) incremental backup (or complete backup) disk file. During restore, the parent disk corresponding to each disk file in each backup needs to be reset due to the change of the restore path. If not, the original corresponding path is found when the backup is performed, and therefore the relation between the upper level and the lower level is not found or is disordered.
The disk chain is specifically set as follows: set-VHD-Path "child disk Path"; -paramentpath "parent disk path" -IgnoreIsMatch;
the "-Path" parameter corresponds to the full Path of the sub disk file; the "-ParentPath" parameter corresponds to the full path of the parent disk file.
S5, creating an empty virtual machine in the Hyper-V host;
s6, attaching a disk file; the attached disk file specifically includes: assigning the disk file corresponding to the last incremental backup in the restore point set selected in the step S3 to the created virtual machine
Step S6, mounting the disk file on the virtual machine created in the step S5;
step S7, creating a snapshot; creating a snapshot prior to starting the virtual machine: the created snapshot is used for restoring the virtual machine, and the original backup data in the backup set cannot be polluted;
step S8, moving the snapshot file to the local; after creating the snapshot, copying the newly generated snapshot disk file to a local disk of the hyper-V host;
in step S8, after step S7 is executed, the storage path of the snapshot file is on the remote backup server, and if the virtual machine is directly started, the virtual machine is equivalent to a remote disk mounted on the virtual machine, which affects the performance of the virtual machine, so that the newly generated snapshot disk file needs to be copied to the local disk of the hyper-V host, thereby avoiding affecting the performance of the virtual machine.
Step S9, after the latest disk file is copied to the local, the corresponding network path in the step S6 is modified into the local path of the step S8;
in step S9, because the disk path is changed, the relationship between the moved disk and its parent disk needs to be modified again;
step S10, starting a virtual machine;
and S11, the disk is migrated in the background, and all data of the selected restore point are copied to the local disk of the Hyper-V host computer in the background, so that seamless connection is realized.
Specifically, in step S11, all the other disk files corresponding to the restore point set are copied to the local area of the Hyper-V host, and either manual copying or tool copying may be used, i.e. all the files in the restore point are copied for restore.
By the method provided by the invention, when the production environment system fails or runs, and needs to be quickly recovered, the high-capacity backup file copying process is skipped, backup data is directly mounted from the backup storage server, the data transmission time is reduced, quick recovery and starting of the virtual machine are realized in the steps or even in the seconds, the original backup data are not influenced after the starting, and the selected recovery point disk data can be migrated from the backup server to the Hyper-V host computer in the background after the virtual machine is started.
Example two
The invention is characterized in that:
a) And starting the domain control server.
The Hyper-V host creates a virtual machine directly from the network share of the remote server, requiring domain control support, and ignoring this step if the user's Hyper-V server and backup server are themselves in the domain environment.
If both servers are not in the domain control during backup, a domain control server needs to be temporarily built, and the Hyper-V server and the backup server are added into the domain control.
The best scheme is that when no fault occurs, the domain control is built in advance, and the Hyper-V server and the backup server are added into the domain control, so that the backup and production operation can be started at ordinary times without starting the domain control server, logging in the domain control server, and starting the domain control server when instantaneous recovery is needed.
b) Creating a network share on a backup server;
logging in a backup server by using a domain account number, jumping to a virtual machine backup directory, and creating a share based on SMB3, wherein in the authority setting of the share, the Hyper-V host needs to be set to completely access the share.
The specific operation is as follows:
selecting a folder to be shared, selecting a 'sharing' tab by a right button- > attribute- > of a mouse, and then clicking a sharing button; clicking the 'rights' button, adding the Hyper-V host into the access rights list, and assigning all access rights.
c) Connecting to the sharing at the Hyper-V host;
opening a file resource manager in the Hyper-V host, and inputting the shared full path configured in the step b in an address bar: \ip \smbsharenme.
If the configuration is correct and the network is normal, the backup files on the backup server can be seen.
d) Selecting an restore point and setting a disk chain;
if the recovery point selected at recovery contains only full backups, then the set disk chain step may be omitted.
If the selected restore set contains one or more incremental backups, the upper and lower relationship of the disk needs to be set according to the sequence of backups before the backup data is loaded. If not, the restore may result in the intermediate incremental backup data not being loaded properly.
The instructions for setting the upper and lower level relationship of the disk are as follows:
Set-VHD-Path "child disk Path" -ParentPath "parent disk Path" -IgnosteisMatch;
e) Creating an empty virtual machine;
an empty virtual machine is created in the Hyper-V host without specifying the disk.
New-VM-Vname < virtual machine name > -MemoryStartupBytes2G-NoVHD-SwitchNameet1000;
f) Attaching a disk file;
and designating the disk file corresponding to the last incremental backup in the restore point set to the virtual machine.
Add-VMHardDiskDerive-VmName < virtual machine name > -ControllerType=IDE-ControllerNumber=0-ControllerLocation=0-Path= < last restore point disk file full Path >;
if there are multiple disks, then multiple add operations are performed.
g) Creating a snapshot;
creating a snapshot prior to starting the virtual machine:
Checkpoint-VM-VmName < virtual machine name > -Snapshot Name < snapshot Name >;
the purpose is that after the virtual machine is restored, the original backup data in the backup set cannot be polluted.
h) Moving the latest snapshot file;
because the virtual machine cannot specify the path of the snapshot disk file when creating the snapshot, the default path is the path of the current disk file of the virtual machine before creating the snapshot, that is, the new snapshot disk file is generated by default to the backup server in the scheme, and the data always needs to be remotely transmitted to the file server through the network after starting. This reduces the running speed and stability of the virtual machine.
It is therefore necessary to copy the newly generated snapshot disk file (.avhdx or. Avhd) to the hyper-V host local disk after the snapshot is created. The new snapshot file is only 4M, the transmission rate is high, and the instantaneous recovery efficiency is not affected.
i) Modifying the disk file path to the local;
after the latest disk file is copied to the local, the disk file path set in the f step is required to be modified, and the network path corresponding to the f step is modified to be the local path of the h step.
The modification method is as follows:
removing the virtual machine disk:
Remove-vmhardddisk-VmName < virtual machine name > -ControllerType = IDE-ControllerNumber = 0-ControllerLocation = 0;
repair and then attach the local disk:
Add-VMHardDiskDerive-VmName < virtual machine name > -ControllerType=IDE-ControllerNumber=0-ControllerLocation=0-Path= < local snapshot disk file full Path >;
j) Starting virtual machine
Starting up the recovered virtual machine.
And starting data migration, and copying all data of the selected restore point to a local disk of the Hyper-V host computer in the background to realize seamless connection.
Interpretation of technical terms:
domain control: the domain controller is that at least one server is responsible for the verification work of each computer and user connected to the network in the 'domain' mode, which is the same as a gate guard of a unit, and is called as 'domain controller (Domain Controller, abbreviated as DC').
SMB3: SMB, an abbreviation for Server Message Block. Is a network communication protocol that is used primarily to share files and printers between computers, and primarily to allow communication between client computers and server computers. It allows client computers to access shared folders and files on a server and allows data to be transferred between the client computers and the server computers. SMB3 is a function of the SMB protocol, allowing the server to use multiple network connections simultaneously.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: the foregoing description is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art, although the present invention has been described in detail with reference to the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A method for instantaneously restoring a hyper-V virtual machine, characterized by: the method comprises the following steps:
step S1, starting a domain control server;
step S2, creating network sharing; logging in a backup server by using a domain account number, jumping to a virtual machine backup directory, and creating network sharing based on SMB 3; opening a file resource manager in a Hyper-V host, and inputting configured shared full paths in an address bar;
s3, selecting a restore point;
s4, setting a disk chain;
s5, creating an empty virtual machine in the Hyper-V host;
s6, attaching a disk file; the attached disk file specifically includes: assigning the disk file corresponding to the last incremental backup in the restore point set selected in the step S3 to the created virtual machine;
step S7, creating a snapshot; creating a snapshot prior to starting the virtual machine: the created snapshot is used for restoring the virtual machine, and the original backup data in the backup set cannot be polluted;
step S8, moving the snapshot file to the local; after creating the snapshot, the newly generated snapshot disk file is copied to the local disk of the hyper-V host
Step S9, after the latest disk file is copied to the local, the corresponding network path in the step S6 is modified into the local path of the step S8;
step S10, starting a virtual machine;
and S11, the disk is migrated in the background, and all data of the selected restore point are copied to the local disk of the Hyper-V host computer in the background, so that seamless connection is realized.
2. The method for instantaneously restoring a hyper-V virtual machine according to claim 1, wherein: in step S2, in the rights setting for sharing, the network sharing set by the Hyper-V host full access is set.
3. The method for instantaneously restoring a hyper-V virtual machine according to claim 2, wherein: the specific steps of setting the network sharing of the Hyper-V host full access settings are:
selecting a folder to be shared, right mouse button attribute, selecting a sharing tab, clicking a sharing button, configuring a user to be shared, selecting a permission tab, adding a Hyper-V host into an access permission list, and giving all access permissions.
4. The method for instantaneously restoring a hyper-V virtual machine according to claim 1, wherein: in step S4, the disc chain is specifically set as follows: set-VHD-Path child disk Path-ParentPath parent disk Path-IgnosteIsMatch.
5. The method for instantaneously restoring a hyper-V virtual machine according to claim 1, wherein: in step S5, creating an empty virtual machine is specifically: new-VM-VmName < virtual machine name > -MemoryStartupBytes2G-NoVHD-SwitchNameet1000.
6. The method for instantaneously restoring a hyper-V virtual machine according to claim 1, wherein: in step S9, the modification of the disk file path to the local is specifically:
step S901, copying the snapshot disk file generated in step S8;
step S902, removing the virtual machine disk;
step S903, adding a local disk:
in step S904, the call command Add-vmhard disk is to mount a disk for the virtual machine, where the mounting is a full path of the local disk that needs to be mounted, and the type of disk controller, the number of the disk controller, the number inside the controller, and the need to be specified.
CN202311852641.5A 2023-12-29 2023-12-29 Method for instantaneously recovering hyper-V virtual machine Pending CN117785564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311852641.5A CN117785564A (en) 2023-12-29 2023-12-29 Method for instantaneously recovering hyper-V virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311852641.5A CN117785564A (en) 2023-12-29 2023-12-29 Method for instantaneously recovering hyper-V virtual machine

Publications (1)

Publication Number Publication Date
CN117785564A true CN117785564A (en) 2024-03-29

Family

ID=90390629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311852641.5A Pending CN117785564A (en) 2023-12-29 2023-12-29 Method for instantaneously recovering hyper-V virtual machine

Country Status (1)

Country Link
CN (1) CN117785564A (en)

Similar Documents

Publication Publication Date Title
US11561865B2 (en) Systems and methods for host image transfer
JP5021929B2 (en) Computer system, storage system, management computer, and backup management method
CN101777018B (en) Copying and snapshot combined Windows system protection method
KR101970839B1 (en) Replaying jobs at a secondary location of a service
US20150355862A1 (en) Transparent array migration
US8364640B1 (en) System and method for restore of backup data
US20210064413A1 (en) Deploying a cloud instance of a user virtual machine
US20060129616A1 (en) System and method for synchronizing computer files between a local computer and a remote server
US8688644B1 (en) Systems and methods for performing recovery of directory data
US20070033361A1 (en) Apparatus, system, and method for fastcopy target creation
JP5665889B2 (en) Method and apparatus for backing up subversion repository
CN111176900A (en) Distributed storage system and data recovery method, device and medium thereof
CN109597671B (en) Desktop cloud implementation method compatible with centralized and distributed operation
CN117785564A (en) Method for instantaneously recovering hyper-V virtual machine
CN114138563A (en) Method for backing up and restoring Hyper-V virtual machine
CN115098300A (en) Database backup method, disaster recovery method, device and equipment
CN111400098B (en) Copy management method and device, electronic equipment and storage medium
Cisco Installing the LGMapper Server
US10379777B2 (en) Method for performing replication control in storage system with aid of relationship tree within database, and associated apparatus
CN111125001A (en) Snap copy method, electronic device, and computer program product
JPH05298173A (en) Distributed file synchronizing and updating system
JP2850756B2 (en) Failure recovery method for files in distributed processing system
CN117762683A (en) Method for quickly recovering faults of linux operating system
Abhilash Disaster recovery using VMware vSphere replication and vCenter site recovery manager
MAY et al. DOUBLE-TAKE LICENSE AGREEMENT

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