From d43677b26218b9eb6f1fe65423afcefb680149fe Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Mon, 14 Oct 2019 16:44:09 +0200 Subject: [PATCH] Update FC connection_properties examples This patch updates the FC examples that we have in the code in the connect_volume method docstring to reflect the support of different target luns and the new enable_wildcard_scan key. TrivialFix Change-Id: I21950f0f0f3b30dfd2c3baa156af8dda1633b8ea --- os_brick/initiator/initiator_connector.py | 32 ++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/os_brick/initiator/initiator_connector.py b/os_brick/initiator/initiator_connector.py index 3f475e862..1ffc21793 100644 --- a/os_brick/initiator/initiator_connector.py +++ b/os_brick/initiator/initiator_connector.py @@ -86,13 +86,12 @@ class InitiatorConnector(executor.Executor): 'access_mode': 'rw', }} - An example for fibre_channel: + An example for fibre_channel with single lun: {'driver_volume_type': 'fibre_channel', 'data': { - 'initiator_target_map': {'100010604b010459': ['21230002AC00383D'], - '100010604b01045d': ['21230002AC00383D'] - }, + 'initiator_target_map': {'100010604b010459': ['20210002AC00383D'], + '100010604b01045d': ['20220002AC00383D']}, 'target_discovered': True, 'encrypted': False, 'qos_specs': None, @@ -104,6 +103,31 @@ class InitiatorConnector(executor.Executor): ], }} + An example for fibre_channel target_wwns and with different LUNs and + all host ports mapped to target ports: + + {'driver_volume_type': 'fibre_channel', + 'data': { + 'initiator_target_map': { + '100010604b010459': ['20210002AC00383D', '20220002AC00383D'], + '100010604b01045d': ['20210002AC00383D', '20220002AC00383D'] + }, + 'target_discovered': True, + 'encrypted': False, + 'qos_specs': None, + 'target_luns': [1, 2], + 'access_mode': 'rw', + 'target_wwns': ['20210002AC00383D', '20220002AC00383D'], + }} + + For FC the dictionary could also present the enable_wildcard_scan key + with a boolean value (defaults to True) in case a driver doesn't want + OS-Brick to use a SCSI scan with wildcards when the FC initiator on + the host doesn't find any target port. + + This is useful for drivers that know that sysfs gets populated + whenever there's a connection between the host's HBA and the storage + array's target ports. :param connection_properties: The dictionary that describes all of the target volume attributes.