<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://goxia.maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://goxia.maytide.net/read.php/1691.htm</link>
<title><![CDATA[[WS2012] Windows Server 2012 Hyper-V 复制]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[Virtualization]]></category>
<pubDate>Wed, 11 Sep 2013 07:54:28 +0000</pubDate> 
<guid>https://goxia.maytide.net/read.php/1691.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpupfiles/WS_C123/ws2012r2-logo.png"><img title="ws2012r2-logo" border="0" alt="ws2012r2-logo" src="http://goxia.maytide.net/ftpupfiles/WS_C123/ws2012r2-logo_thumb.png" width="315" height="55"></a></p> <p><strong><font color="#fd3f0d" size="4">Windows Server 2012 Hyper-V 复制</font></strong></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;早在去年11月份 <a href="http://goxia.maytide.net/" target="_blank">gOxiA</a> 就与大家分享了 Windows Server 2012 Hyper-V 虚拟机可移动性方面的几篇文章：“<a href="http://goxia.maytide.net/read.php/1636.htm">Windows Server 2012 使用 SMB 共享存储的实时迁移</a>”、“<a href="http://goxia.maytide.net/read.php/1635.htm">Windows Server 2012 Hyper-V over SMB</a>”、“<a href="http://goxia.maytide.net/read.php/1632.htm">详解 Windows Server 2012 无需共享存储的实时迁移</a>”。这些功能和特性确实极大的方便了 ITPro，使大家能够轻松、快速、安全的对虚拟机进行迁移。当对这几部分的实时迁移有一定的学习和理解后，Hyper-V 复制就显得更加容易，所以之前也就没有再单独写这部分的文章。</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最近遇到几个案例都是探讨虚机备份和低成本的异地灾备的，而且这几天在做 <a href="http://goxia.maytide.net/read.php/1680.htm" target="_blank">Windows Server 2012 R2 Preview</a> 到 RTM 迁移时也涉及到了 Hyper-V 复制，所以打算写篇东西出来跟大家分享分享，也算给自己留个存档。Hyper-V 复制，即：Hyper-V Replica，也称之为 Hyper-V 副本，是一种异步虚拟机复制技术，基于 HTTP 协议进行传输，所以它也非常适合应用在广域网环境中。在设计上，Hyper-V 复制主要用于商业连续性和灾难恢复场景。因为不需要任何共享存储，所以该技术可用于任何服务器、网络或存储供应商的设备。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/Hyper-V_Replication.png"><img title="Hyper-V_Replication" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Hyper-V_Replication" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/Hyper-V_Replication_thumb.png" width="634" height="353"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;要为 Hyper-V 主机启用复制功能，首先确保当前主机已经加入到 AD，并参考无需共享存储的实时迁移对主机做 Kerberos 委派，添加“hyper-v replica service”，然后还要修改当前主机的 Hyper-V 设置，在“复制配置”下勾选“启用此计算机作为副本服务器”，并选择“使用 Kerberos (HTTP)”端口保持80默认，在“授权和存储”选项下，选择“允许从任何经过身份验证的服务器重进行服务”，并指定副本的默认存储位置。可参考下图设置：</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_thumb.png" width="634" height="598"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在完成上述设置后向导会提示防火墙设置的相关警告，我们只需要进入防火墙设置允许 Hyper-V 副本 HTTP 通过。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_3.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_thumb_3.png" width="634" height="382"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;接下来，便可选择一台虚机进行复制的配置，整个过程可以参考下面的截图。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/1.png"><img title="1" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="1" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/1_thumb.png" width="634" height="358"></a></p> <p>选择虚拟机，启用复制。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/2.png"><img title="2" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/2_thumb.png" width="632" height="476"></a></p> <p>指定副本服务器，填写服务器名称。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/3.png"><img title="3" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="3" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/3_thumb.png" width="632" height="476"></a></p> <p>因为仅允许使用 Kerberos 身份验证(HTTP)，所以在连接参数向导中仅有一种可选模式，如果网络带宽比较紧张，建议勾选“压缩通过网络传输的数据”。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/4.png"><img title="4" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="4" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/4_thumb.png" width="632" height="476"></a></p> <p>选择复制 VHD，是非常人性化的配置，比如当前虚机本身附加有备份用的磁盘，那么在做 Hyper-V Replica 时可以不对这些备份用VHD做复制，当然有些用户也可能仅是为了复制虚机的数据VHD而不需要系统盘，那么也可以在该步骤中进行选择。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/5.png"><img title="5" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="5" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/5_thumb.png" width="632" height="476"></a></p> <p>根据需要配置复制频率，默认为每5分钟将更改发送到副本服务器。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/6.png"><img title="6" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="6" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/6_thumb.png" width="632" height="476"></a></p> <p>在容灾级别不高而且对数据存储容量毕竟敏感的场景下，可以“仅保留最新恢复点”。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/7.png"><img title="7" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="7" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/7_thumb.png" width="632" height="476"></a></p> <p>“选择初始复制方法”下，可以结合场景并根据实际情况进行选择。如果当前场景是局域网环境，并且此时网络带宽并不拥挤，那么可使用默认的“通过网络发送初始副本”作为初始复制方法，并“立即启动复制”。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/8.png"><img title="8" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="8" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/8_thumb.png" width="632" height="476"></a></p> <p><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/9.png"><img title="9" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="9" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/9_thumb.png" width="634" height="343"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在完成初始复制后，Hyper-V 复制功能会按照之前设置计划的时间频率将虚拟机的变更发送出去。这些变更时通过日志文件追踪的，并且将在变更发往复制服务器前进行压缩。在主服务器上，变更会被保存在一个.hrl文件中，该文件与被复制的VHD文件位于相同位置下。</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hyper-V 复制的故障转移操作有三个主要选项：</p> <ol> <li>计划内故障转移，顾名思义也就是按照预先确定的计划来进行故障转移。该方式需要满足两个前提条件：在初始故障转移前，虚拟机必须关闭；被复制主机必须也启用复制功能，并允许接收来自复制主机的复制。<br/><a href="http://goxia.maytide.net/ftpupfiles/Tips_B7D4/image.png"><img title="image" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/Tips_B7D4/image_thumb.png" width="565" height="337"></a></li> <li>测试故障转移，在复制服务器上进行操作，允许在不中断当前持续的复制配置下，生成并启动一个新的用于测试用途的虚拟机。<br/><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_4.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_thumb_4.png" width="465" height="202"></a></li> <li>计划外故障转移，很容易理解了，被复制主机意外宕机时，我们便可以在复制主机上执行“故障转移”，将该虚机启动上线。<br/><a href="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_5.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/922f9b5e19eb_CA48/image_thumb_5.png" width="465" height="247"></a></li></ol> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;玩转 Windows Server 2012 Hyper-V 的实时迁移和复制功能，并灵活应用在不同场景下，将会使 ITPro 感到无比轻松。</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;参考：<a title="Hyper-V 副本概述" href="http://technet.microsoft.com/zh-cn/library/jj134172.aspx" target="_blank">Hyper-V 副本概述</a>、<a title="演示 Hyper-V 副本" href="http://technet.microsoft.com/zh-cn/library/hh831759.aspx">演示 Hyper-V 副本</a>、<a title="Deploy Hyper-V Replica" href="http://technet.microsoft.com/zh-cn/library/jj134207.aspx">Deploy Hyper-V Replica</a></p><br/>Tags - <a href="https://goxia.maytide.net/go.php/tags/microsoft/" rel="tag">microsoft</a> , <a href="https://goxia.maytide.net/go.php/tags/windows/" rel="tag">windows</a> , <a href="https://goxia.maytide.net/go.php/tags/server/" rel="tag">server</a> , <a href="https://goxia.maytide.net/go.php/tags/2012/" rel="tag">2012</a> , <a href="https://goxia.maytide.net/go.php/tags/r2/" rel="tag">r2</a> , <a href="https://goxia.maytide.net/go.php/tags/rtm/" rel="tag">rtm</a> , <a href="https://goxia.maytide.net/go.php/tags/hyper-v/" rel="tag">hyper-v</a> , <a href="https://goxia.maytide.net/go.php/tags/replica/" rel="tag">replica</a>
]]>
</description>
</item>
</channel>
</rss>