Fix Cinder Backups
Change-Id: I48d8a8f91f8373f7e3b127ec0c4c686094642ccb dpeneds-on: Iea7f5fb0d0fb42d95e6c24d6d63693e272af3992 Closes-Bug: #1615461
This commit is contained in:
parent
7658243238
commit
83eff55604
|
@ -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
|
|
@ -17,13 +17,7 @@ from freezer.mode import mode
|
||||||
|
|
||||||
class NovaMode(mode.Mode):
|
class NovaMode(mode.Mode):
|
||||||
"""
|
"""
|
||||||
Execute a MySQL DB backup. currently only backup with lvm snapshots
|
Execute a nova backup/restore
|
||||||
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.
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, conf):
|
def __init__(self, conf):
|
||||||
self.conf = conf
|
self.conf = conf
|
||||||
|
|
|
@ -93,7 +93,8 @@ class BackupOs(object):
|
||||||
LOG.debug("Creation temporary volume")
|
LOG.debug("Creation temporary volume")
|
||||||
copied_volume = client_manager.do_copy_volume(snapshot)
|
copied_volume = client_manager.do_copy_volume(snapshot)
|
||||||
LOG.debug("Creation temporary glance image")
|
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))
|
LOG.debug("Download temporary glance image {0}".format(image.id))
|
||||||
stream = client_manager.download_image(image)
|
stream = client_manager.download_image(image)
|
||||||
package = "{0}/{1}".format(volume_id, utils.DateTime.now().timestamp)
|
package = "{0}/{1}".format(volume_id, utils.DateTime.now().timestamp)
|
||||||
|
|
Loading…
Reference in New Issue