12. November 2013 21:30
/
Martin Poisel
/
Comments (0)
Would you like to make offsite VM backup along with Hyper-V Replica? Unfortunatelly, it is not supported by MS. If you start backuping VM Replica, replication could break.
The solution is (where hyperv-cluster1 is source and cluster2 is replica):
1) pause replication
Get-ClusterGroup -Cluster hyperv-cluster1.amccomp.cz | Where-Object {$_.GroupType -eq "VirtualMachine" -and $_.State -eq "Online"} | Get-VM | Where-Object {$_.ReplicationMode -eq "Primary" -and $_.ReplicationState -eq "Replicating"} | Suspend-VMReplication
2) make backup
DPM, Windows Backup or your favourite backup tool
3) resume replication
Get-ClusterGroup -Cluster hyperv-cluster2.amccomp.cz | Where-Object {$_.GroupType -eq "VirtualMachine" -and $_.State -eq "Offline"} | Get-VM | Where-Object {$_.ReplicationMode -eq "Replica" -and ($_.ReplicationState -eq "Suspended" -or $_.ReplicationState -eq "Error")} | Resume-VMReplication
Get-ClusterGroup -Cluster hyperv-cluster2.amccomp.cz | Get-ClusterResource | Where-Object {$_.ResourceType -eq "Virtual Machine Configuration" -and $_.State -eq "Offline"} | Start-ClusterResource
Get-ClusterGroup -Cluster hyperv-cluster1.amccomp.cz | Where-Object {$_.GroupType -eq "VirtualMachine" -and $_.State -eq "Online"} | Get-VM | Where-Object {$_.ReplicationMode -eq "Primary" -and ($_.ReplicationState -eq "Suspended" -or $_.ReplicationState -eq "Error")} | Resume-VMReplication
Don't forget to take cluster resources on replica cluster online (because replica supendation takes them offline). This solution would also work without cluster (just start useing from Get-VM ...).
You can use my Powershell scripts below:
pause-replication.ps1 (259.00 bytes)
pause-replication.ps1 (259.00 bytes)
6dfa6906-45ce-4e9d-aaf8-2f46a313c8ad|2|3.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04