• Recovering tenant VMs

    All tenant VMs are deployed with a single parent VHD. DPM’s original location recovery workflow will not work for tenant VMs. Complete the following steps to recover tenant VMs:

    1. In the VMM console, determine the name of the host on which the VM that you want to recover is located by doing the following:

    a. In the VMs And Services workspace, expand All Hosts, and then click Compute Clusters.

    b. In the VMs pane, type the name of the VM.

    c. Note the value in the Host column that is associated with the VM.

    d. Note which compute cluster the host is a member of. (Under Compute Clusters, click each cluster to view the members.)

    e. Right-click the VM, and then click Properties. Click the Hardware Configuration tab. Under Bus Configuration, the VHDs that are attached to the VM are listed. Click the operating system VHD (typically the first one under IDE Devices) to see if there is a VHD chain. Note the value in the Fully Qualified Path To Parent Virtual Hard Disk box (for example, copy and save it to Notepad). If the VM properties are corrupted and you cannot access them, you can skip this step.

    2. In the VMM console, find a tenant share that has enough available capacity to store the recovered VM by doing the following:

    a. In the Fabric workspace, expand Storage, and then click File Servers.

    b. In the File Servers, File Shares pane, expand the file server that is in the same rack as the compute cluster where the Hyper-V host that you identified in step 1c resides.

    c. Use the Available Capacity column to find a TenantShare with enough free space. (This procedure uses the example share \\-FS-02.contoso.com\TenantShare14.)

    3. On the Console VM, open Failover Cluster Manager, and connect to the compute cluster on which the host that you identified in step 1c is a member of.

    4. Under the cluster name, click Roles.

    5. In the Roles pane, find the cluster resource name of the VM that you want to recover. The name will be in the format SCVMM VMName Resources.

    6. On the Console VM, open Windows PowerShell, and run the following commands to delete the VM. Press Enter after each command. Note that the Hyper-V host is the host on which the VM that you want to recover is located.
    Stop-VM -ComputerName HyperVHostName -Name VMName Remove-VM -ComputerName HyperVHostName -Name VMName

    7. Create a symbolic link to the tenant share that you identified in step 2 by first running the following command:
    Enter-PSSession -ComputerName HyperVHostName
    In the remote session, run the following commands:
    cd c:\ cmd /c "mklink /d DirectoryName \\SharePath" exit

    8. On the Console VM, find the DPM server that backs up the VM that you want to recover. To do this, complete the following steps:

    a. Open the Operations console.

    b. In the Monitoring workspace, expand System Center 2012 R2 Data Protection Manager, select State Views, and then click Protected Servers.

    c. In the Look For box, enter the cluster resource name of the VM.

    d. In the DPM server column, note the name of the DPM server that backs up the VM.
    You can also do this by running the following Windows PowerShell command from the Operations Manager Shell:
    Get-SCOMClassInstance | where {$_.DisplayName -like '*clusterresourcename*'} | foreach { $_.'[Microsoft.SystemCenter.DataProtectionManager.

    9. Open the DPM administrator console, and connect to the DPM server that you identified in step 8. Find and note the name of the protection group that the VM that you want to recover was added to.

    10. On the Console VM, recover the VM by running the following Windows PowerShell commands as an elevated user. Press Enter after each command. Note that DPM-TenantVM-0# is the name of the DPM server that you identified in step 8, ProtectionGroupName is the protection group that the VM is a member of, VMName is the NetBIOS name of the VM that you want to recover, and SymbolicLinkOnHyperVHost is the symbolic link that you created earlier, for example c:\test1.
    $pg = Get-DPMPRotectionGroup -DPMServerName DPM-TenantVM-0# | where {$_.Name -eq "ProtectionGroupName"} $ds = Get-DPMDatasource -ProtectionGroup $pg | where {$_.Computer -eq "VMName"} Get-DPMRecoveryPoint -Datasource $ds | select Name, BackupTime ## this is used for display only $rps = Get-DPMRecoveryPoint -Datasource $ds $rpo = New-DPMRecoveryOption -HyperVDatasource -TargetServer HyperVHostName -RecoveryLocation AlternateHyperVServer -RecoveryType Recover -TargetLocation $rp = $rps[$rps.Length - 1] ## Value of - 1 indicates the latest recover point. A value of - 2 would be the recovery point before that. $ri = Get-DPMRecoverableItem $rp -BrowseType Child Recover-RecoverableItem -RecoverableItem $rp -RecoveryOption $rpo

    11. On the Hyper-V host on which the VM is located, open Windows PowerShell as an elevated user.

    12. Perform a storage migration by running the following command where SOFSShare is the share that you identified in step 2.
    Move-VMStorage -ComputerName HyperVHostName -VMName VMName -DestinationStoragePath SOFSShare

    13. Re-parent the VM to its original parent that you identified in step 1e by running the following command. (You can skip this step and continue to step 15 if the original VM configuration was corrupted and you could not get this property value in step 1e.)
    Get-VMHardDiskDrive VMName | Get-VHD | where {$_.parentPath -ne $null} | Set-VHD -ParentPath "\\SharePathofParentVHD"

    14. Delete the "local" parent VHD (that was just recovered).

    15. Delete the symbolic link. To do this, open a Windows PowerShell session as an elevated user, and then run the following commands. (Press Enter after each command.)
    Enter-PSSession -ComputerName HyperVHostName
    del DirectoryName
    exit

    16. From a Console VM, run the following Windows PowerShell commands to configure the VM as highly available. Press Enter after each command. (You must connect the VM to its original cluster resource role.) Note that in the following commands, VMClusterResourceName is the cluster resource name for the VM (for example "SCVMM VMName Resources"), ComputeClusterName is the compute cluster name on which the Hyper-V host resides, and VMConfigLocation is the location that is identified in the Get-VM command that you run in this procedure.
    Get-VM –Name VMName | Select VMId, ConfigurationLocation $res = Get-ClusterResource -Name "VMClusterResourceName" -Cluster ComputeClusterName Set-ClusterParameter -InputObject $res -Name VMId -Value -Cluster ComputeClusterName Set-ClusterParameter -InputObject $res -Name VmStoreRootPath -Value "VMConfigLocation" -Cluster ComputeClusterName

    Source of Information : Microsoft System Center


0 comments:

Leave a Reply