[openstack-dev] [Nova][BluePrint Register]Shrink the volume when file in the instance was deleted.

Qixiaozhen qixiaozhen at huawei.com
Tue Jan 7 12:39:35 UTC 2014

> On 25 December 2013 05:14, Qixiaozhen <qixiaozhen at huawei.com> wrote:
> > Hi,all
> >
> > A blueprint is registered that is about shrinking the volume in thin
> > provision.
> Have you got the link?

The address is https://blueprints.launchpad.net/nova/+spec/shrink-volume-in-thin-provisoning 

> > Thin provision means allocating the disk space once the instance
> > writes the data on the area of volume in the first time.
> >
> > However, if the files in the instance were deleted, thin provision
> > could not deal with this situation. The space that was allocated by
> > the files could not be released.
> >
> > So it is necessary to shrink the volume when the files are deleted in
> > the instance.
> In this case the user will probably need to zero out the free space of your
> filesystem too, in some cases, unless nova does that for them, which sounds a
> bit dodgy.

It seems that it is better that filling the free space with zero in the filesystem of the instance in offline mode. 

> > The operation of shrinking can be manually executed by the user with
> > the web portal or CLI command or periodically in the background.
> I wondered about an "optimise disk" call.

Agree with this. This shrinking operation can be a option.

> A few thoughts:
> * I am not sure it can always be done "online" for all drivers, may need an
> offline mode

Online Shrinking: The online shrink-volume would need the additional driver. If the guest os of instance is a linux, a additional driver named 'qemu-guest-agent ' can be installed inside the guest, and the command 'fstrim' is called.

More information :  http://dustymabe.com/2013/06/11/recover-space-from-vm-disk-images-by-using-discardfstrim/

> * Similar operations have ways of confirming and reverting to protect against
> dataloss
> * Ideally keep all operations on the virtual disk, and no operations on its
> content
> * With chains of disks, you may want to simplify the chain too (where it makes
> sense)
> John
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

More information about the OpenStack-dev mailing list