# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Generic Solaris Fibre Channel utilities."""
import os
import platform
import time
import oslo_i18n
"""Get Fibre Channel HBA information."""
out = None
try:
return None
if out is None:
return None
hbas = []
hba = {}
# Collect the following hba-port data:
# 1: Port WWN
# 2: State (online|offline)
# 3: Node WWN
# New HBA port entry
hba = {}
continue
# Skip Target mode ports
if mode != 'Initiator':
break
continue
continue
hba = {}
return hbas
"""Get Fibre Channel WWNNs from the system, if any."""
if hbas is None:
return None
wwnns = []
return wwnns
"""Get Fibre Channel WWPNs from the system, if any."""
if hbas is None:
return None
wwpns = []
return wwpns
"""Force the link reinitialization to make the LUN present."""
"""Get the Device path for the specified LUN.
The output of CMD below is like this:
OS Device Name: /dev/rdsk/c0t600C0FF0000000000036223AE73EB705d0s2
HBA Port WWN: 210100e08b27a8a1
Remote Port WWN: 256000c0ffc03622
LUN: 0
Remote Port WWN: 216000c0ff803622
LUN: 0
HBA Port WWN: 210000e08b07a8a1
Remote Port WWN: 256000c0ffc03622
LUN: 0
Remote Port WWN: 216000c0ff803622
LUN: 0
Vendor: SUN
Product: StorEdge 3510
Device Type: Disk device
......
"""
try:
return None
host_device = None
remote_port = None
if out is not None:
return host_device
return None
"""Attach the volume to instance_name.
connection_properties for Fibre Channel must include:
target_wwn - Specified port WWNs
target_lun - LUN id of the volume
"""
wwns = []
else:
# The scsi_vhci disk node is not always present immediately.
# Sometimes we need to reinitialize the connection to trigger
# a refresh.
# initiator needs time to refresh the LU list
break
else:
else:
msg = _("Fibre Channel volume device not found.")
# Set the label EFI to the disk on SPARC before it is accessed and
# make sure the correct device path with slice 0
# (like '/dev/rdsk/c0t600xxxd0s0').
return device_info