Fix Cinder Backups

Change-Id: I48d8a8f91f8373f7e3b127ec0c4c686094642ccb
dpeneds-on: Iea7f5fb0d0fb42d95e6c24d6d63693e272af3992
Closes-Bug: #1615461
This commit is contained in:
Saad Zaher 2016-09-15 20:09:30 +00:00
parent 7658243238
commit 83eff55604
3 changed files with 40 additions and 8 deletions

37
freezer/mode/cinder.py Normal file
View File

@ -0,0 +1,37 @@
# (c) Copyright 2016 Hewlett-Packard Enterprise Development , L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from freezer.mode import mode
class CinderMode(mode.Mode):
"""
Execute a cinder backup
"""
def __init__(self, conf):
self.conf = conf
@property
def name(self):
return "cinder"
@property
def version(self):
return "1.0"
def release(self):
pass
def prepare(self):
pass

View File

@ -17,13 +17,7 @@ from freezer.mode import mode
class NovaMode(mode.Mode):
"""
Execute a MySQL DB backup. currently only backup with lvm snapshots
are supported. This mean, just before the lvm snap vol is created,
the db tables will be flushed and locked for read, then the lvm create
command will be executed and after that, the table will be unlocked and
the backup will be executed. It is important to have the available in
backup_args.mysql_conf the file where the database host, name, user,
password and port are set.
Execute a nova backup/restore
"""
def __init__(self, conf):
self.conf = conf

View File

@ -93,7 +93,8 @@ class BackupOs(object):
LOG.debug("Creation temporary volume")
copied_volume = client_manager.do_copy_volume(snapshot)
LOG.debug("Creation temporary glance image")
image = client_manager.make_glance_image("name", copied_volume)
image = client_manager.make_glance_image(copied_volume.id,
copied_volume)
LOG.debug("Download temporary glance image {0}".format(image.id))
stream = client_manager.download_image(image)
package = "{0}/{1}".format(volume_id, utils.DateTime.now().timestamp)