[openstack-dev] [nova] Two questions about 'backup' API

Vishvananda Ishaya vishvananda at gmail.com
Thu Jun 26 21:20:36 UTC 2014

On Jun 26, 2014, at 5:07 AM, wu jiang <wingwj at gmail.com> wrote:

> Hi all,
> I tested the 'backup' API recently and got two questions about it:
> 1. Why 'daily' & 'weekly' appear in code comments & novaclient about 'backup_type' parameter?
> The 'backup_type' parameter is only a tag for this backup(image).
> And there isn't corresponding validation for 'backup_type' about these two types.
> Moreover, there is also no periodic_task for 'backup' in compute host.
> (It's fair to leave the choice to other third-parts system)
> So, why we leave 'daily | weekly' example in code comments and novaclient?
> IMO it may lead confusion that Nova will do more actions for 'daily|weekly' backup request.

The tag affects the cleanup of old copies, so if you do a tag of ‘weekly’ and
the rotation is 3, it will insure you only have 3 copies that are tagged weekly.
You could also have 3 copies of the daily tag as well.

> 2. Is it necessary to backup instance when 'rotation' is equal to 0?
> Let's look at related codes in nova/compute/manager.py:
> #     def backup_instance(self, context, image_id, instance, backup_type, rotation):
> #
> #        self._do_snapshot_instance(context, image_id, instance, rotation)
> #        self._rotate_backups(context, instance, backup_type, rotation)
> I knew Nova will delete all backup images according the 'backup_type' parameter when 'rotation' equals to 0.
> But according the logic above, Nova will generate one new backup in _do_snapshot_instance(), and delete it in _rotate_backups()..
> It's weird to snapshot a useless backup firstly IMO. 
> We need to add one new branch here: if 'rotation' is equal to 0, no need to backup, just rotate it.

That makes sense I suppose.


> So, what's your opinions? Look forward to your suggestion.
> Thanks.
> WingWJ
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140626/74d9900a/attachment.pgp>

More information about the OpenStack-dev mailing list