Data Backup and Recovery

Restore Vcenter VM per SMVI without running vcenter?

GUNNAR75
4,392 Views

Hello,

How is it possible to restore vcenter-VM from SMVI-Snapshots?
In my opionion, the only way to restore VMs which a backup per SMVI, is to use VSC at the vcenter-Server.
But how can i do this, if vcenter-VM are failed / corrupted ?

How can i restore the specific Vcenter-VM from SMVI-Snapshots without vcenter-VM ?? Smiley Mad

 


kind regards

Gunnar

 

1 REPLY 1

asulliva
4,379 Views

If you're using NFS, the easiest, but longest, way is to SSH to a vSphere host, cd into the datastore's .snapshot directory ("cd /vmfs/volumes/datastore_name/.snapshot/snapshot_name") and do a simple copy back into the volume...for example:

 

cp -f -R /vmfs/volumes/myFavoriteDatastore/.snapshot/weekly.0/MyvCenterVM/* /vmfs/volumes/myFavoriteDatastore/MyvCenterVM/

 

Using the NetApp PowerShell Toolkit or the CLI you can create single file FlexClones pretty easily with NFS datastores.  You'll need to make sure there is a folder to restore the files into on the volume, then it's just creating FlexClones of the VMX and VMDKs from the snapshot...

 

$svmName = "mySVM"

$volumeName = "myFavoriteDatastore"
$sourceSnap = "weekly.0"

$files = @("vc.vmx", "vc.vmdk", "vc.vmdk-flat")
$sourceFolder = "/vc1/"
$destinationFolder = "/vc1_restored/"

$files | %{ 
    $sourcePath = "$($sourceFolder)$($_)"
    $destinationPath = "$($destinationFolder)$($_)"

    New-NcClone -Volume $volumeName -SourcePath $sourcePath -DestinationPath $destinationPath -SpaceReserved:$false -Snapshot $sourceSnap -VserverContext $svmName
}

After that you would simply need to browse the datastore and add the VM to inventory.

 

You can do the same from the clustershell:

 

volume file clone create -vserver xxx -volume yyy -snapshot-name zzz -source-path /vm_name/vm_name.vmdk -destination-path /existing_folder/vm_name.vmdk

This is dramatically more difficult with block based storage since you have to do sub-LUN cloning and need to know the block ranges associated with the files.  This isn't something I'm familiar with doing, so it would be significantly easier to just create a volume FlexClone, mount it as a new datastore (remember to account for LUN resignature), and then add the VM to inventory and SvMotion it to a new datastore if desired.

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public