How to restore data in the latest snapshot when the vmwarevm cannot be enabled

Source: Internet
Author: User

Snapshot technology is a great tool for VMware backup tasks, but if you change the customer's operating system and this change causes unexpected behavior, you need to delete or restore the snapshot, returns the VM to its original status. Otherwise, the customer's operating system may be unavailable. If you do not have a backup copy on hand, you may lose valuable data in the last few weeks.

In this prompt, I will explain how to make the original customer's operating system work, and how to restore lost data by adding a file snapshot of the vmwarevm disk format (vmdk) to a new virtual disk, add disks and snapshots as an additional vmdk in another customer's operating system.

How does Snapshot technology solve the customer's operating system failure problems?

Generally, the best practice for a snapshot is to create, test a patch or install new software, and then delete or restore the snapshot. However, this cannot always be the case. Occasionally, I forgot the snapshot or someone else created one and didn't tell me. This will be a major failure in the customer's operating system.

My favorite examples in real life are: Windows Small Enterprise Server (SBS) crashes upon restart. The Active Directory (AD) database crashes and no one knows the restore mode password. We can restore the snapshot to the day when we know that ad works normally, but in doing so, we will lose Microsoft Exchange and SQL server data for several weeks. Further complicated, we do not have a decent backup server. Two different parts of the server are mistaken for another group of backup servers.

Vmdk

In this case, you may find the data you need, but you also need to restore the recovery point of the virtual client operating system to a restore point several weeks ago. However, in a simple process, you can use vmkfstools to import the latest data from the VMware ESX service console to a new vmdk disk, this allows you to restore and manipulate a snapshot without losing the latest data.

Make sure that your operating system is shut down and you have logged on to the service console. This helps change the path of the client's operating system and vmdk file. By default, snapshots are saved in the same directory. You will see a snapshot of Delta vmdk and a pre-snapshot data of flet vmdk. If you look at the existing files in the directory, you will see that each virtual disk has two vmdk files. A smaller file is the pointer vmdk. It includes settings corresponding to the disk.

One of these settings refers to the actual data file of the vmdk. It is best not to mess up files unless you have support from VMware. When you use a virtual machine with a snapshot version, all disk changes are written to this delta vmdk. In the following example, the Ubuntu-000001. vmdk file points to Ubuntu-000001-Delta. vmdk, and ubuntu. vmdk points to Ubuntu-flat. vmdk. When you have more than one snapshot, the file names of these numbers will increase accordingly. For simplicity and clarity, let's assume that we only have one snapshot. (If you have a few, you can import them to different files and track them when your problem occurs .)

Snapshots

Import the snapshot to a new vmdk

Now, you can import a snapshot to a new vmdk disk. If you have more than one disk, you must perform this step for each vmdk. The syntax in the command uses the pointer file name. Follow these steps to import a snapshot to a disk:

# Mkdir/vmfs/volumes/DS-LUN1/effectubackup
Vmkfstools-I [source file] [destination file]

For example:
 
# Vmkfstools-I/vmfs/volumes/DS-LUN1/Ubuntu/ubuntu-000001.vmdk/vmfs/volumes/DS-LUN1/effectubackup. vmdk

The file will be cloned. Depending on the original size and the total data volume in the snapshot, this may take some time to complete the clone, but at least you will have a good progress indicator during this observation.

VMWare

Now you can restore your snapshots from the vcenter server without losing those changes. In vcenter customer, go to customer Operating System, right-click and select snapshot, restore to snapshot, and then click yes.

Vcenter Server

You may want to know if all the changes are being written to the original vmdk disk because you have restored the snapshot. No, you have actually deleted all the changes in the original snapshot, but the new change goes to another delta file. my situation here is 000002.

Vcenter

Now you can delete snapshots from vcenter to write changes to the original disk or write changes that occur during your troubleshooting to the delta file. I like the latter better, because after all the problems are solved, at least you have a potential recovery point.

Add the vmdk as an additional disk to the customer's operating system.

So, how do we deal with the vmdk we just created? Because it may not start, I always add it as an additional disk to a customer Vm, and then copy the required data to a stable and effective customer system. To do this, modify the operating system settings of your customers and add a hard disk. Select the existing disk option to browse the vmdk file you just backed up. In my example, it will be javastubackup. vmdk. Now you must find a new hard drive to perform the task in your customer's operating system. In the disk management unit of Windows system, you will right-click and choose to scan the disk again. This feature is usually found in the Computer Management MMC console.

Operating System

The above process leaves me from the potential disasters described above. I can save the current SQL and exchange data to restore the operating system to a usable state. A snapshot is available. However, Database Consistency cannot be guaranteed. I can easily recover exchange data, but the database administrator has to clear the SQL database. The data is current, but there is more work to do. An appropriate backup solution is the preferred solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.