Browse Source

Merge "[Unity] Driver supports the mode that does not create and destory share servers (DHSS=False)"

tags/9.0.0.0rc1
Zuul 1 month ago
parent
commit
89383d9bfa

+ 61
- 69
doc/source/admin/emc_unity_driver.rst View File

@@ -121,21 +121,67 @@ for the Unity driver.
121 121
     emc_nas_server = <management IP address of the Unity system>
122 122
     emc_nas_login = <user with administrator privilege>
123 123
     emc_nas_password = <password>
124
-    emc_nas_server_container = [SPA|SPB]
125
-    emc_nas_pool_names = <Comma separated pool names>
126
-    emc_interface_ports = <Comma separated ports list>
127
-
128
-- `emc_share_backend` is the plugin name. Set it to `unity` for the Unity
129
-  driver.
130
-- `emc_nas_server` is the management IP for Unity.
131
-- `emc_nas_server_container` is the SP that will be used as share server.
132
-- `emc_nas_pool_names` is the name of the pools to be used by this backend.
133
-  If no name is specified, all storage pools on the system will be managed.
134
-  Wild card character is supported.
135
-  Examples: pool_1, pool_*, *
136
-- `emc_interface_ports` is the white list of the ports to be used for
137
-  connection. Wild card character is supported.
138
-  Examples: spa_eth1, spa_*, *
124
+    unity_server_meta_pool = <pool name>
125
+    unity_share_data_pools = <comma separated pool names>
126
+    unity_ethernet_ports = <comma separated ports list>
127
+    driver_handles_share_servers = True/False
128
+    unity_share_server = <name of NAS server in Unity system>
129
+
130
+- `emc_share_backend`
131
+    The plugin name. Set it to `unity` for the Unity driver.
132
+
133
+- `emc_nas_server`
134
+    The management IP for Unity.
135
+
136
+- `unity_server_meta_pool`
137
+    The name of the pool to persist the meta-data of NAS server.
138
+    This option is required.
139
+
140
+- `unity_share_data_pools`
141
+    Comma separated list specifying the name of the pools to be used
142
+    by this backend. Do not set this option if all storage pools
143
+    on the system can be used.
144
+    Wild card character is supported.
145
+
146
+    Examples:
147
+
148
+    .. code-block:: ini
149
+
150
+       # Only use pool_1
151
+       unity_share_data_pools = pool_1
152
+       # Only use pools whose name stars from pool_
153
+       unity_share_data_pools = pool_*
154
+       # Use all pools on Unity
155
+       unity_share_data_pools = *
156
+
157
+- `unity_ethernet_ports`
158
+    Comma separated list specifying the ethernet ports of Unity system
159
+    that can be used for share. Do not set this option if all ethernet ports
160
+    can be used.
161
+    Wild card character is supported. Both the normal ethernet port and link
162
+    aggregation port can be used by Unity share driver.
163
+
164
+
165
+    Examples:
166
+
167
+    .. code-block:: ini
168
+
169
+       # Only use spa_eth1
170
+       unity_ethernet_ports = spa_eth1
171
+       # Use port whose name stars from spa_
172
+       unity_ethernet_ports = spa_*
173
+       # Use all Link Aggregation ports
174
+       unity_ethernet_ports = sp*_la_*
175
+       # Use all available ports
176
+       unity_ethernet_ports = *
177
+
178
+- `driver_handles_share_servers`
179
+    Unity driver requires this option to be as `True` or `False`.
180
+    Need to set `unity_share_server` when the value is `False`.
181
+
182
+- `unity_share_server`
183
+    One of NAS server names in Unity, it is used for share creation when
184
+    the driver is in `DHSS=False` mode.
139 185
 
140 186
 Restart of :term:`manila-share` service is needed for the configuration changes to take
141 187
 effect.
@@ -149,22 +195,6 @@ into two parts:
149 195
 1. The driver is able to manage share or snapshot in the Neutron IPv6 network.
