Large VHDX image size We are trying to convert a VMDK image to VHDX image for deploy to HyperV Server ( SCVMM 2012 SP1) using qemu-img. We tried converting the image using both 'fixed' as well as 'dynamic' format. We found that both the disks occupy the same size of 50GB. When the same is done with VHD image, we found that the dynamic disks are much lesser in size (5 GB) than the fixed disk (50GB). Why is that the VHDX generates large sized images for both the formats? The following commands were used to convert the vmdk image to VHDX format 1. qemu-img convert -p -o subformat=fixed -f vmdk -O vhdx Test.vmdk Test-fixed.vhdx qemu-img info Test-fixed.vhdx image: Test-fixed.vhdx file format: vhdx virtual size: 50G (53687091200 bytes) disk size: 50G cluster_size: 16777216 2. qemu-img convert -p -o subformat=dynamic -f vmdk -O vhdx Test.vmdk Test-dynamic.vhdx qemu-img info Test-dynamic.vhdx image: Test-dynamic.vhdx file format: vhdx virtual size: 50G (53687091200 bytes) disk size: 50G cluster_size: 16777216 We tried this with the following version of qemu 1. qemu-2.0.0 2. qemu-2.1.2 3. qemu-2.2.0-rc4 Please let us know how to create compact VHDX images using qemu-img. Thank you On Thu, Dec 04, 2014 at 01:31:38PM -0000, AMULYA L wrote: > Public bug reported: > > We are trying to convert a VMDK image to VHDX image for deploy to HyperV Server ( SCVMM 2012 SP1) using qemu-img. > We tried converting the image using both 'fixed' as well as 'dynamic' format. We found that both the disks occupy the same size of 50GB. When the same is done with VHD image, we found that the dynamic disks are much lesser in size (5 GB) than the fixed disk (50GB). > > Why is that the VHDX generates large sized images for both the formats? > > The following commands were used to convert the vmdk image to VHDX > format Jeff, did you fix this recently in commit 85b712c9d5b873562c864e72f69cbf0d87d2fe40 ("block: vhdx - set .bdrv_has_zero_init to bdrv_has_zero_init_1")? Stefan On Wed, Jan 07, 2015 at 03:30:28PM +0000, Stefan Hajnoczi wrote: > On Thu, Dec 04, 2014 at 01:31:38PM -0000, AMULYA L wrote: > > Public bug reported: > > > > We are trying to convert a VMDK image to VHDX image for deploy to HyperV Server ( SCVMM 2012 SP1) using qemu-img. > > We tried converting the image using both 'fixed' as well as 'dynamic' format. We found that both the disks occupy the same size of 50GB. When the same is done with VHD image, we found that the dynamic disks are much lesser in size (5 GB) than the fixed disk (50GB). > > > > Why is that the VHDX generates large sized images for both the formats? > > > > The following commands were used to convert the vmdk image to VHDX > > format > > Jeff, did you fix this recently in commit > 85b712c9d5b873562c864e72f69cbf0d87d2fe40 ("block: vhdx - set > .bdrv_has_zero_init to bdrv_has_zero_init_1")? > > Stefan Yes, although there has been a report that there are issues in the resulting vhdx image in a MS server, after this patch. I am going to test and fix (if confirmed) once my MSDN subscription is renewed (in process now, I expect it anytime). Jeff Please find comments inline -----Original Message----- From: