Add ability to restore nova instance

Change-Id: Ibaf6bb4b04f6b0fa08259ecfe4e86a9defe3ffe5
This commit is contained in:
Gleb Stepanov 2016-12-05 16:31:23 +02:00 committed by Pierre Mathieu
parent 7b67f01904
commit 6ca081178c
1 changed files with 6 additions and 7 deletions

View File

@ -259,7 +259,7 @@ class RestoreJob(Job):
def execute(self):
conf = self.conf
LOG.info('Executing FS restore...')
LOG.info('Executing Restore...')
restore_timestamp = None
restore_abs_path = conf.restore_abs_path
@ -291,13 +291,12 @@ class RestoreJob(Job):
return {}
res = restore.RestoreOs(conf.client_manager, conf.container)
if conf.backup_media == 'nova':
LOG.info("Restoring nova backup. Instance ID: {0}, timestamp: {1}"
.format(conf.nova_inst_id, restore_timestamp))
nova_network = None
if conf.nova_restore_network:
nova_network = conf.nova_restore_network
LOG.info("Restoring nova backup. Instance ID: {0}, timestamp: {1} "
"network-id {2}".format(conf.nova_inst_id,
restore_timestamp,
conf.nova_network_id))
res.restore_nova(conf.nova_inst_id, restore_timestamp,
nova_network)
conf.nova_network_id)
elif conf.backup_media == 'cinder':
LOG.info("Restoring cinder backup from glance. Volume ID: {0}, "
"timestamp: {1}".format(conf.cinder_vol_id,