[Users] vzctl compact works only, if there are no snapshots
reduzent at gmail.com
Mon Jun 13 03:05:20 PDT 2016
On Fri, 2016-06-10 at 09:44 +0000, Dmitry Mishin wrote:
> On 09/06/16 18:27, "users-bounces at openvz.org on behalf of Roman
> <users-bounces at openvz.org on behalf of reduzent at gmail.com> wrote:
> > On Fri, 2016-06-03 at 15:10 +0000, Dmitry Mishin wrote:
> > >
> > > Hi,
> > >
> > > On 03/06/16 11:52, "users-bounces at openvz.org on behalf of Roman
> > > Haefeli"
> > > <users-bounces at openvz.org on behalf of reduzent at gmail.com> wrote:
> > >
> > > >
> > > >
> > > > Dear All,
> > > >
> > > > We're considering creating regular snapshots of our containers.
> > > > The
> > > > setup would include deleting the oldest snapshots. While
> > > > playing
> > > > around
> > > > with creating and deleting snapshots, I noticed that the
> > > > root.hdd
> > > > file
> > > > keeps growing. It seems there is no point at all in deleting
> > > > old
> > > > snapshots for the only purpose of saving disk space. Then I
> > > > tried
> > > > to
> > > > reclaim some space back with 'vzctl compact <name>', but it
> > > > wasn't
> > > > able
> > > > to reclaim anything. Only when I deleted all snapshots, 'vzctl
> > > > compact
> > > > <name>' seems to be effective.
> > > >
> > > > Now, my question is, will there be support in the future to
> > > > reclaim
> > > > space, even if there are snapshots?
> > > It's a bit tricky, and that'a why there were no such plans so
> > > far.
> > > Could you please explain why are you considering regular
> > > snapshots?
> > > What
> > > is a use case?
> > Our ploop containers have their image on an NFS store. We once had
> > an
> > outage of the NFS server and thus a lot of images with broken
> > filesystems. We do have backups, but sometimes it would be easier
> > to
> > simply switch to a recent snapshot.
> > Why is it considered special to have a snapshots of the - let's say
> > -
> > past 7 days?
> Mb because of habit to use simfs?
> Please forgive me, if the question sounded offensive, it was not
> to be such in any way - the only reason why I ask such questions is
> we as developers lack the knowledge of whole range of community use
> And these questions allow us to clarify is the particular use case a
> pattern and why.
Thanks, I didn't take it as offensive.
> Thank you for the answer, I've got the idea.
> Back to the topic.
> Snapshot by its definition is an ability to make a read-only dump of
> Container's (and thus all its hdds) at some time point. The keyword
> is "read-only". Every feature or tool which use this functionality -
> on this assumption. So, any functionality which would change a 'read-
> delta - breaks this assumption and thus leads to issues with other
> functionality. And that's why nobody performs compacting of
> The proper analogy here is 'backup' - nobody expects that compact of
> virtual disk will lead to drop of 'unused' data from backups as well.
> Possible solution here - is to do not snapshot/backup unused data.
> It doesn't worth to modify a snapshot action for this - because:
> 1) it makes it to be a non-atomic action (only guest OS knows what
> data is
> unused) and
> 2) it can be easily emulated be a sequence of 2 commands:
> a) ploop balloon discard
> b) vzctl snapshot
> I.e. do discard just before snapshot.
> So, I'd recommend:
> 1) at some point, do a Container's backup, merge all snapshots and
> 2) after that, do compact just before any snapshot.
> It will not solve the issue completely (because of defragmentation
> but IMHO, it is the best what can be achieved now.
Thanks for the explanations. I think I understood the part with
compacting before snapshotting. However, is it correct that if a create
a 10GB and then take a snapshot, delete the file and take another
snapshot and continue rotating snapshots (creating new ones while
merging the oldest ones) the 10GB would end up in root.hdd even if no
snapshot is "actively" referencing this data anymore? So even if I
compact before I snapshot, there will be wasted space. Is this correct?
> And back to the off-topic again:
> What are NFS benefits, which outweigh their instability?
Good question. We never had troubles with NFS before, but the hardware
is aging. When we set up the Hostnodes, we wanted to have the
possibility to quickly migrate between Hostnodes, so we decided to put
containers on NFS export shared between hostnodes.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: This is a digitally signed message part
More information about the Users