I have a new Cisco fabric switch with no zone created switch configuration file.
When I attach a fiber channel volume to the instance, Cisco FC zone driver do not add the zone.
But when I attach a fiber channel volume to the instance using the Brocade fabric switch,
the zone is added successfully.
E:\cinder-master\cinder\zonemanager\drivers\cisco\cisco_fc_zone_driver.py
add_connection(self, fabric, initiator_target_map):
I note that there is a check in this function. If there is no zone configured in
this switch before, Cisco zone driver will not add the new zone just print a log.
'Zoning session exists VSAN: %s'. But Brocade zone driver do not have this restriction.
Zones can be added successfully
I think Cisco zone driver should be consistent with Brocade zone driver.
def add_connection(self, fabric, initiator_target_map):
"""Concrete implementation of add_connection.
Based on zoning policy and state of each I-T pair, list of zone
members are created and pushed to the fabric to add zones. The
new zones created or zones updated are activated based on isActivate
flag set in cinder.conf returned by volume driver after attach
operation.
:param fabric: Fabric name from cinder.conf file
:param initiator_target_map: Mapping of initiator to list of targets
"""
LOG.debug("Add connection for Fabric: %s", fabric)
LOG.info(_LI("CiscoFCZoneDriver - Add connection "
"for I-T map: %s"), initiator_target_map)
fabric_ip = self.fabric_configs[fabric].safe_get(
'cisco_fc_fabric_address')
fabric_user = self.fabric_configs[fabric].safe_get(
'cisco_fc_fabric_user')
fabric_pwd = self.fabric_configs[fabric].safe_get(
'cisco_fc_fabric_password')
fabric_port = self.fabric_configs[fabric].safe_get(
'cisco_fc_fabric_port')
zoning_policy = self.configuration.zoning_policy
zoning_policy_fab = self.fabric_configs[fabric].safe_get(
'cisco_zoning_policy')
if zoning_policy_fab:
zoning_policy = zoning_policy_fab
zoning_vsan = self.fabric_configs[fabric].safe_get('cisco_zoning_vsan')
LOG.info(_LI("Zoning policy for Fabric %s"), zoning_policy)
statusmap_from_fabric = self.get_zoning_status(
fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)
if statusmap_from_fabric.get('session') == 'none':
cfgmap_from_fabric = self.get_active_zone_set(
fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)
zone_names = []
if cfgmap_from_fabric.get('zones'):---------------------- check here
zone_names = cfgmap_from_fabric['zones'].keys()
...................................
...................................
LOG.debug("Zones added successfully: %s", zone_map)
else:
LOG.debug("Zoning session exists VSAN: %s", zoning_vsan)
Log:
2015-09-07T16:35:40.891+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_client_cli.py:324 _get_switch_info] CLI output from ssh - output: VSAN 81: -------------------------------------------------------------------------- FCID TYPE PWWN (VENDOR) FC4-TYPE:FEATURE -------------------------------------------------------------------------- 0x580000 N 20:08:48:46:fb:90:06:6f scsi-fcp:target 0x580100 N 21:00:00:24:ff:55:85:b0 scsi-fcp:init 0x580200 N 22:11:9c:37:f4:96:b9:f6 scsi-fcp:both Total number of entries = 3
2015-09-07T16:35:40.891+08:00 localhost cinder-volume INFO [pid:26697] [GreenThread-25] [cisco_fc_zone_client_cli.py:312 get_nameserver_info] Connector returning fcnsinfo-[u'20:08:48:46:fb:90:06:6f', u'21:00:00:24:ff:55:85:b0', u'22:11:9c:37:f4:96:b9:f6']
2015-09-07T16:35:40.892+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:417 get_san_context] show fcns database info from fabric:[u'20:08:48:46:fb:90:06:6f', u'21:00:00:24:ff:55:85:b0', u'22:11:9c:37:f4:96:b9:f6']
2015-09-07T16:35:40.991+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] EOF in transport thread
2015-09-07T16:35:41.006+08:00 localhost cinder-volume INFO [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:433 get_san_context] Filtered targets for SAN is: {'fabric2': [u'20:08:48:46:fb:90:06:6f']}
2015-09-07T16:35:41.006+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:442 get_san_context] Return SAN context output:{'fabric2': [u'20084846fb90066f']}
2015-09-07T16:35:41.007+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [fc_zone_manager.py:211 get_san_context] Got SAN context:{'fabric2': [u'20084846fb90066f']}
2015-09-07T16:35:41.007+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [fc_zone_manager.py:133 add_connection] Fabric Map after context lookup:{'fabric2': [u'20084846fb90066f']}
2015-09-07T16:35:41.007+08:00 localhost cinder-volume INFO [pid:26697] [GreenThread-25] [fc_zone_manager.py:143 add_connection] Final filtered map for fabric: {'fabric2': {u'21000024ff5585b0': [u'20084846fb90066f']}}
2015-09-07T16:35:41.008+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [lockutils.py:191 inner] Got semaphore "cisco" for method "add_connection"...
2015-09-07T16:35:41.009+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [lockutils.py:202 inner] Attempting to grab file lock "cisco" for method "add_connection"...
2015-09-07T16:35:41.009+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [lockutils.py:232 inner] Got file lock "cisco" at /etc/cinder/locks/cinder-volume/fcfabric-cisco for method "add_connection"...
2015-09-07T16:35:41.010+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:125 add_connection] Add connection for Fabric:fabric2
2015-09-07T16:35:41.010+08:00 localhost cinder-volume INFO [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:127 add_connection] CiscoFCZoneDriver - Add connection for I-T map: {u'21000024ff5585b0': [u'20084846fb90066f']}
2015-09-07T16:35:41.011+08:00 localhost cinder-volume INFO [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:144 add_connection] Zoning policy for Fabric initiator
2015-09-07T16:35:41.012+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:475 get_zoning_status] Southbound connector: cinder.zonemanager.drivers.cisco.cisco_fc_zone_client_cli.CiscoFCZoneClientCLI
2015-09-07T16:35:41.012+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [ssh_utils.py:90 __init__] Setting strict_ssh_host_key_policy to 'False' using ssh_hosts_key_file '/etc/cinder//ssh_known_hosts'.
2015-09-07T16:35:41.014+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] starting thread (client mode): 0x40429d0L
2015-09-07T16:35:41.445+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Connected (version 2.0, client OpenSSH_5.9)
2015-09-07T16:35:41.446+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] kex algos:[u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc', <email address hidden>', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr'] server encrypt:[u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc', <email address hidden>', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr'] client mac:[u'hmac-sha1', u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client compress:[u'none', <email address hidden>'] server compress:[u'none', <email address hidden>'] client lang:[u''] server lang:[u''] kex follows?False
2015-09-07T16:35:41.446+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
2015-09-07T16:35:41.446+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
2015-09-07T16:35:41.548+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] Switch to new keys ...
2015-09-07T16:35:41.585+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] userauth is OK
2015-09-07T16:35:41.677+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Auth banner: User Access Verification
2015-09-07T16:35:41.681+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [processutils.py:246 ssh_execute] Running cmd (SSH): show zone status vsan 81
2015-09-07T16:35:41.681+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [channel.py:1067 _log] [chan 1] Max packet in: 34816 bytes
2015-09-07T16:35:41.682+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] Max packet out: 32768 bytes
2015-09-07T16:35:41.682+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Secsh channel 1 opened.
2015-09-07T16:35:41.690+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] Sesch channel 1 request ok
2015-09-07T16:35:42.380+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] EOF received (1)
2015-09-07T16:35:42.385+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] EOF sent (1)
2015-09-07T16:35:42.385+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [processutils.py:270 ssh_execute] Result was 0
2015-09-07T16:35:42.385+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_client_cli.py:324 _get_switch_info] CLI output from ssh - output:VSAN: 81 default-zone: deny distribute: active only Interop: default mode: basic merge-control: allow session: none hard-zoning: enabled broadcast: unsupported smart-zoning: disabled rscn-format: fabric-address Default zone: qos: none broadcast: unsupported ronly: unsupported Full Zoning Database : DB size: 4 bytes Zonesets:0 Zones:0 Aliases: 0 Active Zoning Database : Database Not Available Status:
2015-09-07T16:35:42.485+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] EOF in transport thread
2015-09-07T16:35:42.499+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:487 get_zoning_status] Zoneset status from fabric: {'session': u'none', 'mode': u'basic'}
2015-09-07T16:35:42.500+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:453 get_active_zone_set] Southbound connector: cinder.zonemanager.drivers.cisco.cisco_fc_zone_client_cli.CiscoFCZoneClientCLI
2015-09-07T16:35:42.500+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [ssh_utils.py:90 __init__] Setting strict_ssh_host_key_policy to 'False' using ssh_hosts_key_file '/etc/cinder//ssh_known_hosts'.
2015-09-07T16:35:42.505+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] starting thread (client mode): 0x403af50L
2015-09-07T16:35:42.980+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Connected (version 2.0, client OpenSSH_5.9)
2015-09-07T16:35:42.981+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] kex algos:[u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc', <email address hidden>', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr'] server encrypt:[u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc', <email address hidden>', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr'] client mac:[u'hmac-sha1', u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client compress:[u'none', <email address hidden>'] server compress:[u'none', <email address hidden>'] client lang:[u''] server lang:[u''] kex follows?False
2015-09-07T16:35:42.981+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
2015-09-07T16:35:42.981+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
2015-09-07T16:35:43.083+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] Switch to new keys ...
2015-09-07T16:35:43.122+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] userauth is OK
2015-09-07T16:35:43.248+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Auth banner: User Access Verification
2015-09-07T16:35:43.277+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [processutils.py:246 ssh_execute] Running cmd (SSH): show zoneset active vsan 81 | no-more
2015-09-07T16:35:43.277+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [channel.py:1067 _log] [chan 1] Max packet in: 34816 bytes
2015-09-07T16:35:43.278+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] Max packet out: 32768 bytes
2015-09-07T16:35:43.279+08:00 localhost cinder-volume INFO [pid:26697] [MainThread] [transport.py:1271 _log] Secsh channel 1 opened.
2015-09-07T16:35:43.298+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] Sesch channel 1 request ok
2015-09-07T16:35:43.821+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] EOF received (1)
2015-09-07T16:35:43.825+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [channel.py:1067 _log] [chan 1] EOF sent (1)
2015-09-07T16:35:43.826+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [processutils.py:270 ssh_execute] Result was 0
2015-09-07T16:35:43.826+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_client_cli.py:324 _get_switch_info] CLI output from ssh - output:Zoneset not present
2015-09-07T16:35:43.926+08:00 localhost cinder-volume DEBUG [pid:26697] [MainThread] [transport.py:1271 _log] EOF in transport thread
2015-09-07T16:35:43.940+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:465 get_active_zone_set] Active zone set from fabric: {'zones': {}, 'active_zone_config': None}
2015-09-07T16:35:43.941+08:00 localhost cinder-volume DEBUG [pid:26697] [GreenThread-25] [cisco_fc_zone_driver.py:226 add_connection] Zoning session exists VSAN: 81
I made a fix to the add_connection so that it has the similar logic as in the Brocade's code. Sent the code change to the submitter to try.