summaryrefslogtreecommitdiff
path: root/trove/backup
diff options
context:
space:
mode:
authorEd Cranford <ed.cranford@rackspace.com>2013-08-22 10:01:42 -0500
committerEd Cranford <ed.cranford@rackspace.com>2013-11-26 11:52:00 -0600
commit384576675f8205aa3985c1f576ce767e43b9944d (patch)
treecb40e84d1130fd3f35e7649e4977447c501b720a /trove/backup
parent5755ede7a23096700fb7c17e69348106e8dd77a6 (diff)
downloadtrove-384576675f8205aa3985c1f576ce767e43b9944d.tar.gz
Conductor proxies host db access for guests
Previously, instances updated their status by updating the database on the host directly. Necessarily, each instance would need access to the database to stay updated. Trove's new conductor service eliminates that need by working as a proxy for those instances. By sending a heartbeat to conductor via RPC, conductor updates the database on the host on behalf of the instance. As backups also made use of the host database, the backup code has been refactored to take richer inputs to remove the need to query the host database, and now conductor is also used to submit updates to backup states. Implements: blueprint trove-conductor Change-Id: I4cb34baedd0e3a50051f9e66de95c9028c66e4b5
Diffstat (limited to 'trove/backup')
-rw-r--r--trove/backup/models.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/trove/backup/models.py b/trove/backup/models.py
index 9112121c..74040fca 100644
--- a/trove/backup/models.py
+++ b/trove/backup/models.py
@@ -58,7 +58,7 @@ class Backup(object):
# parse the ID from the Ref
instance_id = utils.get_id_from_href(instance)
- # verify that the instance exist and can perform actions
+ # verify that the instance exists and can perform actions
from trove.instance.models import Instance
instance_model = Instance.load(context, instance_id)
instance_model.validate_can_perform_action()
@@ -76,7 +76,14 @@ class Backup(object):
LOG.exception("Unable to create Backup record:")
raise exception.BackupCreationError(str(ex))
- api.API(context).create_backup(db_info.id, instance_id)
+ backup_info = {'id': db_info.id,
+ 'name': name,
+ 'description': description,
+ 'instance_id': instance_id,
+ 'backup_type': db_info.backup_type,
+ 'checksum': db_info.checksum,
+ }
+ api.API(context).create_backup(backup_info, instance_id)
return db_info
return run_with_quotas(context.tenant,