1. Delete the corrupt VM:
Stop-VM -ComputerName HyperVHostName -Name VMName
Remove-VM -ComputerName HyperVHostName -Name VMName
In the preceding command, HyperVHostName is the host on which the corrupt VM is located.
2. Create a symbolic link
Enter-PSSession -ComputerName
cd c:\ cmd /c "mklink /d link
exit
In the preceding command, RecoveryHost is the host on which the VM needs to be recovered and SharedLocation is the storage location for the recovered VM.
3. Connect to the DPM server, get the protection group on the DPM server named DPMServer01, and store the results in the $Pg variable:
$Pg = Get-DPMProtectionGroup -DPMServerName "DPMServer01" | where {$_.Name –eq "PGName"}
4. Get the list of protected and unprotected data in the protection group and store the data source object:
$Ds = Get-DPMDatasource -ProtectionGroup $Pg | where {$_.Computer -eq
5. Specify the recovery points for the given data source:
$Rps = Get-DPMRecoveryPoint -Datasource $Ds
6. Specify a particular recovery point:
$Rp = $Rps[$Rps.Length – 1]
In the preceding command, - 1 indicates the latest recover point; - 2 would be the recovery point before that, and so on.
7. Recover the item to the alternate location (Hyper-V host):
$Rpo = New-DPMRecoveryOption -HyperVDatasource -TargetServer HyperVHostName -RecoveryLocation AlternateHyperVServer -RecoveryType Recover -TargetLocation
Recover-RecoverableItem -RecoverableItem $Rp -RecoveryOption $Rpo
8. Connect to the host where the VM has been recovered and perform the following steps:
a. Perform storage migration
Move-VMStorage -ComputerName HyperVHostName -VMName VMName -DestinationStoragePath
b. Re-parent the recovered VM to its original parent:
Get-VMHardDiskDrive VMName | Get-VHD | where {$_.parentPath -ne $null} | Set-VHD -ParentPath
c. Delete the local parent VHD that was just recovered.
d. Delete the symbolic link (“c:\link”) by opening Windows PowerShell session as an elevated user.
e. Configure the recovered VM as a highly available source:
Get-VM –Name VMName | Select VMId, ConfigurationLocation $res = Get-ClusterResource -Name "VMClusterResourceName" -Cluster ComputeClusterName Set-ClusterParameter -InputObject $res -Name VMId -Value
Source of Information : Microsoft System Center
No comments:
Post a Comment