150 196
 2. The driver is able to connect Unity management interface using its IPv6 address.
151 197
 
152
-Pre-Configurations for IPv6 support
153
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
-
155
-The following parameters need to be configured in `/etc/manila/manila.conf`
156
-for the Unity driver:
157
-
158
-    network_plugin_ipv6_enabled = True
159
-
160
-- `network_plugin_ipv6_enabled` indicates IPv6 is enabled.
161
-
162
-If you want to connect Unity using IPv6 address, you should configure IPv6 address
163
-by `/net/if/mgmt` uemcli command, `mgmtInterfaceSettings` RESTful api or the system
164
-settings of Unity GUI for Unity and specify the address in `/etc/manila/manila.conf`:
165
-
166
-    emc_nas_server = <IPv6 address>
167
-
168 198
 Snapshot support
169 199
 ----------------
170 200
 
@@ -176,44 +206,6 @@ create snapshots on shares of this share type. The feature is divided into two p
176 206
 1. The driver is able to create/delete snapshot of share.
177 207
 2. The driver is able to create share from snapshot.
178 208
 
179
-Pre-Configurations for Snapshot support
180
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181
-
182
-The following extra specifications need to be configured with share type.
183
-
184
-- snapshot_support = True
185
-- create_share_from_snapshot_support = True
186
-
187
-For new share type, these extra specifications can be set directly when creating share type:
188
-
189
-.. code-block:: console
190
-
191
-    manila type-create --snapshot_support True --create_share_from_snapshot_support True ${share_type_name} True
192
-
193
-Or you can update already existing share type with command:
194
-
195
-.. code-block:: console
196
-
197
-    manila type-key ${share_type_name} set snapshot_support=True
198
-    manila type-key ${share_type_name} set create_share_from_snapshot_support=True
199
-
200
-To snapshot a share and create share from the snapshot
201
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202
-
203
-Firstly, you need create a share from share type that has extra specifications(snapshot_support=True, create_share_from_snapshot_support=True).
204
-Then snapshot the share with command:
205
-
206
-.. code-block:: console
207
-
208
-    manila snapshot-create ${source_share_name} --name ${target_snapshot_name} --description " "
209
-
210
-After creating the snapshot from previous step, you can create share from that snapshot.
211
-Use command:
212
-
213
-.. code-block:: console
214
-
215
-    manila create nfs 1 --name ${target_share_name} --metadata source=snapshot --description " " --snapshot-id ${source_snapshot_id}
216
-
217 209
 Restrictions
218 210
 ------------
219 211
 

+ 114
- 2
doc/source/configuration/shared-file-systems/drivers/dell-emc-unity-driver.rst View File

@@ -30,6 +30,10 @@ Requirements
30 30
 
31 31
   - Thin Provisioning
32 32
 
33
+  - Fiber Channel (FC)
34
+
35
+  - Internet Small Computer System Interface (iSCSI)
36
+
33 37
 
34 38
 Supported shared filesystems and operations
35 39
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -96,6 +100,109 @@ change the above mtu size from Unity Unisphere:
96 100
 The Unity driver will select the port where mtu is equal to the mtu
97 101
 of share network during share server creation.
98 102
 
