Add snap reserve config option to NetApp cDOT driver
By default, Data ONTAP sets the snapshot reserve for a share to 5%. Some users have requested a facility to override the default for applications where snapshots aren't required. This commit adds a config option for setting a different snap reserve value for a specific cDOT backend. Change-Id: Iba0bf696035353fac87f445f690bb94fa00ae0a0 Implements: blueprint netapp-cdot-snap-reserve-config-option
This commit is contained in:
parent
f1c096418d
commit
11ef510229
@ -1131,7 +1131,8 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
||||
def create_volume(self, aggregate_name, volume_name, size_gb,
|
||||
thin_provisioned=False, snapshot_policy=None,
|
||||
language=None, dedup_enabled=False,
|
||||
compression_enabled=False, max_files=None):
|
||||
compression_enabled=False, max_files=None,
|
||||
snapshot_reserve=None):
|
||||
|
||||
"""Creates a volume."""
|
||||
api_args = {
|
||||
@ -1146,6 +1147,9 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
||||
api_args['snapshot-policy'] = snapshot_policy
|
||||
if language is not None:
|
||||
api_args['language-code'] = language
|
||||
if snapshot_reserve is not None:
|
||||
api_args['percentage-snapshot-reserve'] = six.text_type(
|
||||
snapshot_reserve)
|
||||
self.send_request('volume-create', api_args)
|
||||
|
||||
# cDOT compression requires that deduplication be enabled.
|
||||
|
@ -383,9 +383,10 @@ class NetAppCmodeFileStorageLibrary(object):
|
||||
'provisioning options %(options)s',
|
||||
{'share': share_name, 'pool': pool_name,
|
||||
'options': provisioning_options})
|
||||
vserver_client.create_volume(pool_name, share_name,
|
||||
share['size'],
|
||||
**provisioning_options)
|
||||
vserver_client.create_volume(
|
||||
pool_name, share_name, share['size'],
|
||||
snapshot_reserve=self.configuration.
|
||||
netapp_volume_snapshot_reserve_percent, **provisioning_options)
|
||||
|
||||
@na_utils.trace
|
||||
def _remap_standard_boolean_extra_specs(self, extra_specs):
|
||||
|
@ -83,7 +83,13 @@ netapp_provisioning_opts = [
|
||||
cfg.StrOpt('netapp_root_volume',
|
||||
deprecated_name='netapp_root_volume_name',
|
||||
default='root',
|
||||
help='Root volume name.'), ]
|
||||
help='Root volume name.'),
|
||||
cfg.IntOpt('netapp_volume_snapshot_reserve_percent',
|
||||
min=0,
|
||||
max=90,
|
||||
default=5,
|
||||
help='The percentage of share space set aside as reserve for '
|
||||
'snapshot usage; valid values range from 0 to 90.'), ]
|
||||
|
||||
netapp_cluster_opts = [
|
||||
cfg.StrOpt('netapp_vserver',
|
||||
|
@ -2055,7 +2055,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
||||
fake.SHARE_AGGREGATE_NAME, fake.SHARE_NAME, 100,
|
||||
thin_provisioned=True, language='en-US',
|
||||
snapshot_policy='default', dedup_enabled=True,
|
||||
compression_enabled=True, max_files=5000)
|
||||
compression_enabled=True, max_files=5000, snapshot_reserve=15)
|
||||
|
||||
volume_create_args = {
|
||||
'containing-aggr-name': fake.SHARE_AGGREGATE_NAME,
|
||||
@ -2065,6 +2065,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
||||
'space-reserve': 'none',
|
||||
'language-code': 'en-US',
|
||||
'snapshot-policy': 'default',
|
||||
'percentage-snapshot-reserve': '15',
|
||||
}
|
||||
|
||||
self.client.send_request.assert_called_with('volume-create',
|
||||
|
@ -569,7 +569,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
||||
fake.POOL_NAME, fake.SHARE_NAME, fake.SHARE['size'],
|
||||
thin_provisioned=True, snapshot_policy='default',
|
||||
language='en-US', dedup_enabled=True,
|
||||
compression_enabled=False, max_files=5000)
|
||||
compression_enabled=False, max_files=5000, snapshot_reserve=8)
|
||||
mock_remap_standard_boolean_extra_specs.assert_called_once_with(
|
||||
fake.EXTRA_SPEC)
|
||||
|
||||
|
@ -511,4 +511,5 @@ def get_config_cmode():
|
||||
config.netapp_root_volume_aggregate = ROOT_VOLUME_AGGREGATE
|
||||
config.netapp_root_volume = ROOT_VOLUME
|
||||
config.netapp_lif_name_template = LIF_NAME_TEMPLATE
|
||||
config.netapp_volume_snapshot_reserve_percent = 8
|
||||
return config
|
||||
|
Loading…
Reference in New Issue
Block a user