From: Alan Jiang Date: Tue, 1 Oct 2013 05:38:03 +0000 (-0500) Subject: Storwize SVC driver hostname can't start with number X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a9b51ea8421939ddc1d9a964dd58a1067fc2a167;p=openstack-build%2Fcinder-build.git Storwize SVC driver hostname can't start with number 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 --- diff --git a/cinder/volume/drivers/storwize_svc.py b/cinder/volume/drivers/storwize_svc.py index ef6cb3d41..16a458b83 100644 --- a/cinder/volume/drivers/storwize_svc.py +++ b/cinder/volume/drivers/storwize_svc.py @@ -482,6 +482,11 @@ class StorwizeSVCDriver(san.SanDriver): 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):