103
+IPv6 support
104
+------------
105
+
106
+IPv6 support for Unity driver is introduced in Queens release. The feature is divided
107
+into two parts:
108
+
109
+#. The driver is able to manage share or snapshot in the Neutron IPv6 network.
110
+#. The driver is able to connect Unity management interface using its IPv6 address.
111
+
112
+Pre-Configurations for IPv6 support
113
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114
+
115
+The following parameters need to be configured in `/etc/manila/manila.conf`
116
+for the Unity driver:
117
+
118
+    network_plugin_ipv6_enabled = True
119
+
120
+- `network_plugin_ipv6_enabled` indicates IPv6 is enabled.
121
+
122
+If you want to connect Unity using IPv6 address, you should configure IPv6 address
123
+by `/net/if/mgmt` uemcli command, `mgmtInterfaceSettings` RESTful api or the system
124
+settings of Unity GUI for Unity and specify the address in `/etc/manila/manila.conf`:
125
+
126
+    emc_nas_server = <IPv6 address>
127
+
128
+Supported share creation in mode that driver does not create and destroy share servers (DHSS=False)
129
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
+
131
+To create a file share in this mode, you need to:
132
+
133
+#. Create NAS server with network interface in Unity system.
134
+#. Set 'driver_handles_share_servers=False' and 'unity_share_server' in ``/etc/manila/manila.conf``:
135
+
136
+    .. code-block:: ini
137
+
138
+        driver_handles_share_servers = False
139
+        unity_share_server = <name of NAS server in Unity system>
140
+
141
+#. Specify the share type with driver_handles_share_servers = False extra specification:
142
+
143
+    .. code-block:: console
144
+
145
+        $ manila type-create <share_type_name> False
146
+
147
+#. Create share.
148
+
149
+    .. code-block:: console
150
+
151
+        $ manila create <share_protocol> <size> --name <share_name> --share-type <share_type_name>
152
+
153
+.. note::
154
+
155
+    Do not specify the share network in share creation command because no share servers will be created.
156
+    Driver will use the unity_share_server specified for share creation.
157
+
158
+Snapshot support
159
+----------------
160
+
161
+In the Mitaka and Newton release of OpenStack, Snapshot support is enabled by default for a newly created share type.
162
+Starting with the Ocata release, the snapshot_support extra spec must be set to True in order to allow snapshots for
163
+a share type. If the 'snapshot_support' extra_spec is omitted or if it is set to False, users would not be able to
164
+create snapshots on shares of this share type. The feature is divided into two parts:
165
+
166
+1. The driver is able to create/delete snapshot of share.
167
+2. The driver is able to create share from snapshot.
168
+
169
+Pre-Configurations for Snapshot support
170
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171
+
172
+The following extra specifications need to be configured with share type.
173
+
174
+- snapshot_support = True
175
+- create_share_from_snapshot_support = True
176
+
177
+For new share type, these extra specifications can be set directly when creating share type:
178
+
179
+.. code-block:: console
180
+
181
+    manila type-create --snapshot_support True --create_share_from_snapshot_support True ${share_type_name} True
182
+
183
+Or you can update already existing share type with command:
184
+
185
+.. code-block:: console
186
+
187
+    manila type-key ${share_type_name} set snapshot_support=True
188
+    manila type-key ${share_type_name} set create_share_from_snapshot_support=True
189
+
190
+To snapshot a share and create share from the snapshot
191
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
+
193
+Firstly, you need create a share from share type that has extra specifications(snapshot_support=True, create_share_from_snapshot_support=True).
194
+Then snapshot the share with command:
195
+
196
+.. code-block:: console
197
+
198
+    manila snapshot-create ${source_share_name} --name ${target_snapshot_name} --description " "
199
+
200
+After creating the snapshot from previous step, you can create share from that snapshot.
201
+Use command:
202
+
203
+.. code-block:: console
204
+
205
+    manila create nfs 1 --name ${target_share_name} --metadata source=snapshot --description " " --snapshot-id ${source_snapshot_id}
99 206
 
100 207
 Supported security services
101 208
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -164,7 +271,8 @@ for the Unity driver.
164 271
     unity_server_meta_pool = <pool name>
165 272
     unity_share_data_pools = <comma separated pool names>
166 273
     unity_ethernet_ports = <comma separated ports list>
167
-    driver_handles_share_servers = True
274
+    driver_handles_share_servers = True/False
275
+    unity_share_server = <name of NAS server in Unity system>
168 276
 
169 277
 - ``emc_share_backend``
