{"id":2452,"date":"2018-04-16T08:58:10","date_gmt":"2018-04-16T06:58:10","guid":{"rendered":"http:\/\/possiblelossofprecision.net\/?p=2452"},"modified":"2021-05-15T11:46:36","modified_gmt":"2021-05-15T09:46:36","slug":"convert-a-disk-image-to-vhd-for-azure","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=2452","title":{"rendered":"Converting a disk image to VHD for Azure"},"content":{"rendered":"<p>Currently the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fedora_Project\">Fedora projects<\/a> provides <a href=\"https:\/\/dl.fedoraproject.org\/pub\/fedora\/linux\/releases\/27\/CloudImages\/x86_64\/images\/\">cloud images<\/a> as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Qcow\">qcow2<\/a> and raw disk files. Microsoft&#8217;s Azure however only supports <a href=\"https:\/\/en.wikipedia.org\/wiki\/VHD_(file_format)\">VHD<\/a> files. Fortunately <em>qemu-img<\/em> can convert between those formats:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nqemu-img convert -f qcow2 -o subformat=fixed,force_size -O vpc \\\r\n  Fedora-Cloud-Base-27-1.6.x86_64.qcow2 \\\r\n  Fedora-Cloud-Base-27-1.6.x86_64.vhd\r\n<\/pre>\n<p>Note that the subformat options <strong><em>fixed<\/em><\/strong> and <strong><em>force_size<\/em><\/strong> are required for Azure to be able to use the disk image since Azure <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/virtual-machines\/windows\/prepare-for-upload-vhd-image\">only supports fixed sized disks<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Currently the Fedora projects provides cloud images as qcow2 and raw disk files. Microsoft&#8217;s Azure however only supports VHD files. Fortunately qemu-img can convert between those formats: qemu-img convert -f qcow2 -o subformat=fixed,force_size -O vpc \\ Fedora-Cloud-Base-27-1.6.x86_64.qcow2 \\ Fedora-Cloud-Base-27-1.6.x86_64.vhd Note that the subformat options fixed and force_size are required for Azure to be able to use the disk image since&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=2452\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[82,13,7],"class_list":["post-2452","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-azure","tag-centos","tag-fedora"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2452"}],"version-history":[{"count":6,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2452\/revisions"}],"predecessor-version":[{"id":2459,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2452\/revisions\/2459"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}