qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Bug 1399191] [NEW] Large VHDX image size
Date: Tue, 20 Jan 2015 21:10:39 -0000	[thread overview]
Message-ID: <20150120211039.GA19775@localhost.localdomain> (raw)
In-Reply-To: 325E406FF3148746AE850A462FB06F45024B26@MX105CL02.corp.emc.com

On Mon, Jan 19, 2015 at 03:19:05PM +0000, Lokesha, Amulya wrote:
> 
> 
> -----Original Message-----
> From: Jeff Cody [mailto:jcody@redhat.com] 
> Sent: Tuesday, January 13, 2015 9:18 AM
> To: Lokesha, Amulya
> Cc: Bug 1399191; Geoffroy, Daniel
> Subject: Re: [Qemu-devel] [Bug 1399191] [NEW] Large VHDX image size
> 
> On Sun, Jan 11, 2015 at 11:33:31PM -0500, Lokesha, Amulya wrote:
> > Please find comments inline
> > 
> > -----Original Message-----
> > From: bounces@canonical.com [mailto:bounces@canonical.com] On Behalf 
> > Of Jeff Cody
> > Sent: Wednesday, January 07, 2015 9:11 PM
> > To: Lokesha, Amulya
> > Subject: Re: [Qemu-devel] [Bug 1399191] [NEW] Large VHDX image size
> > 
> > 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
> > 
> > --
> > 
> > Hi Jeff,
> > 
> > Could you please give us a possible timeline of when fix will be 
> > available. Our customers are waiting on this as we are blocked with 
> > the image creation.
> > 
> > Thanks, Amulya
> 
> Hi Amulya,
> 
> I have my MSDN stuff sorted out now, so give me a day or two get my test machine up and running & testing.
> 
> -Jeff
> 
> 
> Hi Jeff,
> 
> Any updates on this? Where you able to get it tested
> 
>  Thanks,
> -Amulya
> 

Yes, I have sent a patch that I believe fixes the issue (I cc'ed you
on the patch).  If you wouldn't mind testing, and verifying that it
fixes your particular issue, that would be great.  I tested on Windows
Server 2012 w/Hyper-V, and I was able to verify the original problem
and the fix.

On what the issue was:

The v1.0.0 spec for VHDX denotes that the FileOffsetMB portion of the
block state field is 'reserved' for blocks in the state
PAYLOAD_BLOCK_ZERO.  Before, we just went ahead and wrote the file
offset value for that block into the field, and just ignored it during
reads.

If we force the FileOffsetMB field to be zero, then Hyper-V is able to
read the images.  Furthermore, inspecting images converted by
Hyper-V shows that Hyper-V writes '0' for the FileOffsetMB
field in BAT entries that are in the PAYLOAD_BLOCK_ZERO state.

The patch I sent mimics that behavior, and forces any BAT writes of
PAYLOAD_BLOCK_ZERO state to have a FileOffsetMB value of 0.

> > 
> > 
> > You received this bug notification because you are subscribed to the bug report.
> > https://bugs.launchpad.net/bugs/1399191
> > 
> > Title:
> >   Large VHDX image size
> > 
> > Status in QEMU:
> >   New
> > 
> > Bug description:
> >   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
> > 
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/qemu/+bug/1399191/+subscriptions

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1399191

Title:
  Large VHDX image size

Status in QEMU:
  New

Bug description:
  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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1399191/+subscriptions

  reply	other threads:[~2015-01-20 21:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 13:31 [Qemu-devel] [Bug 1399191] [NEW] Large VHDX image size AMULYA L
2015-01-07 15:30 ` Stefan Hajnoczi
2015-01-07 15:40   ` Jeff Cody
2015-01-12  4:33     ` AMULYA L
2015-01-13  3:48       ` Jeff Cody
2015-01-19 15:19         ` AMULYA L
2015-01-20 21:10           ` Jeff Cody [this message]
2015-01-22  5:20             ` AMULYA L
2015-01-22 16:02               ` Jeff Cody
2015-01-22 17:39 ` Jeff Cody
2015-12-28  2:12 ` [Qemu-devel] [Bug 1399191] " Jan
2015-12-28  2:14 ` Jan
2015-12-31  4:54 ` Sitsofe Wheeler
2016-01-04 17:51 ` Max Reitz
2016-03-10  9:57 ` Jan
2017-11-27 13:45 ` Thomas Huth
2018-01-27  4:17 ` Launchpad Bug Tracker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150120211039.GA19775@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=1399191@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).