170 278
     The plugin name. Set it to `unity` for the Unity driver.
@@ -227,8 +335,12 @@ for the Unity driver.
227 335
       impact.
228 336
 
229 337
 - ``driver_handles_share_servers``
230
-    Unity driver requires this option to be as ``True``.
338
+    Unity driver requires this option to be as ``True`` or ``False``.
339
+    Need to set ``unity_share_server`` when the value is ``False``.
231 340
 
341
+- ``unity_share_server``
342
+    One of NAS server names in Unity, it is used for share creation when
343
+    the driver is in ``DHSS=False`` mode.
232 344
 
233 345
 Restart of ``manila-share`` service is needed for the configuration
234 346
 changes to take effect.

+ 2
- 0
doc/source/configuration/tables/manila-unity.inc View File

@@ -24,3 +24,5 @@
24 24
      - (String) Pool to persist the meta-data of NAS server.
25 25
    * - ``unity_share_data_pools`` = ``None``
26 26
      - (List) Comma separated list of pools that can be used to persist share data.
27
+   * - ``unity_share_server`` = ``None``
28
+     - One of NAS server names in Unity, it is used for share creation when the driver is in ``DHSS=False`` mode..

+ 29
- 6
manila/share/drivers/dell_emc/plugins/unity/connection.py View File

@@ -37,7 +37,11 @@ from manila.share.drivers.dell_emc.plugins.unity import utils as unity_utils
37 37
 from manila.share import utils as share_utils
38 38
 from manila import utils
39 39
 
40
-VERSION = "6.1.0"
40
+"""Version history:
41
+     7.0.0 - Supports DHSS=False mode
42
+"""
43
+
44
+VERSION = "7.0.0"
41 45
 
42 46
 LOG = log.getLogger(__name__)
43 47
 SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan')
@@ -61,6 +65,10 @@ UNITY_OPTS = [
61 65
                deprecated_reason='Unity driver supports nas server auto load '
62 66
                                  'balance.',
63 67
                help='Storage processor to host the NAS server. Obsolete.'),
68
+    cfg.StrOpt('unity_share_server',
69
+               help='NAS server used for creating share when driver '
70
+                    'is in DHSS=False mode. It is required when '
71
+                    'driver_handles_share_servers=False in manila.conf.'),
64 72
 ]
65 73
 
66 74
 CONF = cfg.CONF
@@ -86,12 +94,13 @@ class UnityStorageConnection(driver.StorageConnection):
86 94
         self.reserved_percentage = None
87 95
         self.max_over_subscription_ratio = None
88 96
         self.port_ids_conf = None
97
+        self.unity_share_server = None
89 98
         self.ipv6_implemented = True
90 99
         self.revert_to_snap_support = True
91 100
         self.shrink_share_support = True
92 101
 
93 102
         # props from super class.
94
-        self.driver_handles_share_servers = True
103
+        self.driver_handles_share_servers = (True, False)
95 104
 
96 105
     def connect(self, emc_share_driver, context):
97 106
         """Connect to Unity storage."""
@@ -112,10 +121,25 @@ class UnityStorageConnection(driver.StorageConnection):
112 121
         self.max_over_subscription_ratio = config.safe_get(
113 122
             'max_over_subscription_ratio')
114 123
         self.port_ids_conf = config.safe_get('unity_ethernet_ports')
124
+        self.unity_share_server = config.safe_get('unity_share_server')
125
+        self.driver_handles_share_servers = config.safe_get(
126
+            'driver_handles_share_servers')
127
+        if (not self.driver_handles_share_servers) and (
128
+                not self.unity_share_server):
129
+            msg = ("Make sure there is NAS server name "
130
+                   "configured for share creation when driver "
131
+                   "is in DHSS=False mode.")
132
+            raise exception.BadConfigurationException(reason=msg)
115 133
         self.validate_port_configuration(self.port_ids_conf)
116 134
         pool_name = config.unity_server_meta_pool
