Restoring a Virtual Machine in VMware

Overview

Sometimes a VMware Virtual Machine is deleted on accident or content in the VM is deleted or edited, but the end user wants to restore it. A VMware Virtual Machine can be restored by using FlashArray Volume Snapshots. This guide will walk you through the process of restoring one Virtual Machine in an ESXi 6.x Environment using this method.

This article is for restoring a virtual machine from a Pure Storage FlashArray snapshot of a VMFS Datatore only. This does not apply to other third party snapshot recovery processes or a Pure Storage FlashBlade.

Similar to the GUI, we can match the datastore uuid to the FlashArray volume Serial number to confirm this is the datastore and volume we need to work with.

Now that you have the Datastore and Volume mapping, Determine the snapshot on the FlashArray that you would like to perform the restore from:Please note that from this point we have a different datastore and array being used as an example.

Perform a rescan on the ESXi host that the newly created volume was presented to complete presentation of the LUN.

Add the recovery LUN as a datastore to the ESXi host(s) you plan on performing the recovery on:

Note in the output above that the recovery LUN is identified as a snapshot to our 'slc-production' datastore we will be recovering.

While creating the datastore ensure you choose the: 'Assign a new signature' option.

It is not uncommon for the resignature process to take several minutes to complete. If this task does not complete after 10 minutes, engage additional resources for assistance.

Once the datastore creation has completed you will note that the datastore name will be in the following format: 'snap-hexNumbers-originalDatastoreName'. The image below is an example of what this specific restore datastore looks like:

With the recovery datastore highlighted, locate the 'Actions' wheel and click on 'Register VM...' to locate our VM that needs to be restored.

After you have located the VM in need of restoration step through the VMware prompts to add the VM to the ESXi host inventory.

While registering the recovery virtual machine to the ESXi host, and the original VM is still live on the ESXi host, ensure you rename the recovery VM. If you do not you will have two VMs with the same name and need to look at the underlying datastore properties to determine which VM is the recovery and which is the original.

Once the recovery VM is listed in the ESXi host inventory proceed with powering on the VM and ensuring it contains the required data and is accessible as expected. If the original VM is still in the ESXi host inventory ensure it is powered off to ensure no conflicts encountered.

When powering on the recovery VM you may be asked if the VM has been 'Copied' or 'Moved'. If the original VM is already destroyed and no longer in inventory you can safely choose 'I moved it'. If the original VM is not deleted and going to be around for additional time then you will need to select the: 'I copied it' option so that there is not a conflict in UUIDs between VMs.

Once the recovery VM has been powered on and data integrity is confirmed, you can now storage vMotion the VM from the 'snap-hexNumber-OriginalDatastoreName' to the original datastore (if the original datastore will still be used). Otherwise, if the customer is going to destroy the old datastore you can simply rename the recovery datastore and use it as needed.

If the customer decides to keep the original datastore, and the storage vmotion of the recovery VM has been completed, you can now safely unmap and clean-up the recovery volume as needed. If they are going to keep the newly created recovery datastore no clean-up is required and you can simply rename the LUN as needed.