{"id":9329,"date":"2009-01-08T14:35:00","date_gmt":"1999-11-29T20:00:00","guid":{"rendered":"https:\/\/aidanfinn.com\/?p=9329"},"modified":"2009-01-08T14:35:00","modified_gmt":"1999-11-29T20:00:00","slug":"moving-a-vm-with-differencing-disks","status":"publish","type":"post","link":"https:\/\/aidanfinn.com\/?p=9329","title":{"rendered":"Moving A VM With Differencing Disks"},"content":{"rendered":"<p>I&#8217;ve a lab machine running Hyper-V.\u00a0 I&#8217;ve a number of lab machines on there, all using differencing disks.\u00a0 I&#8217;m budget conscious with this machine so I use a single internal disk partition to store VM&#8217;s and the source disks for the differencing disks.<\/p>\n<p>I needed to move two of these lab VM&#8217;s onto another server.\u00a0 I don&#8217;t manage the lab machine with VMM (I&#8217;ve previously referred to a VMM agent refresh issue which PSS are looking into) so I did a manual move.\u00a0 I set up VM&#8217;s without hard disks on the destination host.\u00a0 I powered down the VM&#8217;s on the source host.<\/p>\n<p>Watch out for snapshots!\u00a0 I had snapshots on the lab VM&#8217;s.\u00a0 Snapshots are differencing disks.\u00a0 When you take a snapshot, a new differencing disk is created behind the scenes.\u00a0 It uses your VM&#8217;s disk as a source disk.\u00a0 All changes following the snapshot are stored in the differencing disk.\u00a0 If I had copied the VHD of the VM disk to the new host server then I&#8217;d lose everything since the snapshot.\u00a0 The solution?\u00a0 Copy the VHD to keep it safe so you have something to rollback to (if you need to do this).\u00a0 Delete the snapshot to trigger a merge.\u00a0 Anything in the snapshot will be merged back into the VM&#8217;s VHD.\u00a0 Now you can copy this file to the destination server &#8230;<\/p>\n<p>&#8230; but not if the VM&#8217;s disk was a differencing disk!\u00a0 Otherwise when you bind it to the new VM and power it up you get an alert:<\/p>\n<p><em>&quot;VM001: Failed to open virtual disk &#8230;. A problem was encountered opening a virtual disk in the chain of differencing disks, &#8230;.. (referenced by &#8230;.): &#8216;The sytem cannot find the file specified.&#8217; (0x80070002). (Virtual machine &#8230;..)&quot;.<\/em><\/p>\n<p>That appears in the event log in Application Logs and ServicesMicrosoftWindowsHyper-V-WorkerAdmin as an Error with a source of Hyper-V-Worker and an event ID of 12142.<\/p>\n<p>The solution is simple.\u00a0 Edit the disk&#8217;s properties on the source VM.\u00a0 Edit the disk and select &quot;Merge&quot;.\u00a0 This will give you two options:<\/p>\n<ul>\n<li>To the parent virtual hard disk: In this scenario you do not want to do this.\u00a0 This will save changes to the source virtual disk that many of your other VM&#8217;s may be using.\u00a0 Not good!<\/li>\n<li>To a new virtual hard disk: This will create a new VHD file in a selected location.\u00a0 This is the one to use in this scenario.<\/li>\n<\/ul>\n<p>You now can create either a fixed size (required for production) or dynamic VHD.\u00a0 This will run pretty quickly.\u00a0 Once complete you can copy the VHD to your destination host server and bind it to the VM.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve a lab machine running Hyper-V.\u00a0 I&#8217;ve a number of lab machines on there, all using differencing disks.\u00a0 I&#8217;m budget conscious with this machine so I use a single internal disk partition to store VM&#8217;s and the source disks for the differencing disks. I needed to move two of these lab VM&#8217;s onto another server.\u00a0 &hellip; <a href=\"https:\/\/aidanfinn.com\/?p=9329\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Moving A VM With Differencing Disks&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-9329","post","type-post","status-publish","format-standard","hentry","category-hyper-v"],"aioseo_notices":[],"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/9329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9329"}],"version-history":[{"count":0,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/9329\/revisions"}],"wp:attachment":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}