Use backup_use_temp_snapshot setting for default

Commit I0173d397760bc17c01af792b4c4cc2bcbf45fedd introduced a config
option intended for the specific driver, but added to driver.py and
worded such that would appear to be a generic setting. Rather than
going through a deprecation cycle for this and introducing a new
vendor specific option, make this setting be used as the default for
all drivers.

The default for drivers was False, and the default value for this
config option is False, so nothing changes without operator action.
Those drivers that want to force this behavior are already overriding
the call to get this base driver option, so they will not change
either. And now that the NFS driver (mostly) supports snapshots, we
should be able to start expecting that as a basic volume driver
functionality.

Change-Id: I5b193512137d845f5b1ac46c758d748a19a90739
Partial-bug: #1686403
This commit is contained in:
Sean McGinnis 2017-08-25 15:35:28 -05:00 committed by Sean McGinnis
parent a1cc94046d
commit 92fb7bb088
2 changed files with 12 additions and 8 deletions

View File

@ -258,9 +258,10 @@ volume_opts = [
'storage back-end.'),
cfg.BoolOpt('backup_use_temp_snapshot',
default=False,
help='If this is set to True, the backup_use_temp_snapshot '
'path will be used during the backup. Otherwise, it '
'will use backup_use_temp_volume path.'),
help='If this is set to True, a temporary snapshot will '
'be created for performing non-disruptive backups. '
'Otherwise a temporary volume will be cloned '
'in order to perform a backup.'),
cfg.BoolOpt('enable_unsupported_driver',
default=False,
help="Set this to True when you want to allow an unsupported "
@ -1093,7 +1094,14 @@ class BaseVD(object):
return None, False
def backup_use_temp_snapshot(self):
return False
"""Get the configured setting for backup from snapshot.
If an inheriting driver does not support this operation,
the driver should override this method to return false
and log a warning letting the administrator know they
have configured something that cannot be done.
"""
return self.configuration.safe_get("backup_use_temp_snapshot")
def snapshot_remote_attachable(self):
# TODO(lixiaoy1): the method will be deleted later when remote

View File

@ -1251,10 +1251,6 @@ class HuaweiBaseDriver(driver.VolumeDriver):
"""Remove an export for a snapshot."""
pass
def backup_use_temp_snapshot(self):
# This config option has a default to be False, So just return it.
return self.configuration.safe_get("backup_use_temp_snapshot")
def _copy_volume(self, volume, copy_name, src_lun, tgt_lun):
metadata = huawei_utils.get_volume_metadata(volume)
copyspeed = metadata.get('copyspeed')