查看完整版本: [轉貼]VMware备份策略之VADP

chun 2012-6-19 16:42

[轉貼]VMware备份策略之VADP

<a href="http://www.storageonline.com.cn/virtualtech/vmware/vmware-backp-via-vadp/">http://www.storageonline.com.cn/virtualtech/vmware/vmware-backp-via-vadp/</a>
<div><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">在2009年5月随着<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vsphere/" title="查看 vSphere 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">vSphere</a></span>&nbsp;4.0的发布,<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vmware/" title="查看 VMware 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">VMware</a></span>对外公开了其新一代备份API接口vStorage APIs for DataProtection(<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vadp/" title="查看 VADP 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">VADP</a></span>,<a href="http://www.vmware.com/products/vstorage-apis-for-data-protection/features.html" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">http://www.vmware.com/products/vstorage-apis-for-data-protection/features.html</a>​),并且在<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vsphere/" title="查看 vSphere 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">vSphere</a></span>4.1发布后确立<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vadp/" title="查看 VADP 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">VADP</a></span>成为唯一推荐的备份API接口,改变了之前VADP和VCB (<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vmware/" title="查看 VMware 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">VMware</a></span>&nbsp;Consolidated Backup)共存的局面(下文中会对VCB进行简单介绍)。需要指出的是VADP并不是<span class="wp_keywordlink_affiliate" style="margin: 0px; padding: 0px; font-weight: bold; "><a href="http://www.storageonline.com.cn/tag/vsphere/" title="查看 vSphere 中的全部文章" target="_blank" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">vSphere</a></span>4.0才提出的新东西,它的很多功能从ESX3.02就开始被支持了,只不过一些关键特性比如CBT (ChangeBlock Tracking) 直到vSphere4.0才被加进来。VADP简单点说就是一系列管理和数据的API接口。通过这些API接口,用户(包括备份软件)可以在不影响目标虚拟机运行状态的前提下对虚拟机进行备份和恢复,包括:1. 对虚拟机磁盘文件进行整体或者增量备份和恢复;2. 对Guest OS进行文件级别的备份和恢复,目前支持Windows和Linux系统;3. 如果Guest OS是Windows系统,还能够利用Windows Volume Shadow Copy Services(VSS)来保证数据一致性。而且VADP提供的是一套Agentless的备份解决方案,好在哪里大家可以参考KendrickColeman在他的技术博客 (<a href="http://kendrickcoleman.com/index.php?/Tech-Blog/backup-agents-are-dead-to-me.html" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">http://kendrickcoleman.com/index.php?/Tech-Blog/backup-agents-are-dead-to-me.html</a>) 中列举的在虚拟化环境中Backup Agent必死的十大理由。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 用VADP对虚拟机进行备份的过程如图表1所示。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); "><img src="http://www.storageonline.com.cn/wp-content/uploads/2011/11/ea56_88ca09aajw1dng9j2cb9rj.jpg" style="border: 0px; max-width: 600px; "></p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">图表 1</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">1. 调用vSphere SDKAPI对目标虚拟机创建Snapshot;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">2. 调用VDDK中的Virtual Disk Library API (VixDiskLib API,目前只提供C语言接口)访问新创建的Snapshot,读取虚拟机磁盘文件;如果需要访问Guest OS 文件系统,可以调用VDDK中的Virtual Disk Mount API (VixMntapi,目前只提供C语言接口)把虚拟机磁盘mount到本地,然后像访问本地文件系统那样访问Guest OS的文件系统。VDDK详细文档请参考:http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.vddk.pg.doc_50/vddkPreface.html</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">3. 备份虚拟机磁盘文件或者Guest OS文件系统中的文件到目标存储服务器;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">4. 调用vSphere SDKAPI来删除第一步创建的Snapshot。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 要体会VADP带来的便利性,我们最好先了解下在推出VADP之前,VMware提供的备份接口VCB。VCB全称为VMware Consolidated Backup (http://www.vmware.com/pdf/vi3_consolidated_backup.pdf),同样是提供对虚拟机的虚拟机磁盘和文件级别的数据保护。如图表2所示,大家可以发现通过VCB对虚拟机进行备份的过程大体上和VADP类似,只不过用VCB需要一台Windows机器作为Proxy并在其上安装VCB软件,正如图表2中的Backup Proxy Server。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); "><img src="http://www.storageonline.com.cn/wp-content/uploads/2011/11/60eb_88ca09aajw1dng9ioyh03j.jpg" style="border: 0px; max-width: 600px; "></p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">图表 2</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 相比较,VADP并不涉及任何备份操作,而是仅包括一系列API接口,也不需要用户安装专门的软件,可以很方便地被集成到各种备份软件中。图表3总结了VADP和VCB的更详细的差别。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); "><img src="http://www.storageonline.com.cn/wp-content/uploads/2011/11/dbbb_88ca09aajw1dng9ihjpsrj.jpg" style="border: 0px; max-width: 600px; "></p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">图表 3</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 除此之外,VADP另外一个具有巨大进步意义的新特性是CBT (ChangeBlock Tracking),简单讲CBT能够使VMKernel记住自上次Snapshot以来哪些数据块被改动了,从而原生支持增量备份。比如,用户每周都要对一个虚拟机进行完整备份,每天对虚拟机进行增量备份。在没有CBT之前,用户每天都需要拷贝完整虚拟机磁盘文件,然后计算出增量部分进行备份;而使用CBT后,用户在备份之前可以询问VMKernel哪些数据块自上次Snapshot后发生过修改,之后只备份修改过的数据。较详细的CBT工作过程如下:</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">1. 全备份:创建虚拟机的Snapshot,并对Snapshot进行备份来实现虚拟机的全备份;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">2. 通过vShpere API读取第一步创建的Snapshot磁盘文件的ChangeId (VirtualDisk.getBacking.getChangeId),并保存;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">3. 调用vShpere API中的queryChangedDiskAreas 方法(详细文档请参考:http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.VirtualMachine.html#queryChangedDiskAreas)并传入第二步保存的ChangeId作为参数,获得自上次Snapshot全备份后的修改文件块,保存这些修改文件块作为增量备份;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">4. 重复第三步完成每日增量备份;</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">5. 重复1~4步完成新一周的备份计划。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 显而易见,使用CBT不仅仅可以极大地缩短备份窗口,而且还能够显著的减轻对底层存储设备的IO负担。不过值得注意的是,由于CBT会对虚拟机性能多少会有些影响,因此虚拟机关于CBT的配置项并不是默认打开的。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">&nbsp;&nbsp;&nbsp; 总结下来,VADP利用<a href="http://www.vmware.com/cn/products/datacenter-virtualization/vsphere/vmfs/overview.html" style="color: rgb(10, 149, 170); text-decoration: none; padding: 0px 3px; font-style: italic; ">VMwarevStorage VMFS</a>的Snapshot功能来实现虚拟机备份,通过CBT技术提供给备份软件足够的支持来实现增量备份。借助 VADP,用户不需要在目标虚拟机上安装Backup Agent,通过一个支持VADP的备份软件,就可以在不增加ESX服务器负载以及不影响虚拟机运行状态的基础上,对给定的ESX服务器上所有的虚拟机进行集中式、全面的备份和恢复。</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">关于作者</p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); "><img src="http://www.storageonline.com.cn/wp-content/uploads/2011/11/4a8b_88ca09aajw1dng9fzlzypj.jpg" style="border: 0px; max-width: 600px; "></p><p style="margin-top: 0.7em; margin-bottom: 0.7em; padding-top: 10px; padding-bottom: 5px; line-height: 1.8em; color: rgb(22, 21, 20); font-family: Tahoma, 'Century gothic', Arial, Tahoma, sans-serif; background-color: rgb(244, 245, 247); ">郭峰,EMC中国研究院云平台及应用实验室高级研究员,毕业于同济大学,主要关注云计算服务平台及应用。</p></div>
頁: [1]
查看完整版本: [轉貼]VMware备份策略之VADP