Use volume_id and timestamp to generate container name

Currently, the container is fixed string, so that the backup will
coverage the older one everytime.
Use volume_id and timestamp to generate container name, so each
time will provide a different container to storage the backup.

Change-Id: I58b3e151e6fcd8a37bf45cd545c79208ac968c3b
Closes-Bug: #1563207
This commit is contained in:
Einst Crazy 2016-03-29 07:55:27 +00:00
parent 97a981c2c8
commit 285e292aa2
1 changed files with 5 additions and 1 deletions

View File

@ -123,5 +123,9 @@ class BackupOs:
incremental = True
else:
incremental = False
cinder.backups.create(volume_id, self.container, name, description,
container = "{0}/{1}/{2}".format(self.container, volume_id,
utils.DateTime.now().timestamp)
cinder.backups.create(volume_id, container, name, description,
incremental=incremental, force=True)