117 135
         self._config_pool(pool_name)
118 136
 
137
+    def get_server_name(self, share_server=None):
138
+        if not self.driver_handles_share_servers:
139
+            return self.unity_share_server
140
+        else:
141
+            return self._get_server_name(share_server)
142
+
119 143
     def validate_port_configuration(self, port_ids_conf):
120 144
         """Initializes the SP and ports based on the port option."""
121 145
 
@@ -165,9 +189,8 @@ class UnityStorageConnection(driver.StorageConnection):
165 189
 
166 190
         # Get pool name from share host field
167 191
         pool_name = self._get_pool_name_from_host(share['host'])
168
-        # Get share server name from share server
169
-        server_name = self._get_server_name(share_server)
170
-
192
+        # Get share server name from share server or manila.conf.
193
+        server_name = self.get_server_name(share_server)
171 194
         pool = self.client.get_pool(pool_name)
172 195
         try:
173 196
             nas_server = self.client.get_nas_server(server_name)
@@ -207,7 +230,7 @@ class UnityStorageConnection(driver.StorageConnection):
207 230
         self._validate_share_protocol(share_proto)
208 231
 
209 232
         # Get share server name from share server
210
-        server_name = self._get_server_name(share_server)
233
+        server_name = self.get_server_name(share_server)
211 234
 
212 235
         try:
213 236
             nas_server = self.client.get_nas_server(server_name)

+ 36
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/mocked_manila.yaml View File

@@ -188,6 +188,42 @@ nfs_share:
188 188
     export_locations: []
189 189
     is_public: False
190 190
 
191
+dhss_false_cifs_share:
192
+  _type: 'share'
193
+  _properties: &dhss_false_cifs_share_prop
194
+    share_id: '708e753c-aacb-411f-9c8a-8b8175da4e73'
195
+    availability_zone_id: 'de628fb6-1c99-41f6-a06a-adb61ff693b5'
196
+    share_network_id: '232d8218-2743-41d1-832b-4194626e691e'
197
+    share_server_id: 'test-dhss-false-427f-b4de-0ad83el5j8'
198
+    id: '716100cc-e0b4-416b-ac27-d38dd019330d'
199
+    size: 1
200
+    user_id: '19bbda71b578471a93363653dcb4c61d'
201
+    status: 'creating'
202
+    share_type_id: '57679eab-3e67-4052-b180-62b609670e93'
203
+    host: 'openstack@VNX#Pool_2'
204
+    display_name: 'cifs_share'
205
+    share_proto: 'CIFS'
206
+    export_locations: []
207
+    is_public: False
208
+
209
+dhss_false_nfs_share:
210
+  _type: 'share'
211
+  _properties: &dhss_false_nfs_share_prop
212
+    share_id: '12eb3777-7008-4721-8243-422507db8f9d'
213
+    availability_zone_id: 'de628fb6-1c99-41f6-a06a-adb61ff693b5'
214
+    share_network_id: '232d8218-2743-41d1-832b-4194626e691e'
215
+    share_server_id: 'test-dhss-false-427f-b4de-0ad83el5j8'
216
+    id: 'cb532599-8dc6-4c3e-bb21-74ea54be566c'
217
+    size: 1
218
+    user_id: '19bbda71b578471a93363653dcb4c61d'
219
+    status: 'creating'
220
+    share_type_id: '57679eab-3e67-4052-b180-62b609670e93'
221
+    host: 'openstack@VNX#Pool_2'
222
+    display_name: 'nfs_share'
223
+    share_proto: 'NFS'
224
+    export_locations: []
225
+    is_public: False
226
+
191 227
 shrink_cifs_share:
192 228
   _type: 'share'
193 229
   _properties: &shrink_cifs_share_prop

+ 52
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/mocked_unity.yaml View File

@@ -190,6 +190,9 @@ unity_base: &unity_base
190 190
 test_connect: &test_connect
