Generate a full backup first time
If there isn't any backup of the specified volume, generate a full backup, but not an incremental one. Closes-Bug: #1563245 Change-Id: If30e0292671e2be8d026006986b942206cfd2435
This commit is contained in:
parent
08f3da31e9
commit
c62a9da7ef
|
@ -114,5 +114,14 @@ class BackupOs:
|
|||
def backup_cinder(self, volume_id, name=None, description=None):
|
||||
client_manager = self.client_manager
|
||||
cinder = client_manager.get_cinder()
|
||||
search_opts = {
|
||||
'volume_id': volume_id,
|
||||
'status': 'available',
|
||||
}
|
||||
backups = cinder.backups.list(search_opts=search_opts)
|
||||
if len(backups) > 0 :
|
||||
incremental = True
|
||||
else:
|
||||
incremental = False
|
||||
cinder.backups.create(volume_id, self.container, name, description,
|
||||
incremental=True, force=True)
|
||||
incremental=incremental, force=True)
|
||||
|
|
Loading…
Reference in New Issue