connector – Connector

connector – Connector

Brick Connector objects for each supported transport protocol.

The connectors here are responsible for discovering and removing volumes for each of the supported transport protocols.

class os_brick.initiator.connector.InitiatorConnector
static factory(protocol, root_helper, driver=None, use_multipath=False, device_scan_attempts=3, arch=None, *args, **kwargs)

Build a Connector object based upon protocol and architecture.

class os_brick.initiator.connector.ISCSIConnector(root_helper, driver=None, execute=None, use_multipath=False, device_scan_attempts=3, transport='default', *args, **kwargs)

Connector class to attach/detach iSCSI volumes.

connect_volume(*args, **kwargs)

Attach the volume to instance_name.

NOTE: Will retry up to three times to handle the case where c-vol and n-cpu are both using os-brick to manage iSCSI sessions but they are on the same node and using different locking directories. In this case, even though this call is synchronized, they will be separate locks and can still overlap with connect and disconnect. Since a disconnect during an initial attach can’t cause IO failure (the device has not been made available yet), we just try the connection again.

Parameters:connection_properties (dict) – The valid dictionary that describes all of the target volume attributes.
Returns:dict

connection_properties for iSCSI must include: target_portal(s) - ip and optional port target_iqn(s) - iSCSI Qualified Name target_lun(s) - LUN id of the volume Note that plural keys may be used when use_multipath=True

disconnect_volume(*args, **kwargs)

Detach the volume from instance_name.

Parameters:
  • connection_properties (dict that must include: target_portal(s) - IP and optional port target_iqn(s) - iSCSI Qualified Name target_lun(s) - LUN id of the volume) – The dictionary that describes all of the target volume attributes.
  • device_info (dict) – historical difference, but same as connection_props
  • force (bool) – Whether to forcefully disconnect even if flush fails.
  • ignore_errors (bool) – When force is True, this will decide whether to ignore errors or raise an exception once finished the operation. Default is False.
class os_brick.initiator.connector.FibreChannelConnector(root_helper, driver=None, execute=None, use_multipath=False, device_scan_attempts=3, *args, **kwargs)

Connector class to attach/detach Fibre Channel volumes.

connect_volume(*args, **kwargs)

Attach the volume to instance_name.

Parameters:connection_properties (dict) – The dictionary that describes all of the target volume attributes.
Returns:dict

connection_properties for Fibre Channel must include: target_wwn - World Wide Name target_lun - LUN id of the volume

disconnect_volume(*args, **kwargs)

Detach the volume from instance_name.

Parameters:
  • connection_properties (dict) – The dictionary that describes all of the target volume attributes.
  • device_info (dict) – historical difference, but same as connection_props

connection_properties for Fibre Channel must include: target_wwn - World Wide Name target_lun - LUN id of the volume

class os_brick.initiator.connector.AoEConnector(root_helper, driver=None, device_scan_attempts=3, *args, **kwargs)

Connector class to attach/detach AoE volumes.

connect_volume(*args, **kwargs)

Discover and attach the volume.

Parameters:connection_properties (dict) – The dictionary that describes all of the target volume attributes.
Returns:dict

connection_properties for AoE must include: target_shelf - shelf id of volume target_lun - lun id of volume

disconnect_volume(*args, **kwargs)

Detach and flush the volume.

Parameters:
  • connection_properties (dict) – The dictionary that describes all of the target volume attributes.
  • device_info (dict) – historical difference, but same as connection_props

connection_properties for AoE must include: target_shelf - shelf id of volume target_lun - lun id of volume

class os_brick.initiator.connector.LocalConnector(root_helper, driver=None, *args, **kwargs)

“Connector class to attach/detach File System backed volumes.

connect_volume(*args, **kwargs)

Connect to a volume.

Parameters:connection_properties (dict) –

The dictionary that describes all of the target volume attributes. connection_properties must include:

  • device_path - path to the volume to be connected
Returns:dict
disconnect_volume(*args, **kwargs)

Disconnect a volume from the local host.

Parameters:
  • connection_properties (dict) – The dictionary that describes all of the target volume attributes.
  • device_info (dict) – historical difference, but same as connection_props
class os_brick.initiator.connector.HuaweiStorHyperConnector(root_helper, driver=None, *args, **kwargs)

“Connector class to attach/detach SDSHypervisor volumes.

connect_volume(*args, **kwargs)

Connect to a volume.

Parameters:connection_properties (dict) – The dictionary that describes all of the target volume attributes.
Returns:dict
disconnect_volume(*args, **kwargs)

Disconnect a volume from the local host.

Parameters:
  • connection_properties (dict) – The dictionary that describes all of the target volume attributes.
  • device_info (dict) – historical difference, but same as connection_props
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.