191 191
   unity: *unity_base
192 192
 
193
+test_dhss_false_connect: &test_dhss_false_connect
194
+  unity: *unity_base
195
+
193 196
 test_connect__invalid_sp_configuration:
194 197
   unity:
195 198
     _methods:
@@ -247,6 +250,55 @@ test_create_cifs_share:
247 250
         _side_effect: [*pool__test_create_cifs_share]
248 251
       get_nas_server: *nas_server
249 252
 
253
+test_dhss_false_create_nfs_share:
254
+  nfs_share: &nfs_share__test_dhss_false_create_nfs_share
255
+    _properties:
256
+      <<: *nfs_share_base_prop
257
+      name: 'cb532599-8dc6-4c3e-bb21-74ea54be566c'
258
+
259
+  pool: &pool__test_dhss_false_create_nfs_share
260
+    _properties:
261
+      <<: *pool_base_prop
262
+      name: 'Pool_2'
263
+    _methods:
264
+      create_nfs_share: None
265
+
266
+  unity:
267
+    _methods:
268
+      <<: *unity_base_method
269
+      get_pool:
270
+        _side_effect: [*pool__test_dhss_false_create_nfs_share]
271
+      get_nas_server: *nas_server
272
+
273
+test_dhss_false_create_cifs_share:
274
+  cifs_share: &cifs_share__test_dhss_false_create_cifs_share
275
+    _properties:
276
+      <<: *cifs_share_base_prop
277
+      name: '716100cc-e0b4-416b-ac27-d38dd019330d'
278
+    _methods:
279
+      enable_ace:
280
+
281
+  filesystem: &filesystem__test_dhss_false_create_cifs_share
282
+    _properties: &filesystem_prop__test_dhss_false_create_cifs_share
283
+      <<: *filesystem_base_prop
284
+      name: '716100cc-e0b4-416b-ac27-d38dd4587340'
285
+    _methods:
286
+      create_cifs_share: *cifs_share__test_dhss_false_create_cifs_share
287
+
288
+  pool: &pool__test_dhss_false_create_cifs_share
289
+    _properties:
290
+      <<: *pool_base_prop
291
+      name: 'Pool_2'
292
+    _methods:
293
+      create_filesystem: *filesystem__test_dhss_false_create_cifs_share
294
+
295
+  unity:
296
+    _methods:
297
+      <<: *unity_base_method
298
+      get_pool:
299
+        _side_effect: [*pool__test_dhss_false_create_cifs_share]
300
+      get_nas_server: *nas_server
301
+
250 302
 test_create_share_with_invalid_share_server:
251 303
   pool: &pool__test_create_share_with_invalid_share_server
252 304
     _properties:

+ 6
- 1
manila/tests/share/drivers/dell_emc/plugins/unity/res_mock.py View File

@@ -14,6 +14,7 @@
14 14
 #    under the License.
15 15
 
16 16
 import mock
17
+from oslo_config import cfg
17 18
 from oslo_log import log
18 19
 
19 20
 from manila.share import configuration as conf
@@ -34,6 +35,7 @@ SYMBOL_PROPERTIES = '_properties'
34 35
 SYMBOL_METHODS = '_methods'
35 36
 SYMBOL_SIDE_EFFECT = '_side_effect'
36 37
 SYMBOL_RAISE = '_raise'
38
+CONF = cfg.CONF
37 39
 
38 40
 
39 41
 def _has_side_effect(node):
@@ -84,7 +86,9 @@ def fake_access(**kwargs):
84 86
 
85 87
 
86 88
 class FakeEMCShareDriver(object):
87
-    def __init__(self):
89
+    def __init__(self, dhss=None):
90
+        if dhss in (True, False):
91
+            CONF.set_default('driver_handles_share_servers', dhss)
88 92
         self.configuration = conf.Configuration(None)
89 93
         self.configuration.emc_share_backend = 'unity'
