{"id":9318,"date":"2009-01-05T14:29:00","date_gmt":"1999-11-29T20:00:00","guid":{"rendered":"https:\/\/aidanfinn.com\/?p=9318"},"modified":"2009-01-05T14:29:00","modified_gmt":"1999-11-29T20:00:00","slug":"convert-to-fixed-type-virtual-hard-disk","status":"publish","type":"post","link":"https:\/\/aidanfinn.com\/?p=9318","title":{"rendered":"Convert To Fixed Type Virtual Hard Disk"},"content":{"rendered":"<p>It is possible to convert a dynamic virtual hard disk (VHD) to a fixed size VHD.\u00a0 I found myself doing this when I needed to migrate a machine from an R&amp;D environment to production.\u00a0 Note that the VM (if the disk is attached to a VM) must be powered off to do this.<\/p>\n<p>If you use Hyper-V without Virtual Machine Manager 2008 then you can do this using the Hyper-V console.\u00a0 Edit the virtual machine in question (if applicable), select the disk and click on &lt;EDIT&gt;.\u00a0 Choose to convert the disk.\u00a0 You&#8217;ll then be asked where to place the new disk.\u00a0 Be wary here if you use dedicated volumes for each VM, e.g. in a Windows 2008 cluster.\u00a0 There may not be enough disk space in the existing disks volume for the new fixed sized disk that will be created &#8211; that&#8217;s correct; it doesn&#8217;t convert the disk, it creates a new one.\u00a0 Choose a suitable temporary location and name.\u00a0 For example, my VHD might be called Disk0.VHD and I&#8217;d convert to Disk0Full.vhd.\u00a0 When finished, I&#8217;d rename them, e.g. Disk0.VHD -&gt; DiskDyn.VHD and Disk0Full.VHD -&gt; Disk0.VHD.\u00a0 Swap the files and then restart the VM.<\/p>\n<p>It&#8217;s both easier and more complex using VMM.\u00a0 You can select the VM in question and select the disk.\u00a0 Tick the box for &quot;Convert to Fixed Type Virtual Hard Disk&quot; and apply the changes.\u00a0 A new job will start.\u00a0 This creates a new VHD in the <em>same volume<\/em> as the existing VM.\u00a0 That&#8217;s a bit nasty.\u00a0 You tend to limit the size of the LUN in question to avoid wastage when using a cluster.\u00a0 So odds are, this will fail unless you&#8217;ve plenty of spare space in the LUN &#8211; remember the LUN will contain both the original dynamic disk and the converted fixed size disk for at least a short period of time.\u00a0 Temporarily increasing and decreasing the volume size should not be done, even if your SAN can do it &#8230; my testing phase showed that it corrupts the contents of the volume.\u00a0 The nice bit of this process is that all the file renaming and swapping is done for you.\u00a0 I just wish you could pick a temporary location for the file conversion process.\u00a0 That <em>might<\/em> be possible using PowerShell.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is possible to convert a dynamic virtual hard disk (VHD) to a fixed size VHD.\u00a0 I found myself doing this when I needed to migrate a machine from an R&amp;D environment to production.\u00a0 Note that the VM (if the disk is attached to a VM) must be powered off to do this. If you &hellip; <a href=\"https:\/\/aidanfinn.com\/?p=9318\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Convert To Fixed Type Virtual Hard Disk&#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-9318","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\/9318","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=9318"}],"version-history":[{"count":0,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/9318\/revisions"}],"wp:attachment":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}