Skip to content

Commit

Permalink
Storwize SVC driver hostname can't start with number
Browse files Browse the repository at this point in the history
Storwize family storage does not allow host identifier start with
a numeric number. Otherwise cinder initialize_connection() API will
throw exception due to such invalid host name in the connector. The fix
is to add a '_' symbol as prefix if the host identifier in connector
starts with non-alphabet letters.

Closes-Bug: #1233952
Change-Id: Ia88afc373e2635c10c3f6256331a4fd90f51f4b8
  • Loading branch information
Alan Jiang committed Oct 2, 2013
1 parent a2673b0 commit a9b51ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cinder/volume/drivers/storwize_svc.py
Expand Up @@ -482,6 +482,11 @@ def _connector_to_hostname_prefix(self, connector):
raise exception.NoValidHost(reason=msg)

host_name = str(host_name)

# Storwize family doesn't like hostname that starts with number.
if not re.match('^[A-Za-z]', host_name):
host_name = '_' + host_name

return host_name[:55]

def _find_host_from_wwpn(self, connector):
Expand Down

0 comments on commit a9b51ea

Please sign in to comment.