{"id":924,"date":"2012-03-06T00:54:07","date_gmt":"2012-03-06T05:54:07","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=924"},"modified":"2012-03-06T00:54:07","modified_gmt":"2012-03-06T05:54:07","slug":"hyper-v-i-need-to-merge-my-avhd-and-vhd-what-to-do","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=924","title":{"rendered":"Hyper-V\u2013I need to Merge my AVHD and VHD\u2013What to do?!"},"content":{"rendered":"<div>\n<div>By<\/p>\n<address><a href=\"http:\/\/ye110beard.spaces.live.com\/\">Sean Kearney<\/a><\/address>\n<p>on <abbr title=\"2011-06-19T09:44:34-05:00\">June 19, 2011 9:44 AM <\/abbr><\/div>\n<\/div>\n<div>\n<div>\n<p>http:\/\/www.energizedtech.com\/2011\/06\/hypervi-need-to-merge-my-avhd.html<\/p>\n<p>First rule.\u00a0 DO NOT Take a Snapshot in your Production environment.\u00a0 Avoid it at all costs whether it\u2019s VMware or Hyper-V.\u00a0 It\u2019s a massive risk to the data if corruption occurs.<\/p>\n<p><!--more--><\/p>\n<p>Now if you IGNORED this rule or you HAD to do something that INSISTED on this happening, don\u2019t sweat it.<\/p>\n<p>The problem is sometimes we (as humans) make mistakes.\u00a0 The snapshot gets taken *and* get\u2019s forgotten about.\u00a0 So you have to Merge it.<\/p>\n<p>Normally in Hyper-V if you do a shutdown of the Virtual Machine, the environment WILL automatically start merging.\u00a0 This is the norm.<\/p>\n<p>But factors can affect this.\u00a0 Space, Murphy and the Unknown are the uncontrollable factors we Professionals have to deal with.\u00a0 However it\u2019s good to know there is a fallback.\u00a0 You can do it manually.<\/p>\n<p>*klunk*<\/p>\n<p>Yes, manually.\u00a0\u00a0 Now no matter how much data you have, no matter how long it takes\u2026 BACK IT UP FIRST!!!<\/p>\n<p>I say this because you always (no matter your skillset, no matter what you think SHOULD happen) you have to plan for the UNexpected.\u00a0 Power outage, corrupt files on the server, the Host dying during the process.\u00a0 Fortunately in my experience Hyper-V is well designed for the unexpected.<\/p>\n<p>Let\u2019s also think about just what an AVHD file is.\u00a0\u00a0 It is closer to a list of transactions than a virtual hard drive.\u00a0\u00a0 So when Hyper-V goes to merge the data, it is examining the transactions and building the drive structure to commit it.\u00a0 If you lose power, you still shouldn\u2019t lose data.<\/p>\n<p>But if you need to do a manual merge (Perhaps you would like to rebuild those files offline to avoid issues?) this is also a simple process. (Although scary the first time you try it!)<\/p>\n<p>Rename all the \u201cAVHD\u201d files to VHD<\/p>\n<p>Go to Hyper-V and choose \u201cEDIT DISK\u201d.\u00a0 Browse to the folder of the files.<\/p>\n<p>Find the NEWEST file (That was an AVHD and is now a VHD) and select it.<\/p>\n<p>You MAY get an option to \u201cReconnect to Parent\u201d.\u00a0 This can be normal if you have MULTIPLE Avhd files.\u00a0\u00a0 Take note of the ORIGINAL filename and connect to that file in your current folder (if you read the screen Hyper-V is actually prompting you).\u00a0 The AVHD\u2019s refer to the original VHD (if they are the first Snapshot *or* they will refer to the PREVIOUS Avhd file.<\/p>\n<p>If you get a Reconnect, the choose the proper file and back to EDIT and REselect the Newest file again.\u00a0\u00a0 You will now be presented with \u201cCompact\u201d or \u201cMerge\u201d as your options.\u00a0 Choose \u201cMerge\u201d<\/p>\n<p>Let the file Merge (Depending on the size it could take a bit, don\u2019t worry and don\u2019t panic)<\/p>\n<p>Repeat the process going back a file and back a file until you only have you VHD<\/p>\n<p>If you\u2019re concerned about the content afterwards and don\u2019t want to chance a boot, Remember in Server 2008R2 and Server 2008 in DiskMgmt you can attach the VHD in Readonly mode to verify the content.<\/p>\n<p>Now in my case my Hyper-V files are well organized.\u00a0 You may find out yours are still in the default location like C:\\ProgramData\\Microsoft\\Hyper-V .\u00a0 But one of the nice things about the AVHD files (Snapshots) is they mimic the name of the VHD file.\u00a0 so if your Parent VHD was called<\/p>\n<p><strong><em>CONTOSOFPS.VHD<\/em><\/strong><\/p>\n<p>you\u2019ll find the AVHD files will have names like.<\/p>\n<p><strong><em>CONTOSOFPS_032CB447-0077-4A39-8F99-5AF874F20A6D.AVHD<br \/>\nCONTOSOFPS_526AEF34-C557-4318-B242-337EC548F7E0.AVHD<\/em><\/strong><\/p>\n<p>If you have to go digging, you usually don\u2019t.<\/p>\n<p>Also some more details I found out.<\/p>\n<p>600 gigabytes on a Strong Raid 5 controller over SAN is about 6 hours to Merge.\u00a0 I found similar numbers when working directly from Raid 5 Sata drives.<\/p>\n<p>It will Merge One AVHD file at a time.\u00a0 this is Good to know because if you\u2019re watching you WILL actually see the AVHD files disappear, Newest to oldest.\u00a0\u00a0 (As the Newest is Merged INTO it\u2019s predecessor)<\/p>\n<p>It does NOT build a \u201cNEW\u201d Vhd file, so disk space (As far as I can tell) is NOT an issue unless the parent is meant to \u201cGrow\u201d in the process.\u00a0\u00a0 But between the Parent and the Removed child, you should be ok\u2026<\/p>\n<p>So just remember.\u00a0\u00a0 Don\u2019t panic if you have a massive amount to Merge.\u00a0 It will happen.\u00a0 If you\u2019re nervous, copy the files ELSEWHERE and begin doing a Manual merge of the backups in Hyper-V.\u00a0 The good part there is you can mount it all afterwards to verify the status.<\/p>\n<p>\u2026. Most of all just be cautious, but be confident.\u00a0 It will all work out.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>By Sean Kearney on June 19, 2011 9:44 AM http:\/\/www.energizedtech.com\/2011\/06\/hypervi-need-to-merge-my-avhd.html First rule.\u00a0 DO NOT Take a Snapshot in your Production environment.\u00a0 Avoid it at all costs whether it\u2019s VMware or Hyper-V.\u00a0 It\u2019s a massive risk to the data if corruption &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=924\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-924","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=924"}],"version-history":[{"count":2,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":926,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/924\/revisions\/926"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}