From: Marc Koderer Date: Mon, 20 Jul 2015 11:26:49 +0000 (+0200) Subject: Move CloneableVD to common functions X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bf89833ebf4e05a351bede616e2baba1e6f2600a;p=openstack-build%2Fcinder-build.git Move CloneableVD to common functions Since every driver implements the functions needed by CloneableVD we can move it to BaseVD. Change-Id: I3ce24f9950bfa54c8dc19835f0e19f4c3c5181c8 --- diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 2eba2cca3..d4b510e7d 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -1328,6 +1328,16 @@ class BaseVD(object): def retype(self, context, volume, new_type, diff, host): return False, None + def create_cloned_volume(self, volume, src_vref): + """Creates a clone of the specified volume. + + If volume_type extra specs includes 'replication: True' the + driver needs to create a volume replica (secondary) + and setup replication between the newly created volume + and the secondary volume. + """ + raise NotImplementedError() + # ####### Interface methods for DataPath (Connector) ######## @abc.abstractmethod def ensure_export(self, context, volume): @@ -1506,21 +1516,6 @@ class ConsistencyGroupVD(object): return -@six.add_metaclass(abc.ABCMeta) -class CloneableVD(object): - @abc.abstractmethod - def create_cloned_volume(self, volume, src_vref): - """Creates a clone of the specified volume. - - If volume_type extra specs includes 'replication: True' the - driver needs to create a volume replica (secondary) - and setup replication between the newly created volume - and the secondary volume. - """ - - return - - @six.add_metaclass(abc.ABCMeta) class CloneableImageVD(object): @abc.abstractmethod @@ -1966,7 +1961,7 @@ class ReplicaVD(object): class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, - CloneableVD, CloneableImageVD, ManageableSnapshotsVD, + CloneableImageVD, ManageableSnapshotsVD, SnapshotVD, ReplicaVD, LocalVD, MigrateVD, BaseVD): """This class will be deprecated soon. @@ -1981,9 +1976,6 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, def create_volume_from_snapshot(self, volume, snapshot): raise NotImplementedError() - def create_cloned_volume(self, volume, src_vref): - raise NotImplementedError() - def create_replica_test_volume(self, volume, src_vref): raise NotImplementedError() diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index 0085496c6..6a54e657b 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -41,7 +41,7 @@ CONF = cfg.CONF CONF.register_opts(volume_opts) -class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD, +class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableImageVD, driver.TransferVD): VERSION = '2.1.0' diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index c937ff5d2..46299d347 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -51,8 +51,7 @@ CONF.register_opts(common_opts) class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, - driver.ExtendVD, driver.CloneableVD, driver.SnapshotVD, - driver.BaseVD): + driver.ExtendVD, driver.SnapshotVD, driver.BaseVD): def __init__(self, *args, **kwargs): super(DellCommonDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index dca3be615..917028ddd 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -48,7 +48,7 @@ CONF = cfg.CONF CONF.register_opts(volume_opts) -class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD, +class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.ExtendVD): """Gluster based cinder driver. diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index 2c0884707..0b30f28a0 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/cinder/volume/drivers/ibm/gpfs.py @@ -108,7 +108,7 @@ def _sizestr(size_in_g): class GPFSDriver(driver.ConsistencyGroupVD, driver.ExtendVD, - driver.LocalVD, driver.TransferVD, driver.CloneableVD, + driver.LocalVD, driver.TransferVD, driver.CloneableImageVD, driver.SnapshotVD, driver.MigrateVD, driver.BaseVD): diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index e33c62aef..14fc48952 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -139,8 +139,7 @@ class StorwizeSVCDriver(san.SanDriver, driver.ExtendVD, driver.SnapshotVD, driver.MigrateVD, driver.ReplicaVD, driver.ConsistencyGroupVD, - driver.CloneableVD, driver.CloneableImageVD, - driver.TransferVD): + driver.CloneableImageVD, driver.TransferVD): """IBM Storwize V7000 and SVC iSCSI/FC volume driver. Version history: diff --git a/cinder/volume/drivers/ibm/xiv_ds8k.py b/cinder/volume/drivers/ibm/xiv_ds8k.py index 93caceaa4..31de55869 100644 --- a/cinder/volume/drivers/ibm/xiv_ds8k.py +++ b/cinder/volume/drivers/ibm/xiv_ds8k.py @@ -65,7 +65,6 @@ class XIVDS8KDriver(san.SanDriver, driver.MigrateVD, driver.ReplicaVD, driver.ConsistencyGroupVD, - driver.CloneableVD, driver.CloneableImageVD, driver.TransferVD): """Unified IBM XIV and DS8K volume driver.""" diff --git a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py index 1d87dadf7..2646eef4a 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py @@ -28,7 +28,6 @@ LOG = logging.getLogger(__name__) class NetApp7modeFibreChannelDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp 7-mode FibreChannel volume driver.""" diff --git a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py index fda10b8c1..7c6e83ab7 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py @@ -28,7 +28,6 @@ LOG = logging.getLogger(__name__) class NetAppCmodeFibreChannelDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp C-mode FibreChannel volume driver.""" diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py index 103e293b1..bf47ea1a1 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py @@ -27,7 +27,6 @@ LOG = logging.getLogger(__name__) class NetApp7modeISCSIDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp 7-mode iSCSI volume driver.""" diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py index f502ae651..53036b952 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py @@ -27,7 +27,6 @@ LOG = logging.getLogger(__name__) class NetAppCmodeISCSIDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp C-mode iSCSI volume driver.""" diff --git a/cinder/volume/drivers/netapp/dataontap/nfs_base.py b/cinder/volume/drivers/netapp/dataontap/nfs_base.py index 976fece7c..4f758dbfc 100644 --- a/cinder/volume/drivers/netapp/dataontap/nfs_base.py +++ b/cinder/volume/drivers/netapp/dataontap/nfs_base.py @@ -52,7 +52,6 @@ CONF = cfg.CONF @six.add_metaclass(utils.TraceWrapperWithABCMetaclass) class NetAppNfsDriver(driver.ManageableVD, - driver.CloneableVD, driver.CloneableImageVD, driver.SnapshotVD, nfs.NfsDriver): diff --git a/cinder/volume/drivers/netapp/eseries/fc_driver.py b/cinder/volume/drivers/netapp/eseries/fc_driver.py index 3930afc19..70b89e995 100644 --- a/cinder/volume/drivers/netapp/eseries/fc_driver.py +++ b/cinder/volume/drivers/netapp/eseries/fc_driver.py @@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__) class NetAppEseriesFibreChannelDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp E-Series FibreChannel volume driver.""" diff --git a/cinder/volume/drivers/netapp/eseries/iscsi_driver.py b/cinder/volume/drivers/netapp/eseries/iscsi_driver.py index df96bb1e2..94beff0fa 100644 --- a/cinder/volume/drivers/netapp/eseries/iscsi_driver.py +++ b/cinder/volume/drivers/netapp/eseries/iscsi_driver.py @@ -31,7 +31,6 @@ LOG = logging.getLogger(__name__) class NetAppEseriesISCSIDriver(driver.BaseVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.TransferVD, driver.SnapshotVD): """NetApp E-Series iSCSI volume driver.""" diff --git a/cinder/volume/drivers/prophetstor/dplcommon.py b/cinder/volume/drivers/prophetstor/dplcommon.py index 0ce4bf028..18109769e 100644 --- a/cinder/volume/drivers/prophetstor/dplcommon.py +++ b/cinder/volume/drivers/prophetstor/dplcommon.py @@ -697,7 +697,7 @@ class DPLVolume(object): class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD, - driver.CloneableVD, driver.CloneableImageVD, + driver.CloneableImageVD, driver.SnapshotVD, driver.LocalVD, driver.BaseVD): """Class of dpl storage adapter.""" VERSION = '2.0.4' diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index b3be6e1cb..637e8eec4 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -265,7 +265,7 @@ class RADOSClient(object): class RBDDriver(driver.TransferVD, driver.ExtendVD, - driver.CloneableVD, driver.CloneableImageVD, driver.SnapshotVD, + driver.CloneableImageVD, driver.SnapshotVD, driver.MigrateVD, driver.BaseVD): """Implements RADOS block device (RBD) volume commands.""" diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index e4278ba58..40d55c61c 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -49,7 +49,6 @@ LOG = logging.getLogger(__name__) class HP3PARFCDriver(driver.TransferVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.SnapshotVD, driver.MigrateVD, driver.ConsistencyGroupVD, diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index cc5a4a4fe..f4fc7ecfc 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -54,7 +54,6 @@ CHAP_PASS_KEY = "HPQ-cinder-CHAP-secret" class HP3PARISCSIDriver(driver.TransferVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.SnapshotVD, driver.MigrateVD, driver.ConsistencyGroupVD, diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py index 21bcc3aa5..09c929755 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py @@ -48,7 +48,6 @@ MIN_CLIENT_VERSION = '1.0.4' class HPLeftHandISCSIDriver(driver.TransferVD, driver.ManageableVD, driver.ExtendVD, - driver.CloneableVD, driver.SnapshotVD, driver.MigrateVD, driver.BaseVD, diff --git a/cinder/volume/drivers/tintri.py b/cinder/volume/drivers/tintri.py index 2254c2c87..c5c250a75 100644 --- a/cinder/volume/drivers/tintri.py +++ b/cinder/volume/drivers/tintri.py @@ -62,7 +62,6 @@ CONF.register_opts(tintri_opts) class TintriDriver(driver.ManageableVD, - driver.CloneableVD, driver.CloneableImageVD, driver.SnapshotVD, nfs.NfsDriver):