From a9b51ea8421939ddc1d9a964dd58a1067fc2a167 Mon Sep 17 00:00:00 2001 From: Alan Jiang Date: Tue, 1 Oct 2013 00:38:03 -0500 Subject: [PATCH] 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 --- cinder/volume/drivers/storwize_svc.py | 5 +++++ 1 file changed, 5 insertions(+) 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): -- 2.45.2