Coverage for manila/share/drivers/netapp/options.py: 100%
22 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# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
13"""Contains configuration options for NetApp drivers.
15Common place to hold configuration options for all NetApp drivers.
16Options need to be grouped into granular units to be able to be reused
17by different modules and classes. This does not restrict declaring options in
18individual modules. If options are not re usable then can be declared in
19individual modules. It is recommended to Keep options at a single
20place to ensure re usability and better management of configuration options.
21"""
23from oslo_config import cfg
24from oslo_config import types
26netapp_proxy_opts = [
27 cfg.StrOpt('netapp_storage_family',
28 default='ontap_cluster',
29 help=('The storage family type used on the storage system; '
30 'valid values include ontap_cluster for using '
31 'clustered Data ONTAP.')), ]
33netapp_connection_opts = [
34 cfg.HostAddressOpt('netapp_server_hostname',
35 help='The hostname (or IP address) for the storage '
36 'system.'),
37 cfg.PortOpt('netapp_server_port',
38 help=('The TCP port to use for communication with the storage '
39 'system or proxy server. If not specified, Data ONTAP '
40 'drivers will use 80 for HTTP and 443 for HTTPS.')),
41 cfg.BoolOpt('netapp_use_legacy_client',
42 default=True,
43 help=('The ONTAP client used for retrieving and modifying '
44 'data on the storage. The legacy client relies mostly '
45 'on ZAPI calls, only using REST calls for SVM migrate '
46 'feature. If set to False, the new REST client is used, '
47 'which runs REST calls if supported, otherwise falls '
48 'back to the equivalent ZAPI call.')), ]
50netapp_transport_opts = [
51 cfg.StrOpt('netapp_transport_type',
52 default='http',
53 help=('The transport protocol used when communicating with '
54 'the storage system or proxy server. Valid values are '
55 'http or https.')),
56 cfg.StrOpt('netapp_ssl_cert_path',
57 help=("The path to a CA_BUNDLE file or directory with "
58 "certificates of trusted CA. If set to a directory, it "
59 "must have been processed using the c_rehash utility "
60 "supplied with OpenSSL. If not informed, it will use the "
61 "Mozilla's carefully curated collection of Root "
62 "Certificates for validating the trustworthiness of SSL "
63 "certificates.")), ]
65netapp_basicauth_opts = [
66 cfg.StrOpt('netapp_login',
67 help=('Administrative user account name used to access the '
68 'storage system.')),
69 cfg.StrOpt('netapp_password',
70 help=('Password for the administrative user account '
71 'specified in the netapp_login option.'),
72 secret=True), ]
74netapp_certificateauth_opts = [
75 cfg.StrOpt('netapp_private_key_file',
76 sample_default='/path/to/private_key.key,',
77 regex=r'^/.+',
78 help=('For self signed certificate: This file contains the'
79 ' private key associated with the self-signed'
80 ' certificate. It is a sensitive file that should be'
81 ' kept secure and protected. The private key is used to'
82 ' sign the certificate and establish the authenticity'
83 ' and integrity of the certificate during the'
84 ' authentication process.'
85 ' For ca verified certificate: This file contains the'
86 ' private key associated with the certificate. It is'
87 ' generated when creating the certificate signing'
88 ' request (CSR) and should be kept secure and protected.'
89 ' The private key is used to sign the CSR and later used'
90 ' to establish secure connections and authenticate the'
91 ' entity.')),
92 cfg.StrOpt('netapp_certificate_file',
93 sample_default='/path/to/certificate.pem',
94 regex=r'^/.+',
95 help=('For self signed certificate: This file contains the'
96 ' self-signed digital certificate itself. It includes'
97 ' information about the entity such as the common name'
98 ' (e.g., domain name), organization details, validity'
99 ' period, and public key. The certificate file is'
100 ' generated based on the private key and is used by'
101 ' clients or systems to verify the entity identity'
102 ' during the authentication process.'
103 ' For ca verified certificate: This file contains the'
104 ' digital certificate issued by the trusted third-party'
105 ' certificate authority (CA). It includes information'
106 ' about the entity identity, public key, and the CA that'
107 ' issued the certificate. The certificate file is used'
108 ' by clients or systems to verify the authenticity and'
109 ' integrity of the entity during the authentication'
110 ' process.')),
111 cfg.StrOpt('netapp_ca_certificate_file',
112 sample_default='/path/to/ca_certificate.crt',
113 regex=r'^/.+',
114 help=('This is applicable only for ca verified certificate.'
115 ' This file contains the public key certificate of'
116 ' the trusted third-party certificate authority (CA) that'
117 ' issued the certificate. It is used by clients or '
118 ' systems to validate the authenticity of the certificate'
119 ' presented by the entity. The CA certificate file'
120 ' is typically pre-configured in the trust store'
121 ' of clients or systems to establish trust in'
122 ' certificates issued by that CA.')),
123 cfg.BoolOpt('netapp_certificate_host_validation',
124 default=False,
125 help=('Enable certificate verification')), ]
127netapp_provisioning_opts = [
128 cfg.ListOpt('netapp_enabled_share_protocols',
129 default=['nfs3', 'nfs4.0'],
130 help='The NFS protocol versions that will be enabled. '
131 'Supported values include nfs3, nfs4.0, nfs4.1. This '
132 'option only applies when the option '
133 'driver_handles_share_servers is set to True. '),
134 cfg.StrOpt('netapp_volume_name_template',
135 help='NetApp volume name template.',
136 default='share_%(share_id)s'),
137 cfg.StrOpt('netapp_vserver_name_template',
138 default='os_%s',
139 help='Name template to use for new Vserver. '
140 'When using CIFS protocol make sure to not '
141 'configure characters illegal in DNS hostnames.'),
142 cfg.StrOpt('netapp_qos_policy_group_name_template',
143 help='NetApp QoS policy group name template.',
144 default='qos_share_%(share_id)s'),
145 cfg.StrOpt('netapp_port_name_search_pattern',
146 default='(.*)',
147 help='Pattern for overriding the selection of network ports '
148 'on which to create Vserver LIFs.'),
149 cfg.StrOpt('netapp_lif_name_template',
150 default='os_%(net_allocation_id)s',
151 help='Logical interface (LIF) name template'),
152 cfg.StrOpt('netapp_identity_auth_token_path',
153 default='',
154 help='Path to interact with auth tokens'),
155 cfg.StrOpt('netapp_aggregate_name_search_pattern',
156 default='(.*)',
157 help='Pattern for searching available aggregates '
158 'for provisioning.'),
159 cfg.StrOpt('netapp_root_volume_aggregate',
160 help='Name of aggregate to create Vserver root volumes on. '
161 'This option only applies when the option '
162 'driver_handles_share_servers is set to True.'),
163 cfg.StrOpt('netapp_root_volume',
164 default='root',
165 help='Root volume name.'),
166 cfg.IntOpt('netapp_delete_retention_hours',
167 min=0,
168 default=12,
169 help='The number of hours that a deleted volume should be '
170 'retained before the delete is completed.'),
171 cfg.IntOpt('netapp_volume_snapshot_reserve_percent',
172 min=0,
173 max=90,
174 default=5,
175 help='The percentage of share space set aside as reserve for '
176 'snapshot usage; valid values range from 0 to 90.'),
177 cfg.StrOpt('netapp_reset_snapdir_visibility',
178 choices=['visible', 'hidden', 'default'],
179 default="default",
180 help="This option forces all existing shares to have their "
181 "snapshot directory visibility set to either 'visible' or "
182 "'hidden' during driver startup. If set to 'default', "
183 "nothing will be changed during startup. This will not "
184 "affect new shares, which will have their snapshot "
185 "directory always visible, unless toggled by the share "
186 "type extra spec 'netapp:hide_snapdir'."),
187 cfg.ListOpt('netapp_volume_snapshot_policy_exceptions',
188 help='NetApp volume Snapshot policy names which will not '
189 'be overriden by extra-specs.',
190 default=['ec2_backups']),
191 cfg.StrOpt('netapp_snapmirror_policy_name_svm_template',
192 help='NetApp SnapMirror policy name template for Storage '
193 'Virtual Machines (Vservers).',
194 default='snapmirror_policy_%(share_server_id)s'),
195 cfg.ListOpt('netapp_fpolicy_default_file_operations',
196 help='NetApp FPolicy file operations to apply to a FPolicy '
197 'event, when not provided by the user using '
198 '"netapp:fpolicy_file_operations" extra-spec.',
199 default=['create', 'write', 'rename']),
200 cfg.StrOpt('netapp_fpolicy_policy_name_template',
201 help='NetApp FPolicy policy name template.',
202 default='fpolicy_policy_%(share_id)s'),
203 cfg.StrOpt('netapp_fpolicy_event_name_template',
204 help='NetApp FPolicy policy name template.',
205 default='fpolicy_event_%(protocol)s_%(share_id)s'),
206 cfg.IntOpt('netapp_cached_aggregates_status_lifetime',
207 min=0,
208 default=60,
209 help='The maximum time in seconds that the cached aggregates '
210 'status will be considered valid. Trying to read the '
211 'expired cache leads to refreshing it.'),
212 cfg.BoolOpt('netapp_enable_flexgroup',
213 default=False,
214 help='Specify if the FlexGroup pool is enabled. When it is '
215 'enabled, the driver will report a single pool '
216 'representing all aggregates (ONTAP chooses on which the '
217 'share will be allocated). If you want to Manila control '
218 'the aggregate selection, you can configure its custom '
219 'FlexGroup pools through netapp_flexgroup_pools option. '
220 'The FlexGroup placement is done either by ONTAP or '
221 'Manila, not both.'),
222 cfg.MultiOpt('netapp_flexgroup_pools',
223 item_type=types.Dict(value_type=types.String()),
224 default={},
225 help="Multi opt of dict to represent the FlexGroup pools. "
226 "A FlexGroup pool is configured with its name and its "
227 "list of aggregates. Specify this option as many times "
228 "as you have FlexGroup pools. Each entry takes the "
229 "dict config form: "
230 "netapp_flexgroup_pools = "
231 "<pool_name>: <aggr_name1> <aggr_name2> .."),
232 cfg.BoolOpt('netapp_flexgroup_pool_only',
233 default=False,
234 help='Specify if the FlexVol pools must not be reported when '
235 'the netapp_enable_flexgroup is enabled.'),
236 cfg.IntOpt('netapp_flexgroup_volume_online_timeout',
237 min=60,
238 default=360, # Default to six minutes
239 help='Sets time in seconds to wait for a FlexGroup volume '
240 'create to complete and go online.'),
241 cfg.IntOpt('netapp_flexgroup_aggregate_not_busy_timeout',
242 min=60,
243 default=360, # Default to six minutes
244 help='Provisioning FlexGroup share requires that all of its '
245 'aggregates to not be busy deploying another volume. So, '
246 'sets time in seconds to retry to create the FlexGroup '
247 'share.'),
248 cfg.IntOpt('netapp_delete_busy_flexgroup_snapshot_timeout',
249 min=60,
250 default=360, # Default to six minutes
251 help='Sets time in seconds to wait for a FlexGroup snapshot '
252 'to not be busy with clones after splitting them.'),
253 cfg.IntOpt('netapp_rest_operation_timeout',
254 min=60,
255 default=60, # Default to one minutes
256 help='Sets maximum amount of time in seconds to wait for a '
257 'synchronous ONTAP REST API operation to be completed.'),
258 cfg.IntOpt('netapp_security_cert_expire_days',
259 min=1,
260 max=3652,
261 default=365,
262 help='Defines the expiration time (in days) for the '
263 'certificate created during the vserver creation. This '
264 'option only applies when the option '
265 'driver_handles_share_servers is set to True.'),
266 cfg.BoolOpt('netapp_restrict_lif_creation_per_ha_pair',
267 default=False,
268 help='Prevent the creation of a share server if total number'
269 ' of data LIFs on one node of HA pair, including those'
270 ' that can be migrated in case of failure, exceeds the '
271 'maximum data LIFs supported by the node. This option '
272 'guarantees that, in the event of a node failure, the'
273 ' partner node will be able to takeover all data LIFs.'),
274 cfg.BoolOpt('netapp_cifs_aes_encryption',
275 default=False,
276 help='This option enable/disable AES encryption for the share'
277 ' server based on the parameter value (True/False).'),
278 cfg.BoolOpt('netapp_enable_logical_space_reporting',
279 default=False,
280 help='This option enables the logical space reporting on a '
281 'newly created vserver and logical space accounting '
282 'on newly created volumes on this vserver. ')
283]
285netapp_cluster_opts = [
286 cfg.StrOpt('netapp_vserver',
287 help=('This option specifies the Storage Virtual Machine '
288 '(i.e. Vserver) name on the storage cluster on which '
289 'provisioning of file storage shares should occur. This '
290 'option should only be specified when the option '
291 'driver_handles_share_servers is set to False (i.e. the '
292 'driver is managing shares on a single pre-configured '
293 'Vserver).')),
294 cfg.StrOpt('netapp_cluster_name',
295 help=('This option specifies the Cluster Name on which '
296 'provisioning of file storage shares should occur. '
297 'If not set, the driver will try to discover by '
298 'API call.')), ]
300netapp_support_opts = [
301 cfg.StrOpt('netapp_trace_flags',
302 help=('Comma-separated list of options that control which '
303 'trace info is written to the debug logs. Values '
304 'include method and api. API logging can further be '
305 'filtered with the '
306 '``netapp_api_trace_pattern option``.')),
307 cfg.StrOpt('netapp_api_trace_pattern',
308 default='(.*)',
309 help=('A regular expression to limit the API tracing. This '
310 'option is honored only if enabling ``api`` tracing '
311 'with the ``netapp_trace_flags`` option. By default, '
312 'all APIs will be traced.')),
313]
315netapp_data_motion_opts = [
316 cfg.IntOpt('netapp_snapmirror_quiesce_timeout',
317 min=0,
318 default=3600, # One Hour
319 help='The maximum time in seconds to wait for existing '
320 'snapmirror transfers to complete before aborting when '
321 'promoting a replica.'),
322 cfg.IntOpt('netapp_snapmirror_release_timeout',
323 min=0,
324 default=3600, # One Hour
325 help='The maximum time in seconds to wait for a snapmirror '
326 'release when breaking snapmirror relationships.'),
327 cfg.StrOpt('netapp_snapmirror_schedule',
328 default='hourly', # One Hour
329 help='An interval in either minutes or hours used to update '
330 'the SnapMirror relationship. Few valid values are: '
331 '5min, 10min, 30min, hourly etc. The schedule at the '
332 '"destination" host will be the one that will be '
333 'considered when creating a new replica, or promoting '
334 'a replica'),
335 cfg.IntOpt('netapp_volume_move_cutover_timeout',
336 min=0,
337 default=3600, # One Hour,
338 help='The maximum time in seconds to wait for the completion '
339 'of a volume move operation after the cutover '
340 'was triggered.'),
341 cfg.IntOpt('netapp_start_volume_move_timeout',
342 min=0,
343 default=3600, # One Hour,
344 help='The maximum time in seconds to wait for the completion '
345 'of a volume clone split operation in order to start a '
346 'volume move.'),
347 cfg.IntOpt('netapp_migration_cancel_timeout',
348 min=0,
349 default=3600, # One Hour,
350 help='The maximum time in seconds that migration cancel '
351 'waits for all migration operations be completely '
352 'aborted.'),
353 cfg.IntOpt('netapp_server_migration_state_change_timeout',
354 min=0,
355 default=3600, # One hour,
356 help='The maximum time in seconds that a share server '
357 'migration waits for a vserver to change its internal '
358 'states.'),
359 cfg.BoolOpt('netapp_server_migration_check_capacity',
360 default=True,
361 help='Specify if the capacity check must be made by the '
362 'driver while performing a share server migration. '
363 'If enabled, the driver will validate if the destination '
364 'backend can hold all shares and snapshots capacities '
365 'from the source share server.'),
366 cfg.IntOpt('netapp_server_migration_state_change_timeout',
367 min=0,
368 default=3600, # One hour,
369 help='The maximum time in seconds that a share server '
370 'migration waits for a vserver to change its internal '
371 'states.'),
372 cfg.IntOpt('netapp_mount_replica_timeout',
373 min=0,
374 default=3600, # One Hour
375 help='The maximum time in seconds to wait for mounting '
376 'a replica.'),
377]
379netapp_backup_opts = [
380 cfg.ListOpt('netapp_enabled_backup_types',
381 default=[],
382 help='Specify compatible backup_types for backend to provision'
383 ' backup share for SnapVault relationship. Multiple '
384 'backup_types can be provided. If multiple backup types '
385 'are enabled, create separate config sections for each '
386 'backup type specifying the "netapp_backup_vserver", '
387 '"netapp_backup_backend_section_name", '
388 '"netapp_backup_volume", and '
389 '"netapp_snapmirror_job_timeout" as appropriate.'
390 ' Example- netapp_enabled_backup_types = eng_backup,'
391 ' finance_backup'),
392 cfg.StrOpt('netapp_backup_backend_section_name',
393 help='Backend (ONTAP cluster) name where backup volume will be '
394 'provisioned. This is one of the backend which is enabled '
395 'in manila.conf file.'),
396 cfg.StrOpt('netapp_backup_vserver',
397 default='',
398 help='vserver name of backend that is use for backup the share.'
399 ' When user provide vserver value then backup volume will '
400 ' be created under this vserver '),
401 cfg.StrOpt('netapp_backup_volume',
402 default='',
403 help='Specify backup share name in case user wanted to backup '
404 'the share. Some case user has dedicated volume for backup'
405 ' in this case use can provide dedicated volume. '
406 'backup_share_server must be specified if backup_share is'
407 ' provided'),
408 cfg.IntOpt('netapp_snapmirror_job_timeout',
409 min=0,
410 default=1800, # 30 minutes
411 help='The maximum time in seconds to wait for a snapmirror '
412 'related operation to backup to complete.'),
413]
415CONF = cfg.CONF
416CONF.register_opts(netapp_proxy_opts)
417CONF.register_opts(netapp_connection_opts)
418CONF.register_opts(netapp_transport_opts)
419CONF.register_opts(netapp_basicauth_opts)
420CONF.register_opts(netapp_certificateauth_opts)
421CONF.register_opts(netapp_provisioning_opts)
422CONF.register_opts(netapp_support_opts)
423CONF.register_opts(netapp_data_motion_opts)
424CONF.register_opts(netapp_backup_opts)