Coverage for manila/share/drivers/netapp/dataontap/cluster_mode/drv_single_svm.py: 51%
154 statements
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
1# Copyright (c) 2015 Clinton Knight. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14"""
15NetApp Data ONTAP cDOT single-SVM storage driver.
17This driver requires a Data ONTAP (Cluster-mode) storage system with
18installed CIFS and/or NFS licenses, as well as a FlexClone license. This
19driver does not manage share servers, meaning it uses a single Data ONTAP
20storage virtual machine (i.e. 'vserver') as defined in manila.conf to
21provision shares. This driver supports NFS & CIFS protocols.
22"""
24from manila.share import driver
25from manila.share.drivers.netapp.dataontap.cluster_mode import lib_single_svm
28class NetAppCmodeSingleSvmShareDriver(driver.ShareDriver):
29 """NetApp Cluster-mode single-SVM share driver."""
31 DRIVER_NAME = 'NetApp_Cluster_SingleSVM'
33 def __init__(self, *args, **kwargs):
34 super(NetAppCmodeSingleSvmShareDriver, self).__init__(
35 False, *args, **kwargs)
36 self.library = lib_single_svm.NetAppCmodeSingleSVMFileStorageLibrary(
37 self.DRIVER_NAME, **kwargs)
38 self.dhss_mandatory_security_service_association = {}
40 def do_setup(self, context):
41 self.library.do_setup(context)
43 def check_for_setup_error(self):
44 self.library.check_for_setup_error()
46 def get_pool(self, share):
47 return self.library.get_pool(share)
49 def create_share(self, context, share, **kwargs):
50 return self.library.create_share(context, share, **kwargs)
52 def create_share_from_snapshot(self, context, share, snapshot, **kwargs):
53 return self.library.create_share_from_snapshot(context, share,
54 snapshot, **kwargs)
56 def create_snapshot(self, context, snapshot, **kwargs):
57 return self.library.create_snapshot(context, snapshot, **kwargs)
59 def revert_to_snapshot(self, context, snapshot, share_access_rules,
60 snapshot_access_rules, **kwargs):
61 return self.library.revert_to_snapshot(context, snapshot, **kwargs)
63 def delete_share(self, context, share, **kwargs):
64 self.library.delete_share(context, share, **kwargs)
66 def delete_snapshot(self, context, snapshot, **kwargs):
67 self.library.delete_snapshot(context, snapshot, **kwargs)
69 def extend_share(self, share, new_size, **kwargs):
70 self.library.extend_share(share, new_size, **kwargs)
72 def shrink_share(self, share, new_size, **kwargs):
73 self.library.shrink_share(share, new_size, **kwargs)
75 def manage_existing(self, share, driver_options):
76 return self.library.manage_existing(share, driver_options)
78 def unmanage(self, share):
79 self.library.unmanage(share)
81 def manage_existing_snapshot(self, snapshot, driver_options):
82 return self.library.manage_existing_snapshot(snapshot, driver_options)
84 def unmanage_snapshot(self, snapshot):
85 self.library.unmanage_snapshot(snapshot)
87 def manage_existing_with_server(
88 self, share, driver_options, share_server=None):
89 raise NotImplementedError
91 def unmanage_with_server(self, share, share_server=None):
92 raise NotImplementedError
94 def manage_existing_snapshot_with_server(
95 self, snapshot, driver_options, share_server=None):
96 raise NotImplementedError
98 def unmanage_snapshot_with_server(self, snapshot, share_server=None):
99 raise NotImplementedError
101 def update_access(self, context, share, access_rules, add_rules,
102 delete_rules, update_rules, **kwargs):
103 self.library.update_access(context, share, access_rules, add_rules,
104 delete_rules, update_rules, **kwargs)
106 def _update_share_stats(self, data=None):
107 data = self.library.get_share_stats(
108 get_filter_function=self.get_filter_function,
109 goodness_function=self.get_goodness_function())
110 super(NetAppCmodeSingleSvmShareDriver, self)._update_share_stats(
111 data=data)
113 def get_default_filter_function(self, pool=None):
114 return self.library.get_default_filter_function(pool=pool)
116 def get_default_goodness_function(self):
117 return self.library.get_default_goodness_function()
119 def get_share_server_pools(self, share_server):
120 return self.library.get_share_server_pools(share_server)
122 def get_network_allocations_number(self):
123 return self.library.get_network_allocations_number()
125 def get_admin_network_allocations_number(self):
126 return self.library.get_admin_network_allocations_number()
128 def _setup_server(self, network_info, metadata=None):
129 return self.library.setup_server(network_info, metadata)
131 def _teardown_server(self, server_details, **kwargs):
132 self.library.teardown_server(server_details, **kwargs)
134 def create_replica(self, context, replica_list, replica, access_rules,
135 replica_snapshots, **kwargs):
136 return self.library.create_replica(context, replica_list, replica,
137 access_rules, replica_snapshots,
138 **kwargs)
140 def delete_replica(self, context, replica_list, replica_snapshots, replica,
141 **kwargs):
142 self.library.delete_replica(context, replica_list, replica,
143 replica_snapshots, **kwargs)
145 def promote_replica(self, context, replica_list, replica, access_rules,
146 share_server=None, quiesce_wait_time=None):
147 return self.library.promote_replica(
148 context, replica_list, replica,
149 access_rules,
150 share_server=share_server,
151 quiesce_wait_time=quiesce_wait_time)
153 def update_replica_state(self, context, replica_list, replica,
154 access_rules, replica_snapshots,
155 share_server=None):
156 return self.library.update_replica_state(context,
157 replica_list,
158 replica,
159 access_rules,
160 replica_snapshots,
161 share_server=share_server)
163 def create_replicated_snapshot(self, context, replica_list,
164 replica_snapshots, share_server=None):
165 return self.library.create_replicated_snapshot(
166 context, replica_list, replica_snapshots,
167 share_server=share_server)
169 def delete_replicated_snapshot(self, context, replica_list,
170 replica_snapshots, share_server=None):
171 return self.library.delete_replicated_snapshot(
172 context, replica_list, replica_snapshots,
173 share_server=share_server)
175 def update_replicated_snapshot(self, context, replica_list,
176 share_replica, replica_snapshots,
177 replica_snapshot, share_server=None):
178 return self.library.update_replicated_snapshot(
179 replica_list, share_replica, replica_snapshots, replica_snapshot,
180 share_server=share_server)
182 def revert_to_replicated_snapshot(self, context, active_replica,
183 replica_list, active_replica_snapshot,
184 replica_snapshots, share_access_rules,
185 snapshot_access_rules,
186 **kwargs):
187 return self.library.revert_to_replicated_snapshot(
188 context, active_replica, replica_list, active_replica_snapshot,
189 replica_snapshots, **kwargs)
191 def migration_check_compatibility(self, context, source_share,
192 destination_share, share_server=None,
193 destination_share_server=None):
194 return self.library.migration_check_compatibility(
195 context, source_share, destination_share,
196 share_server=share_server,
197 destination_share_server=destination_share_server)
199 def migration_start(self, context, source_share, destination_share,
200 source_snapshots, snapshot_mappings,
201 share_server=None, destination_share_server=None):
202 return self.library.migration_start(
203 context, source_share, destination_share,
204 source_snapshots, snapshot_mappings, share_server=share_server,
205 destination_share_server=destination_share_server)
207 def migration_continue(self, context, source_share, destination_share,
208 source_snapshots, snapshot_mappings,
209 share_server=None, destination_share_server=None):
210 return self.library.migration_continue(
211 context, source_share, destination_share,
212 source_snapshots, snapshot_mappings, share_server=share_server,
213 destination_share_server=destination_share_server)
215 def migration_get_progress(self, context, source_share,
216 destination_share, source_snapshots,
217 snapshot_mappings, share_server=None,
218 destination_share_server=None):
219 return self.library.migration_get_progress(
220 context, source_share, destination_share,
221 source_snapshots, snapshot_mappings, share_server=share_server,
222 destination_share_server=destination_share_server)
224 def migration_cancel(self, context, source_share, destination_share,
225 source_snapshots, snapshot_mappings,
226 share_server=None, destination_share_server=None):
227 return self.library.migration_cancel(
228 context, source_share, destination_share,
229 source_snapshots, snapshot_mappings, share_server=share_server,
230 destination_share_server=destination_share_server)
232 def migration_complete(self, context, source_share, destination_share,
233 source_snapshots, snapshot_mappings,
234 share_server=None, destination_share_server=None):
235 return self.library.migration_complete(
236 context, source_share, destination_share,
237 source_snapshots, snapshot_mappings, share_server=share_server,
238 destination_share_server=destination_share_server)
240 def create_share_group_snapshot(self, context, snap_dict,
241 share_server=None):
242 fallback_create = super(NetAppCmodeSingleSvmShareDriver,
243 self).create_share_group_snapshot
244 return self.library.create_group_snapshot(context, snap_dict,
245 fallback_create,
246 share_server)
248 def delete_share_group_snapshot(self, context, snap_dict,
249 share_server=None):
250 fallback_delete = super(NetAppCmodeSingleSvmShareDriver,
251 self).delete_share_group_snapshot
252 return self.library.delete_group_snapshot(context, snap_dict,
253 fallback_delete,
254 share_server)
256 def create_share_group_from_share_group_snapshot(
257 self, context, share_group_dict, snapshot_dict,
258 share_server=None):
259 fallback_create = super(
260 NetAppCmodeSingleSvmShareDriver,
261 self).create_share_group_from_share_group_snapshot
262 return self.library.create_group_from_snapshot(context,
263 share_group_dict,
264 snapshot_dict,
265 fallback_create,
266 share_server)
268 def get_configured_ip_versions(self):
269 return self.library.get_configured_ip_versions()
271 def get_backend_info(self, context):
272 return self.library.get_backend_info(context)
274 def ensure_shares(self, context, shares):
275 return self.library.ensure_shares(context, shares)
277 def get_share_server_network_info(
278 self, context, share_server, identifier, driver_options):
279 raise NotImplementedError
281 def manage_server(self, context, share_server, identifier, driver_options):
282 raise NotImplementedError
284 def unmanage_server(self, server_details, security_services=None):
285 raise NotImplementedError
287 def get_share_status(self, share_instance, share_server=None):
288 return self.library.get_share_status(share_instance, share_server)
290 def share_server_migration_start(self, context, src_share_server,
291 dest_share_server, shares, snapshots):
292 raise NotImplementedError
294 def share_server_migration_continue(self, context, src_share_server,
295 dest_share_server, shares, snapshots):
296 raise NotImplementedError
298 def share_server_migration_complete(self, context, src_share_server,
299 dest_share_server, shares, snapshots,
300 new_network_info):
301 raise NotImplementedError
303 def share_server_migration_cancel(self, context, src_share_server,
304 dest_share_server, shares, snapshots):
305 raise NotImplementedError
307 def share_server_migration_check_compatibility(
308 self, context, share_server, dest_host, old_share_network,
309 new_share_network, shares_request_spec):
310 raise NotImplementedError
312 def share_server_migration_get_progress(self, context, src_share_server,
313 dest_share_server):
314 raise NotImplementedError
316 def choose_share_server_compatible_with_share(self, context, share_servers,
317 share, snapshot=None,
318 share_group=None,
319 encryption_key_ref=None):
320 raise NotImplementedError
322 def choose_share_server_compatible_with_share_group(
323 self, context, share_servers, share_group_ref,
324 share_group_snapshot=None):
325 raise NotImplementedError
327 def update_share_server_security_service(
328 self, context, share_server, network_info, share_instances,
329 share_instance_rules, new_security_service,
330 current_security_service=None):
331 raise NotImplementedError
333 def check_update_share_server_security_service(
334 self, context, share_server, network_info, share_instances,
335 share_instance_rules, new_security_service,
336 current_security_service=None):
337 raise NotImplementedError
339 def check_update_share_server_network_allocations(
340 self, context, share_server, current_network_allocations,
341 new_share_network_subnet, security_services, share_instances,
342 share_instances_rules):
343 raise NotImplementedError
345 def update_share_server_network_allocations(
346 self, context, share_server, current_network_allocations,
347 new_network_allocations, security_services, shares, snapshots):
348 raise NotImplementedError
350 def create_backup(self, context, share, backup, **kwargs):
351 return self.library.create_backup(context, share, backup, **kwargs)
353 def create_backup_continue(self, context, share, backup, **kwargs):
354 return self.library.create_backup_continue(context, share, backup,
355 **kwargs)
357 def restore_backup(self, context, backup, share, **kwargs):
358 return self.library.restore_backup(context, backup, share, **kwargs)
360 def restore_backup_continue(self, context, backup, share, **kwargs):
361 return self.library.restore_backup_continue(context, backup, share,
362 **kwargs)
364 def delete_backup(self, context, backup, share, **kwargs):
365 return self.library.delete_backup(context, backup, share, **kwargs)
367 def update_share_from_metadata(self, context, share, metadata,
368 share_server=None):
369 self.library.update_share_from_metadata(
370 context, share, metadata, share_server=share_server)
372 def update_share_network_subnet_from_metadata(self, context,
373 share_network,
374 share_network_subnet,
375 share_server, metadata):
376 raise NotImplementedError