]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
During a restore send the restore request to the right host
authorDuncan Thomas <duncan.thomas@hp.com>
Wed, 3 Sep 2014 18:07:14 +0000 (19:07 +0100)
committerDuncan Thomas <duncan.thomas@hp.com>
Wed, 3 Sep 2014 18:07:14 +0000 (19:07 +0100)
For restore from LVM volumes to work, the restore must be done
on the host that serves the volume, since local_path is used
in the restore code.

Change-Id: Iad1fb5588b8365a0a165754389340bca3f1830b5
Closes-Bug: #1365065

cinder/backup/api.py

index 8bc290122e62bbb69f46ed7fc90b3b80ff647cd6..f262ce28603a09bb97c1e3da1bed378b0ff3040e 100644 (file)
@@ -246,8 +246,10 @@ class API(base.Base):
         self.db.backup_update(context, backup_id, {'status': 'restoring'})
         self.db.volume_update(context, volume_id, {'status':
                                                    'restoring-backup'})
+
+        volume_host = volume_utils.extract_host(volume['host'], 'host')
         self.backup_rpcapi.restore_backup(context,
-                                          backup['host'],
+                                          volume_host,
                                           backup['id'],
                                           volume_id)