From: Stefan Hajnoczi <stefanha@redhat.com>
To: Nir Soffer <nsoffer@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Maor Lipchuk <mlipchuk@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
Eric Blake <eblake@redhat.com>, Alberto Garcia <berto@igalia.com>,
John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [RFC v2 0/8] qemu-img: add measure sub-command
Date: Mon, 20 Mar 2017 15:51:15 +0000 [thread overview]
Message-ID: <20170320155115.GE7320@stefanha-x1.localdomain> (raw)
In-Reply-To: <CAMRbyyuOxePB5ErcGmkTErSd0FiezgaAjCDGRJWAr4ZGOgcK2A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3159 bytes --]
On Fri, Mar 17, 2017 at 11:45:20PM +0000, Nir Soffer wrote:
> On Wed, Mar 15, 2017 at 11:29 AM Stefan Hajnoczi <stefanha@redhat.com>
> wrote:
>
> > RFCv2:
> > * Publishing RFC again to discuss the new user-visible interfaces. Code
> > has
> > changed quite a bit, I have not kept any Reviewed-by tags.
> > * Rename qemu-img sub-command "measure" and API bdrv_measure() [Nir]
> > * Report both "required bytes" and "fully allocated bytes" to handle the
> > empty
> > image file and prealloc use cases [Nir and Dan]
> > * Use bdrv_getlength() instead of bdrv_nb_sectors() [Berto]
> > * Rename "err" label "out" in qemu-img-cmds.c [Nir]
> > * Add basic qcow2 support, doesn't support qemu-img convert from existing
> > files yet
> >
> > RFCv1:
> > * Publishing patch series with just raw support, no qcow2 yet. Please
> > review
> > the command-line interface and let me know if you are happy with this
> > approach.
> >
> > Users and management tools sometimes need to know the size required for a
> > new
> > disk image so that an LVM volume, SAN LUN, etc can be allocated ahead of
> > time.
> > Image formats like qcow2 have non-trivial metadata that makes it hard to
> > estimate the exact size without knowledge of file format internals.
> >
> > This patch series introduces a new qemu-img sub-command that calculates the
> > required size for both image creation and conversion scenarios.
>
>
> > The conversion scenario is:
> >
> > $ qemu-img measure -f raw -O qcow2 input.img
> > required bytes: 1327680
> > fully allocated bytes: 1074069504
>
>
> Other commands like qemu-img info are using "size" instead of "bytes", I
> guess
> we like to keep the term "size" for consistency.
Will fix.
> Here an existing image file is taken and the output includes the space
> > required
> > for data from the input image file.
> >
> > The creation scenario is:
> >
> > $ qemu-img measure -O qcow2 --size 5G
> > required bytes: 327680
> > fully allocated bytes: 1074069504
> >
>
> There is a third scenario that you may want to describe
> here, extending a block device when it becomes full. In this case
> we want to limit the block device to the fully allocated size, including
> additional size needed for bitmaps. Currently ovirt is using virtual_size *
> 1.1
> for this limit, which seems to work for images without additional bitmaps.
Please elaborate, I'm not sure which use case you mean:
1. The user wishes to grow the virtual disk size because the guest has
filled up the disk.
2. The block device was thinly provisioned and needs to grow so that the
guest can write more data. In this case the virtual disk size stays
constant.
Case #1 is the qemu-img convert case. We have an existing file with
some data and the new image will have a larger virtual disk size.
(Nevermind that no actual new image needs to be created.)
Regarding case #2, the management tool doesn't need qemu-img measure.
It just increments the block device size by an arbitrary amount (e.g. 1
GB) whenever the write threshold is reached.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
prev parent reply other threads:[~2017-03-20 15:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 9:29 [Qemu-devel] [RFC v2 0/8] qemu-img: add measure sub-command Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 1/8] block: add bdrv_measure() API Stefan Hajnoczi
2017-03-16 1:01 ` Max Reitz
2017-03-16 3:38 ` Stefan Hajnoczi
2017-03-16 4:02 ` Max Reitz
2017-03-18 0:51 ` Nir Soffer
2017-03-20 15:37 ` Stefan Hajnoczi
2017-03-18 1:28 ` Nir Soffer
2017-03-20 15:34 ` Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 2/8] raw-format: add bdrv_measure() support Stefan Hajnoczi
2017-03-18 1:11 ` Nir Soffer
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 3/8] qcow2: extract preallocation calculation function Stefan Hajnoczi
2017-03-16 1:18 ` Max Reitz
2017-03-16 3:40 ` Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 4/8] qcow2: extract image creation option parsing Stefan Hajnoczi
2017-03-18 20:14 ` Nir Soffer
2017-03-20 15:40 ` Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 5/8] qcow2: add bdrv_measure() support Stefan Hajnoczi
2017-03-16 1:57 ` Max Reitz
2017-03-16 3:41 ` Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 6/8] qemu-img: add measure subcommand Stefan Hajnoczi
2017-03-16 1:46 ` Max Reitz
2017-03-16 3:45 ` Stefan Hajnoczi
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 7/8] qemu-iotests: support per-format golden output files Stefan Hajnoczi
2017-03-16 1:51 ` Max Reitz
2017-03-15 9:29 ` [Qemu-devel] [RFC v2 8/8] iotests: add test 178 for qemu-img measure Stefan Hajnoczi
2017-03-18 21:04 ` Nir Soffer
2017-03-20 15:43 ` Stefan Hajnoczi
2017-03-17 23:45 ` [Qemu-devel] [RFC v2 0/8] qemu-img: add measure sub-command Nir Soffer
2017-03-20 15:51 ` Stefan Hajnoczi [this message]
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=20170320155115.GE7320@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=berrange@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mlipchuk@redhat.com \
--cc=nsoffer@redhat.com \
--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).