<div dir="ltr">Hi all,<div><br></div><div>I tested the 'backup' API recently and got two questions about it:</div><div><br></div><div>1. Why 'daily' & 'weekly' appear in code comments & novaclient about 'backup_type' parameter?</div>
<div><br></div><div>The 'backup_type' parameter is only a tag for this backup(image).<br></div><div>And there isn't corresponding validation for 'backup_type' about these two types.</div><div><br></div>
<div>Moreover, there is also no periodic_task for 'backup' in compute host.</div><div>(It's fair to leave the choice to other third-parts system)</div><div><br></div><div>So, why we leave 'daily | weekly' example in code comments and novaclient?</div>
<div>IMO it may lead confusion that Nova will do more actions for 'daily|weekly' backup request.</div><div><br></div><div>2. Is it necessary to backup instance when 'rotation' is equal to 0?</div><div><br>
</div><div>Let's look at related codes in nova/compute/manager.py:</div><div>#     def backup_instance(self, context, image_id, instance, backup_type, rotation):<br></div><div>#</div><div>#        self._do_snapshot_instance(context, image_id, instance, rotation)</div>
<div>#        self._rotate_backups(context, instance, backup_type, rotation)</div><div><br></div><div>I knew Nova will delete all backup images according the 'backup_type' parameter when 'rotation' equals to 0.</div>
<div><br></div><div>But according the logic above, Nova will generate one new backup in _do_snapshot_instance(), and delete it in _rotate_backups()..</div><div><br></div><div>It's weird to snapshot a useless backup firstly IMO. </div>
<div>We need to add one new branch here: if 'rotation' is equal to 0, no need to backup, just rotate it.</div><div><br></div><div><br></div><div>So, what's your opinions? Look forward to your suggestion.</div>
<div>Thanks.</div><div><br></div><div>WingWJ</div><div><br></div></div>