Coverage for manila/share/drivers/netapp/dataontap/cluster_mode/drv_multi_svm.py: 53%

158 statements  

« 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 multi-SVM storage driver. 

16 

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 manages share servers, meaning it creates Data ONTAP storage virtual 

20machines (i.e. 'vservers') for each share network for provisioning shares. 

21This driver supports NFS & CIFS protocols. 

22""" 

23 

24from manila.share import driver 

25from manila.share.drivers.netapp.dataontap.cluster_mode import lib_multi_svm 

26 

27 

28class NetAppCmodeMultiSvmShareDriver(driver.ShareDriver): 

29 """NetApp Cluster-mode multi-SVM share driver.""" 

30 

31 DRIVER_NAME = 'NetApp_Cluster_MultiSVM' 

32 

33 def __init__(self, *args, **kwargs): 

34 super(NetAppCmodeMultiSvmShareDriver, self).__init__( 

35 True, *args, **kwargs) 

36 self.library = lib_multi_svm.NetAppCmodeMultiSVMFileStorageLibrary( 

37 self.DRIVER_NAME, **kwargs) 

38 # NetApp driver supports updating security service for in use share 

39 # networks. 

40 self.security_service_update_support = True 

41 self.dhss_mandatory_security_service_association = { 

42 'nfs': None, 

43 'cifs': ['active_directory', ] 

44 } 

45 # NetApp driver supports multiple subnets including update existing 

46 # share servers. 

47 self.network_allocation_update_support = True 

48 self.share_replicas_migration_support = True 

49 # NetApp driver supports share server encryption and enables encryption 

50 # on the created share. 

51 self.encryption_support = ["share_server"] 

52 

53 def do_setup(self, context): 

54 self.library.do_setup(context) 

55 

56 def check_for_setup_error(self): 

57 self.library.check_for_setup_error() 

58 

59 def get_pool(self, share): 

60 return self.library.get_pool(share) 

61 

62 def create_share(self, context, share, **kwargs): 

63 return self.library.create_share(context, share, **kwargs) 

64 

65 def create_share_from_snapshot(self, context, share, snapshot, **kwargs): 

66 return self.library.create_share_from_snapshot(context, share, 

67 snapshot, **kwargs) 

68 

69 def create_snapshot(self, context, snapshot, **kwargs): 

70 return self.library.create_snapshot(context, snapshot, **kwargs) 

71 

72 def revert_to_snapshot(self, context, snapshot, share_access_rules, 

73 snapshot_access_rules, **kwargs): 

74 return self.library.revert_to_snapshot(context, snapshot, **kwargs) 

75 

76 def delete_share(self, context, share, **kwargs): 

77 self.library.delete_share(context, share, **kwargs) 

78 

79 def delete_snapshot(self, context, snapshot, **kwargs): 

80 self.library.delete_snapshot(context, snapshot, **kwargs) 

81 

82 def extend_share(self, share, new_size, **kwargs): 

83 self.library.extend_share(share, new_size, **kwargs) 

84 

85 def shrink_share(self, share, new_size, **kwargs): 

86 self.library.shrink_share(share, new_size, **kwargs) 

87 

88 def manage_existing(self, share, driver_options): 

89 raise NotImplementedError 

90 

91 def unmanage(self, share): 

92 raise NotImplementedError 

93 

94 def manage_existing_snapshot(self, snapshot, driver_options): 

95 raise NotImplementedError 

96 

97 def unmanage_snapshot(self, snapshot): 

98 raise NotImplementedError 

99 

100 def manage_existing_with_server( 

101 self, share, driver_options, share_server=None): 

102 return self.library.manage_existing( 

103 share, driver_options, share_server=share_server) 

104 

105 def unmanage_with_server(self, share, share_server=None): 

106 self.library.unmanage(share, share_server=share_server) 

107 

108 def manage_existing_snapshot_with_server( 

109 self, snapshot, driver_options, share_server=None): 

110 return self.library.manage_existing_snapshot( 

111 snapshot, driver_options, share_server=share_server) 

112 

113 def unmanage_snapshot_with_server(self, snapshot, share_server=None): 

114 self.library.unmanage_snapshot(snapshot, share_server=share_server) 

115 

116 def update_access(self, context, share, access_rules, add_rules, 

117 delete_rules, update_rules, **kwargs): 

118 self.library.update_access(context, share, access_rules, add_rules, 

119 delete_rules, update_rules, **kwargs) 

120 

121 def _update_share_stats(self, data=None): 

122 data = self.library.get_share_stats( 

123 get_filter_function=self.get_filter_function, 

124 goodness_function=self.get_goodness_function()) 

125 super(NetAppCmodeMultiSvmShareDriver, self)._update_share_stats( 

126 data=data) 

127 

128 def get_default_filter_function(self, pool=None): 

129 return self.library.get_default_filter_function(pool=pool) 

130 

131 def get_default_goodness_function(self): 

132 return self.library.get_default_goodness_function() 

133 

134 def get_share_server_pools(self, share_server): 

135 return self.library.get_share_server_pools(share_server) 

136 

137 def get_network_allocations_number(self): 

138 return self.library.get_network_allocations_number() 

139 

140 def get_admin_network_allocations_number(self): 

141 return self.library.get_admin_network_allocations_number( 

142 self.admin_network_api) 

143 

144 def _setup_server(self, network_info, metadata=None): 

145 return self.library.setup_server(network_info, metadata) 

146 

147 def _teardown_server(self, server_details, **kwargs): 

148 self.library.teardown_server(server_details, **kwargs) 

149 

150 def create_replica(self, context, replica_list, new_replica, access_rules, 

151 replica_snapshots, **kwargs): 

152 return self.library.create_replica(context, replica_list, new_replica, 

153 access_rules, replica_snapshots) 

154 

155 def delete_replica(self, context, replica_list, replica_snapshots, 

156 replica, **kwargs): 

157 self.library.delete_replica(context, replica_list, replica, 

158 replica_snapshots) 

159 

160 def promote_replica(self, context, replica_list, replica, access_rules, 

161 share_server=None, quiesce_wait_time=None): 

162 return self.library.promote_replica( 

163 context, replica_list, replica, 

164 access_rules, 

165 share_server=share_server, 

166 quiesce_wait_time=quiesce_wait_time) 

167 

168 def update_replica_state(self, context, replica_list, replica, 

169 access_rules, replica_snapshots, 

170 share_server=None): 

171 return self.library.update_replica_state(context, replica_list, 

172 replica, access_rules, 

173 replica_snapshots, 

174 share_server) 

175 

176 def create_replicated_snapshot(self, context, replica_list, 

177 replica_snapshots, share_server=None): 

178 return self.library.create_replicated_snapshot( 

179 context, replica_list, replica_snapshots, 

180 share_server=share_server) 

181 

182 def delete_replicated_snapshot(self, context, replica_list, 

183 replica_snapshots, share_server=None): 

184 return self.library.delete_replicated_snapshot( 

185 context, replica_list, replica_snapshots, 

186 share_server=share_server) 

187 

188 def update_replicated_snapshot(self, context, replica_list, 

189 share_replica, replica_snapshots, 

190 replica_snapshot, share_server=None): 

191 return self.library.update_replicated_snapshot( 

192 replica_list, share_replica, replica_snapshots, replica_snapshot, 

193 share_server=share_server) 

194 

195 def revert_to_replicated_snapshot(self, context, active_replica, 

196 replica_list, active_replica_snapshot, 

197 replica_snapshots, share_access_rules, 

198 snapshot_access_rules, 

199 **kwargs): 

200 return self.library.revert_to_replicated_snapshot( 

201 context, active_replica, replica_list, active_replica_snapshot, 

202 replica_snapshots, **kwargs) 

203 

204 def migration_check_compatibility(self, context, source_share, 

205 destination_share, share_server=None, 

206 destination_share_server=None): 

207 return self.library.migration_check_compatibility( 

208 context, source_share, destination_share, 

209 share_server=share_server, 

210 destination_share_server=destination_share_server) 

211 

212 def migration_start(self, context, source_share, destination_share, 

213 source_snapshots, snapshot_mappings, 

214 share_server=None, destination_share_server=None): 

215 return self.library.migration_start( 

216 context, source_share, destination_share, 

217 source_snapshots, snapshot_mappings, 

218 share_server=share_server, 

219 destination_share_server=destination_share_server) 

220 

221 def migration_continue(self, context, source_share, destination_share, 

222 source_snapshots, snapshot_mappings, 

223 share_server=None, destination_share_server=None): 

224 return self.library.migration_continue( 

225 context, source_share, destination_share, 

226 source_snapshots, snapshot_mappings, share_server=share_server, 

227 destination_share_server=destination_share_server) 

228 

229 def migration_get_progress(self, context, source_share, 

230 destination_share, source_snapshots, 

231 snapshot_mappings, share_server=None, 

232 destination_share_server=None): 

233 return self.library.migration_get_progress( 

234 context, source_share, destination_share, 

235 source_snapshots, snapshot_mappings, share_server=share_server, 

236 destination_share_server=destination_share_server) 

237 

238 def migration_cancel(self, context, source_share, destination_share, 

239 source_snapshots, snapshot_mappings, 

240 share_server=None, destination_share_server=None): 

241 return self.library.migration_cancel( 

242 context, source_share, destination_share, 

243 source_snapshots, snapshot_mappings, share_server=share_server, 

244 destination_share_server=destination_share_server) 

245 

246 def migration_complete(self, context, source_share, destination_share, 

247 source_snapshots, snapshot_mappings, 

248 share_server=None, destination_share_server=None): 

249 return self.library.migration_complete( 

250 context, source_share, destination_share, 

251 source_snapshots, snapshot_mappings, share_server=share_server, 

252 destination_share_server=destination_share_server) 

253 

254 def create_share_group_snapshot(self, context, snap_dict, 

255 share_server=None): 

256 fallback_create = super(NetAppCmodeMultiSvmShareDriver, 

257 self).create_share_group_snapshot 

258 return self.library.create_group_snapshot(context, snap_dict, 

259 fallback_create, 

260 share_server) 

261 

262 def delete_share_group_snapshot(self, context, snap_dict, 

263 share_server=None): 

264 fallback_delete = super(NetAppCmodeMultiSvmShareDriver, 

265 self).delete_share_group_snapshot 

266 return self.library.delete_group_snapshot(context, snap_dict, 

267 fallback_delete, 

268 share_server) 

269 

270 def create_share_group_from_share_group_snapshot( 

271 self, context, share_group_dict, snapshot_dict, 

272 share_server=None): 

273 fallback_create = super( 

274 NetAppCmodeMultiSvmShareDriver, 

275 self).create_share_group_from_share_group_snapshot 

276 return self.library.create_group_from_snapshot(context, 

277 share_group_dict, 

278 snapshot_dict, 

279 fallback_create, 

280 share_server) 

281 

282 def get_configured_ip_versions(self): 

283 return self.library.get_configured_ip_versions() 

284 

285 def get_backend_info(self, context): 

286 return self.library.get_backend_info(context) 

287 

288 def ensure_shares(self, context, shares): 

289 return self.library.ensure_shares(context, shares) 

290 

291 def get_share_server_network_info( 

292 self, context, share_server, identifier, driver_options): 

293 return self.library.get_share_server_network_info( 

294 context, share_server, identifier, driver_options) 

295 

296 def manage_server(self, context, share_server, identifier, driver_options): 

297 return self.library.manage_server( 

298 context, share_server, identifier, driver_options) 

299 

300 def unmanage_server(self, server_details, security_services=None): 

301 return self.library.unmanage_server(server_details, security_services) 

302 

303 def get_share_status(self, share_instance, share_server=None): 

304 return self.library.get_share_status(share_instance, share_server) 

305 

306 def share_server_migration_check_compatibility( 

307 self, context, share_server, dest_host, old_share_network, 

308 new_share_network, shares_request_spec): 

309 

310 return self.library.share_server_migration_check_compatibility( 

311 context, share_server, dest_host, old_share_network, 

312 new_share_network, shares_request_spec) 

313 

314 def share_server_migration_start(self, context, src_share_server, 

315 dest_share_server, shares, snapshots): 

316 return self.library.share_server_migration_start( 

317 context, src_share_server, dest_share_server, shares, snapshots) 

318 

319 def share_server_migration_continue(self, context, src_share_server, 

320 dest_share_server, shares, snapshots): 

321 return self.library.share_server_migration_continue( 

322 context, src_share_server, dest_share_server, shares, snapshots) 

323 

324 def share_server_migration_complete(self, context, src_share_server, 

325 dest_share_server, shares, snapshots, 

326 new_network_info): 

327 return self.library.share_server_migration_complete( 

328 context, src_share_server, dest_share_server, shares, snapshots, 

329 new_network_info) 

330 

331 def share_server_migration_cancel(self, context, src_share_server, 

332 dest_share_server, shares, snapshots): 

333 self.library.share_server_migration_cancel( 

334 context, src_share_server, dest_share_server, shares, snapshots) 

335 

336 def choose_share_server_compatible_with_share(self, context, share_servers, 

337 share, snapshot=None, 

338 share_group=None, 

339 encryption_key_ref=None): 

340 return self.library.choose_share_server_compatible_with_share( 

341 context, share_servers, share, snapshot=snapshot, 

342 share_group=share_group, 

343 encryption_key_ref=encryption_key_ref) 

344 

345 def choose_share_server_compatible_with_share_group( 

346 self, context, share_servers, share_group_ref, 

347 share_group_snapshot=None): 

348 return self.library.choose_share_server_compatible_with_share_group( 

349 context, share_servers, share_group_ref, 

350 share_group_snapshot=share_group_snapshot) 

351 

352 def share_server_migration_get_progress(self, context, src_share_server, 

353 dest_share_server, shares, 

354 snapshots): 

355 return self.library.share_server_migration_get_progress( 

356 context, src_share_server, dest_share_server, shares, snapshots) 

357 

358 def update_share_server_security_service( 

359 self, context, share_server, network_info, share_instances, 

360 share_instance_rules, new_security_service, 

361 current_security_service=None): 

362 return self.library.update_share_server_security_service( 

363 context, share_server, network_info, new_security_service, 

364 current_security_service=current_security_service) 

365 

366 def check_update_share_server_security_service( 

367 self, context, share_server, network_info, share_instances, 

368 share_instance_rules, new_security_service, 

369 current_security_service=None): 

370 return self.library.check_update_share_server_security_service( 

371 context, share_server, network_info, new_security_service, 

372 current_security_service=current_security_service) 

373 

374 def check_update_share_server_network_allocations( 

375 self, context, share_server, current_network_allocations, 

376 new_share_network_subnet, security_services, share_instances, 

377 share_instances_rules): 

378 return self.library.check_update_share_server_network_allocations( 

379 context, share_server, current_network_allocations, 

380 new_share_network_subnet, security_services, share_instances, 

381 share_instances_rules) 

382 

383 def update_share_server_network_allocations( 

384 self, context, share_server, current_network_allocations, 

385 new_network_allocations, security_services, shares, snapshots): 

386 return self.library.update_share_server_network_allocations( 

387 context, share_server, current_network_allocations, 

388 new_network_allocations, security_services, shares, snapshots) 

389 

390 def create_backup(self, context, share, backup, **kwargs): 

391 return self.library.create_backup(context, share, backup, **kwargs) 

392 

393 def create_backup_continue(self, context, share, backup, **kwargs): 

394 return self.library.create_backup_continue(context, share, backup, 

395 **kwargs) 

396 

397 def restore_backup(self, context, backup, share, **kwargs): 

398 return self.library.restore_backup(context, backup, share, 

399 **kwargs) 

400 

401 def restore_backup_continue(self, context, backup, share, **kwargs): 

402 return self.library.restore_backup_continue(context, backup, share, 

403 **kwargs) 

404 

405 def delete_backup(self, context, backup, share, **kwargs): 

406 return self.library.delete_backup(context, backup, share, **kwargs) 

407 

408 def update_share_from_metadata(self, context, share, metadata, 

409 share_server=None): 

410 self.library.update_share_from_metadata( 

411 context, share, metadata, share_server=share_server) 

412 

413 def update_share_network_subnet_from_metadata(self, context, 

414 share_network, 

415 share_network_subnet, 

416 share_server, metadata): 

417 self.library.update_share_network_subnet_from_metadata( 

418 context, share_network, share_network_subnet, 

419 share_server, metadata)