|
2 | 2 |
|
3 | 3 | from cinder import context
|
4 | 4 | from cinder import exception
|
| 5 | +from cinder import interface |
5 | 6 | from cinder.objects import volume_type as vol_type_obj
|
6 | 7 | from cinder.volume import driver as volume_driver
|
7 | 8 | from cinder.volume.drivers.netapp import options
|
|
31 | 32 | ]
|
32 | 33 |
|
33 | 34 |
|
34 |
| -class NetappCinderDynamicDriver(NetAppNVMeStorageLibrary): |
35 |
| - """NetApp NVMe driver with dynamic SVM selection from volume types. |
| 35 | +class NetappDynamicLibrary(NetAppNVMeStorageLibrary): |
| 36 | + """NetApp NVMe storage library with dynamic SVM selection from volume types. |
36 | 37 |
|
37 | 38 | Key difference from standard NetApp drivers:
|
38 | 39 | - Standard: One SVM per backend, all config in cinder.conf
|
@@ -964,6 +965,87 @@ def create_volume(self, volume):
|
964 | 965 | ) from e
|
965 | 966 |
|
966 | 967 |
|
| 968 | +@interface.volumedriver |
| 969 | +class NetappCinderDynamicDriver(volume_driver.BaseVD): |
| 970 | + """NetApp NVMe driver with dynamic multi-SVM support. |
| 971 | +
|
| 972 | + This driver follows the standard Cinder pattern by inheriting from BaseVD |
| 973 | + and delegating storage operations to the NetappDynamicLibrary. |
| 974 | + """ |
| 975 | + |
| 976 | + VERSION = "1.0.0" |
| 977 | + DRIVER_NAME = "NetApp_Dynamic_NVMe" |
| 978 | + |
| 979 | + def __init__(self, *args, **kwargs): |
| 980 | + """Initialize the driver and create library instance.""" |
| 981 | + super().__init__(*args, **kwargs) |
| 982 | + self.library = NetappDynamicLibrary(self.DRIVER_NAME, "NVMe", **kwargs) |
| 983 | + |
| 984 | + def do_setup(self, context): |
| 985 | + """Setup the driver.""" |
| 986 | + self.library.do_setup(context) |
| 987 | + |
| 988 | + def check_for_setup_error(self): |
| 989 | + """Check for setup errors.""" |
| 990 | + self.library.check_for_setup_error() |
| 991 | + |
| 992 | + def create_volume(self, volume): |
| 993 | + """Create a volume.""" |
| 994 | + return self.library.create_volume(volume) |
| 995 | + |
| 996 | + def delete_volume(self, volume): |
| 997 | + """Delete a volume.""" |
| 998 | + return self.library.delete_volume(volume) |
| 999 | + |
| 1000 | + def create_snapshot(self, snapshot): |
| 1001 | + """Create a snapshot.""" |
| 1002 | + return self.library.create_snapshot(snapshot) |
| 1003 | + |
| 1004 | + def delete_snapshot(self, snapshot): |
| 1005 | + """Delete a snapshot.""" |
| 1006 | + return self.library.delete_snapshot(snapshot) |
| 1007 | + |
| 1008 | + def create_volume_from_snapshot(self, volume, snapshot): |
| 1009 | + """Create a volume from a snapshot.""" |
| 1010 | + return self.library.create_volume_from_snapshot(volume, snapshot) |
| 1011 | + |
| 1012 | + def create_cloned_volume(self, volume, src_vref): |
| 1013 | + """Create a cloned volume.""" |
| 1014 | + return self.library.create_cloned_volume(volume, src_vref) |
| 1015 | + |
| 1016 | + def extend_volume(self, volume, new_size): |
| 1017 | + """Extend a volume.""" |
| 1018 | + return self.library.extend_volume(volume, new_size) |
| 1019 | + |
| 1020 | + def initialize_connection(self, volume, connector): |
| 1021 | + """Initialize connection to volume.""" |
| 1022 | + return self.library.initialize_connection(volume, connector) |
| 1023 | + |
| 1024 | + def terminate_connection(self, volume, connector, **kwargs): |
| 1025 | + """Terminate connection to volume.""" |
| 1026 | + return self.library.terminate_connection(volume, connector, **kwargs) |
| 1027 | + |
| 1028 | + def get_volume_stats(self, refresh=False): |
| 1029 | + """Get volume stats.""" |
| 1030 | + return self.library.get_volume_stats(refresh) |
| 1031 | + |
| 1032 | + def update_provider_info(self, volumes, snapshots): |
| 1033 | + """Update provider info.""" |
| 1034 | + return self.library.update_provider_info(volumes, snapshots) |
| 1035 | + |
| 1036 | + def create_export(self, context, volume, connector): |
| 1037 | + """Create export for volume.""" |
| 1038 | + return self.library.create_export(context, volume, connector) |
| 1039 | + |
| 1040 | + def ensure_export(self, context, volume): |
| 1041 | + """Ensure export for volume.""" |
| 1042 | + return self.library.ensure_export(context, volume) |
| 1043 | + |
| 1044 | + def remove_export(self, context, volume): |
| 1045 | + """Remove export for volume.""" |
| 1046 | + return self.library.remove_export(context, volume) |
| 1047 | + |
| 1048 | + |
967 | 1049 | # NOTES
|
968 | 1050 | # Namespace: Manually created because we skip standard do_setup()
|
969 | 1051 | # Pool: Custom svm#flexvol format to support multi-SVM
|
|
0 commit comments