90 94
         self.configuration.emc_nas_server = '192.168.1.1'
@@ -258,6 +262,7 @@ unity_res = StorageResourceMock('mocked_unity.yaml')
258 262
 STORAGE_RES_MAPPING = {
259 263
     'TestClient': unity_res,
260 264
     'TestConnection': unity_res,
265
+    'TestConnectionDHSSFalse': unity_res,
261 266
 }
262 267
 
263 268
 

+ 43
- 1
manila/tests/share/drivers/dell_emc/plugins/unity/test_connection.py View File

@@ -36,7 +36,7 @@ class TestConnection(test.TestCase):
36 36
 
37 37
     @res_mock.patch_connection_init
38 38
     def test_connect(self, connection):
39
-        connection.connect(res_mock.FakeEMCShareDriver(), None)
39
+        connection.connect(res_mock.FakeEMCShareDriver(dhss=True), None)
40 40
 
41 41
     @res_mock.patch_connection
42 42
     def test_connect__invalid_pool_configuration(self, connection):
@@ -692,3 +692,45 @@ class TestConnection(test.TestCase):
692 692
 
693 693
         connection.revert_to_snapshot(context, snapshot, share_access_rules,
694 694
                                       snapshot_access_rules)
695
+
696
+    @res_mock.patch_connection_init
697
+    def test_dhss_false_connect_without_nas_server(self, connection):
698
+        self.assertRaises(exception.BadConfigurationException,
699
+                          connection.connect,
700
+                          res_mock.FakeEMCShareDriver(dhss=False), None)
701
+
702
+    @res_mock.mock_manila_input
703
+    @res_mock.patch_connection
704
+    def test_dhss_false_create_nfs_share(self, connection, mocked_input):
705
+        connection.driver_handles_share_servers = False
706
+        connection.unity_share_server = 'test-dhss-false-427f-b4de-0ad83el5j8'
707
+        share = mocked_input['dhss_false_nfs_share']
708
+        share_server = mocked_input['share_server']
709
+
710
+        location = connection.create_share(None, share, share_server)
711
+
712
+        exp_location = [
713
+            {'path': 'fake_ip_addr_1:/cb532599-8dc6-4c3e-bb21-74ea54be566c'},
714
+            {'path': 'fake_ip_addr_2:/cb532599-8dc6-4c3e-bb21-74ea54be566c'},
715
+        ]
716
+        exp_location = sorted(exp_location, key=lambda x: sorted(x['path']))
717
+        location = sorted(location, key=lambda x: sorted(x['path']))
718
+        self.assertEqual(exp_location, location)
719
+
720
+    @res_mock.mock_manila_input
721
+    @res_mock.patch_connection
722
+    def test_dhss_false_create_cifs_share(self, connection, mocked_input):
723
+        connection.driver_handles_share_servers = False
724
+        connection.unity_share_server = 'test-dhss-false-427f-b4de-0ad83el5j8'
725
+        share = mocked_input['dhss_false_cifs_share']
726
+        share_server = mocked_input['share_server']
727
+
728
+        location = connection.create_share(None, share, share_server)
729
+
730
+        exp_location = [
731
+            {'path': r'\\fake_ip_addr_1\716100cc-e0b4-416b-ac27-d38dd019330d'},
732
+            {'path': r'\\fake_ip_addr_2\716100cc-e0b4-416b-ac27-d38dd019330d'},
733
+        ]
734
+        exp_location = sorted(exp_location, key=lambda x: sorted(x['path']))
735
+        location = sorted(location, key=lambda x: sorted(x['path']))
736
+        self.assertEqual(exp_location, location)

+ 4
- 0
releasenotes/notes/unity-un-handles-share-server-mode-support-e179c092ab148948.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - Dell EMC Unity Manila driver now supports the mode in which it does
4
+    not itself create and destroy share servers (DHSS=False).

Loading…
Cancel
Save