qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] delvm does not reduce the qcow2 file size
@ 2012-10-15  9:33 Kuniyasu Suzaki
  2012-10-15 13:25 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Kuniyasu Suzaki @ 2012-10-15  9:33 UTC (permalink / raw)
  To: qemu-devel


Hello,

"delvm" is a command to delete a snapshot image in a qcow2 file.
However it does not reduce the qcow2 file size.

Is there any method to reduce the qcow2 file size when I delete a snapshot image?
should I "convert" the qcow2 file?

------
suzaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-15  9:33 [Qemu-devel] delvm does not reduce the qcow2 file size Kuniyasu Suzaki
@ 2012-10-15 13:25 ` Paolo Bonzini
  2012-10-15 14:24   ` Kevin Wolf
  2012-10-16  6:23   ` Kuniyasu Suzaki
  0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2012-10-15 13:25 UTC (permalink / raw)
  To: Kuniyasu Suzaki; +Cc: qemu-devel

Il 15/10/2012 11:33, Kuniyasu Suzaki ha scritto:
> Hello,
> 
> "delvm" is a command to delete a snapshot image in a qcow2 file.
> However it does not reduce the qcow2 file size.

Note that the file will not grow when new allocations are performed in
the future.

QEMU should also convert the unused clusters to "holes" in the file
system, but it doesn't do that yet.

> Is there any method to reduce the qcow2 file size when I delete a snapshot image?
> should I "convert" the qcow2 file?

I'm not sure what convert does if you have internal snapshots.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-15 13:25 ` Paolo Bonzini
@ 2012-10-15 14:24   ` Kevin Wolf
  2012-10-16  6:23   ` Kuniyasu Suzaki
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2012-10-15 14:24 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Am 15.10.2012 15:25, schrieb Paolo Bonzini:
> Il 15/10/2012 11:33, Kuniyasu Suzaki ha scritto:
>> Hello,
>>
>> "delvm" is a command to delete a snapshot image in a qcow2 file.
>> However it does not reduce the qcow2 file size.
> 
> Note that the file will not grow when new allocations are performed in
> the future.
> 
> QEMU should also convert the unused clusters to "holes" in the file
> system, but it doesn't do that yet.
> 
>> Is there any method to reduce the qcow2 file size when I delete a snapshot image?
>> should I "convert" the qcow2 file?
> 
> I'm not sure what convert does if you have internal snapshots.

It loses the snapshots.

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-15 13:25 ` Paolo Bonzini
  2012-10-15 14:24   ` Kevin Wolf
@ 2012-10-16  6:23   ` Kuniyasu Suzaki
  2012-10-16  6:54     ` Paolo Bonzini
  1 sibling, 1 reply; 7+ messages in thread
From: Kuniyasu Suzaki @ 2012-10-16  6:23 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel


Hello,

From: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: delvm does not reduce the qcow2 file size
Date: Mon, 15 Oct 2012 15:25:16 +0200

> Il 15/10/2012 11:33, Kuniyasu Suzaki ha scritto:
> > Hello,
> > 
> > "delvm" is a command to delete a snapshot image in a qcow2 file.
> > However it does not reduce the qcow2 file size.
> 
> Note that the file will not grow when new allocations are performed in
> the future.

You mean that the qcow2 file size will not increase when "savevm"
commnad is issued after "delvm".
Namely, the qcow2 file size is almost same when I take a snapshot
after delete previous snapshot image.

> QEMU should also convert the unused clusters to "holes" in the file
> system, but it doesn't do that yet.

I hope a qcow2 file is reduced automatically when a snapshot is deleted.

> > Is there any method to reduce the qcow2 file size when I delete a snapshot image?
> > should I "convert" the qcow2 file?
> 
> I'm not sure what convert does if you have internal snapshots.
> 
> Paolo

------
suzaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-16  6:23   ` Kuniyasu Suzaki
@ 2012-10-16  6:54     ` Paolo Bonzini
  2012-10-16 11:06       ` Kuniyasu Suzaki
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2012-10-16  6:54 UTC (permalink / raw)
  To: Kuniyasu Suzaki; +Cc: qemu-devel

Il 16/10/2012 08:23, Kuniyasu Suzaki ha scritto:
>>> "delvm" is a command to delete a snapshot image in a qcow2 file.
>>> However it does not reduce the qcow2 file size.
>>
>> Note that the file will not grow when new allocations are performed in
>> the future.
> 
> You mean that the qcow2 file size will not increase when "savevm"
> commnad is issued after "delvm".
> Namely, the qcow2 file size is almost same when I take a snapshot
> after delete previous snapshot image.

Exactly.  The first writes to the qcow2 file will also reuse the space
left free by "delvm", if they have to allocate new clusters.

>> QEMU should also convert the unused clusters to "holes" in the file
>> system, but it doesn't do that yet.
> 
> I hope a qcow2 file is reduced automatically when a snapshot is deleted.

Yes, that's part of the plan.  The file would not reduce its size, but
the space would still be given back to the filesystem.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-16  6:54     ` Paolo Bonzini
@ 2012-10-16 11:06       ` Kuniyasu Suzaki
  2012-10-16 11:19         ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Kuniyasu Suzaki @ 2012-10-16 11:06 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel


Hello,

From: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: delvm does not reduce the qcow2 file size
Date: Tue, 16 Oct 2012 08:54:46 +0200

> >> QEMU should also convert the unused clusters to "holes" in the file
> >> system, but it doesn't do that yet.
> > 
> > I hope a qcow2 file is reduced automatically when a snapshot is deleted.
> 
> Yes, that's part of the plan.  The file would not reduce its size, but
> the space would still be given back to the filesystem.

Do you plan to use a space file system?
Is it difficult to reduce a qcow2 file when a snapshot is deleted?

------
suzaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] delvm does not reduce the qcow2 file size
  2012-10-16 11:06       ` Kuniyasu Suzaki
@ 2012-10-16 11:19         ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2012-10-16 11:19 UTC (permalink / raw)
  To: Kuniyasu Suzaki; +Cc: qemu-devel

Il 16/10/2012 13:06, Kuniyasu Suzaki ha scritto:
>>>> QEMU should also convert the unused clusters to "holes" in the file
>>>> > >> system, but it doesn't do that yet.
>>> > > 
>>> > > I hope a qcow2 file is reduced automatically when a snapshot is deleted.
>> > 
>> > Yes, that's part of the plan.  The file would not reduce its size, but
>> > the space would still be given back to the filesystem.
> Do you plan to use a space file system?

Any file system that support holes, including ext2/3/4 or btrfs or XFS,
would actually reclaim the space.

> Is it difficult to reduce a qcow2 file when a snapshot is deleted?

There is no guarantee that no data was allocated after the snapshot.  If
it was, it is not possible to reduce the qcow2 file's size without
implementing some kind of "defragmentation".

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-16 11:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15  9:33 [Qemu-devel] delvm does not reduce the qcow2 file size Kuniyasu Suzaki
2012-10-15 13:25 ` Paolo Bonzini
2012-10-15 14:24   ` Kevin Wolf
2012-10-16  6:23   ` Kuniyasu Suzaki
2012-10-16  6:54     ` Paolo Bonzini
2012-10-16 11:06       ` Kuniyasu Suzaki
2012-10-16 11:19         ` Paolo Bonzini

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).