Merge "Support share-server-to-pool mapping in NetApp cDOT driver"
This commit is contained in:
commit
d0474c7e27
@ -75,6 +75,9 @@ class NetAppCmodeMultiSvmShareDriver(driver.ShareDriver):
|
||||
super(NetAppCmodeMultiSvmShareDriver, self)._update_share_stats(
|
||||
data=data)
|
||||
|
||||
def get_share_server_pools(self, share_server):
|
||||
return self.library.get_share_server_pools(share_server)
|
||||
|
||||
def get_network_allocations_number(self):
|
||||
return self.library.get_network_allocations_number()
|
||||
|
||||
|
@ -75,6 +75,9 @@ class NetAppCmodeSingleSvmShareDriver(driver.ShareDriver):
|
||||
super(NetAppCmodeSingleSvmShareDriver, self)._update_share_stats(
|
||||
data=data)
|
||||
|
||||
def get_share_server_pools(self, share_server):
|
||||
return self.library.get_share_server_pools(share_server)
|
||||
|
||||
def get_network_allocations_number(self):
|
||||
return self.library.get_network_allocations_number()
|
||||
|
||||
|
@ -199,7 +199,25 @@ class NetAppCmodeFileStorageLibrary(object):
|
||||
'storage_protocol': 'NFS_CIFS',
|
||||
'total_capacity_gb': 0.0,
|
||||
'free_capacity_gb': 0.0,
|
||||
'pools': self._get_pools(),
|
||||
}
|
||||
return data
|
||||
|
||||
@na_utils.trace
|
||||
def get_share_server_pools(self, share_server):
|
||||
"""Return list of pools related to a particular share server.
|
||||
|
||||
Note that the multi-SVM cDOT driver assigns all available pools to
|
||||
each Vserver, so there is no need to filter the pools any further
|
||||
by share_server.
|
||||
|
||||
:param share_server: ShareServer class instance.
|
||||
"""
|
||||
return self._get_pools()
|
||||
|
||||
@na_utils.trace
|
||||
def _get_pools(self):
|
||||
"""Retrieve list of pools available to this backend."""
|
||||
|
||||
pools = []
|
||||
aggr_space = self._get_aggregate_space()
|
||||
@ -229,8 +247,7 @@ class NetAppCmodeFileStorageLibrary(object):
|
||||
|
||||
pools.append(pool)
|
||||
|
||||
data['pools'] = pools
|
||||
return data
|
||||
return pools
|
||||
|
||||
@na_utils.trace
|
||||
def _handle_ems_logging(self):
|
||||
|
@ -284,9 +284,8 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
||||
def test_get_share_stats(self):
|
||||
|
||||
self.mock_object(self.library,
|
||||
'_get_aggregate_space',
|
||||
mock.Mock(return_value=fake.AGGREGATE_CAPACITIES))
|
||||
self.library._ssc_stats = fake.SSC_INFO
|
||||
'_get_pools',
|
||||
mock.Mock(return_value=fake.POOLS))
|
||||
|
||||
result = self.library.get_share_stats()
|
||||
|
||||
@ -299,30 +298,31 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
||||
'storage_protocol': 'NFS_CIFS',
|
||||
'total_capacity_gb': 0.0,
|
||||
'free_capacity_gb': 0.0,
|
||||
'pools': [
|
||||
{'pool_name': fake.AGGREGATES[0],
|
||||
'total_capacity_gb': 3.3,
|
||||
'free_capacity_gb': 1.1,
|
||||
'allocated_capacity_gb': 2.2,
|
||||
'QoS_support': 'False',
|
||||
'reserved_percentage': 0,
|
||||
'netapp_raid_type': 'raid4',
|
||||
'netapp_disk_type': 'FCAL'
|
||||
},
|
||||
{'pool_name': fake.AGGREGATES[1],
|
||||
'total_capacity_gb': 6.0,
|
||||
'free_capacity_gb': 2.0,
|
||||
'allocated_capacity_gb': 4.0,
|
||||
'QoS_support': 'False',
|
||||
'reserved_percentage': 0,
|
||||
'netapp_raid_type': 'raid_dp',
|
||||
'netapp_disk_type': 'SSD'
|
||||
},
|
||||
]
|
||||
'pools': fake.POOLS,
|
||||
}
|
||||
|
||||
self.assertDictEqual(expected, result)
|
||||
|
||||
def test_get_share_server_pools(self):
|
||||
|
||||
self.mock_object(self.library,
|
||||
'_get_pools',
|
||||
mock.Mock(return_value=fake.POOLS))
|
||||
|
||||
result = self.library.get_share_server_pools(fake.SHARE_SERVER)
|
||||
|
||||
self.assertListEqual(fake.POOLS, result)
|
||||
|
||||
def test_get_pools(self):
|
||||
|
||||
self.mock_object(self.library,
|
||||
'_get_aggregate_space',
|
||||
mock.Mock(return_value=fake.AGGREGATE_CAPACITIES))
|
||||
self.library._ssc_stats = fake.SSC_INFO
|
||||
|
||||
result = self.library._get_pools()
|
||||
|
||||
self.assertListEqual(fake.POOLS, result)
|
||||
|
||||
def test_handle_ems_logging(self):
|
||||
|
||||
self.mock_object(self.library,
|
||||
|
@ -270,6 +270,27 @@ SSC_INFO = {
|
||||
}
|
||||
}
|
||||
|
||||
POOLS = [
|
||||
{'pool_name': AGGREGATES[0],
|
||||
'total_capacity_gb': 3.3,
|
||||
'free_capacity_gb': 1.1,
|
||||
'allocated_capacity_gb': 2.2,
|
||||
'QoS_support': 'False',
|
||||
'reserved_percentage': 0,
|
||||
'netapp_raid_type': 'raid4',
|
||||
'netapp_disk_type': 'FCAL'
|
||||
},
|
||||
{'pool_name': AGGREGATES[1],
|
||||
'total_capacity_gb': 6.0,
|
||||
'free_capacity_gb': 2.0,
|
||||
'allocated_capacity_gb': 4.0,
|
||||
'QoS_support': 'False',
|
||||
'reserved_percentage': 0,
|
||||
'netapp_raid_type': 'raid_dp',
|
||||
'netapp_disk_type': 'SSD'
|
||||
},
|
||||
]
|
||||
|
||||
SSC_RAID_TYPES = {
|
||||
AGGREGATES[0]: 'raid4',
|
||||
AGGREGATES[1]: 'raid_dp'
|
||||
|
Loading…
Reference in New Issue
Block a user