{"id":418,"date":"2017-01-28T01:15:59","date_gmt":"2017-01-27T23:15:59","guid":{"rendered":"http:\/\/itsimple.info\/?p=418"},"modified":"2017-01-28T01:15:59","modified_gmt":"2017-01-27T23:15:59","slug":"hyper-v-resume-replication-script","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=418","title":{"rendered":"HYPER-V RESUME REPLICATION SCRIPT"},"content":{"rendered":"<p>Some time the hyper-v replication get in to suspended mode or halt on any other reason, here is a Powershell script to run from the replica server which will start the replication again :<\/p>\n<p>&nbsp;<\/p>\n<pre>$ReplicationData = Get-VMReplication \r\n\r\nForeach ($VMReplica in $ReplicationData) {\r\n\u00a0\u00a0\u00a0 Write-Host \"Starting Replication on\" $VMReplica.Name\r\n\u00a0\u00a0\u00a0 Do{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If ($VMReplica.Health -eq \"Suspended\" -Or $VMReplica.Health -eq \"Critical\" -or $VMReplica.Health -eq \"Warning\") {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Write-Host \"VM Replication is in Critical Error State and suspended, Suspend and resuming Replication that is:\" $VMReplica.State\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Suspend-VMReplication -ComputerName $VMReplica.ReplicaServer -VMName $VMReplica.Name\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Suspend-VMReplication -ComputerName $VMReplica.PrimaryServer -VMName $VMReplica.Name\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Resume-VMReplication -ComputerName $VMReplica.ReplicaServer -VMName $VMReplica.Name\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Resume-VMReplication -ComputerName $VMReplica.PrimaryServer -VMName $VMReplica.Name\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 start-sleep -s 20\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0 Until($VMReplicaHealth.Health -notcontains \"Normal\")\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Some time the hyper-v replication get in to suspended mode or halt on any other reason, here is a Powershell script to run from the replica server which will start the replication again : &nbsp; $ReplicationData = Get-VMReplication Foreach ($VMReplica in $ReplicationData) { \u00a0\u00a0\u00a0 Write-Host &#8220;Starting Replication on&#8221; $VMReplica.Name \u00a0\u00a0\u00a0 Do{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If ($VMReplica.Health -eq [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,18],"tags":[],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-hyper-v","category-virtualization"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}