Increase the 3PAR hostname length

The latest 3PAR firmware supports a hostname of 31 characters.
This patch increases the hostname on the 3PAR from 23 characters to
31.

The driver currently has a fallback mechanism in place for detecting
existing hosts.   This handles the case where upgrading from
Icehouse to Juno where Icehouse hosts have a limit of 23 characters.

Change-Id: I171e54b2e03a4ae11d2bf07c9c48febab268ce84
Closes-Bug: 1371242
This commit is contained in:
Walter A. Boring IV 2014-09-18 12:03:46 -07:00
parent b35c97cd25
commit 6f74f92e4c
2 changed files with 12 additions and 3 deletions
cinder
tests
volume/drivers/san/hp

@ -27,6 +27,7 @@ from cinder.openstack.common import log as logging
from cinder.openstack.common import units
from cinder import test
from cinder.tests import fake_hp_3par_client as hp3parclient
from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon
from cinder.volume.drivers.san.hp import hp_3par_fc as hpfcdriver
from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver
from cinder.volume import qos_specs
@ -1935,6 +1936,13 @@ class HP3PARBaseDriver(object):
mock_client.assert_has_calls(expected)
def test__safe_hostname(self):
long_hostname = "abc123abc123abc123abc123abc123abc123"
fixed_hostname = "abc123abc123abc123abc123abc123a"
common = hpcommon.HP3PARCommon(None)
safe_host = common._safe_hostname(long_hostname)
self.assertEqual(fixed_hostname, safe_host)
class TestHP3PARFCDriver(HP3PARBaseDriver, test.TestCase):

@ -150,10 +150,11 @@ class HP3PARCommon(object):
2.0.20 - Configurable SSH missing key policy and known hosts file
2.0.21 - Remove bogus invalid snapCPG=None exception
2.0.22 - HP 3PAR drivers should not claim to have 'infinite' space
2.0.23 - Increase the hostname size from 23 to 31 Bug #1371242
"""
VERSION = "2.0.22"
VERSION = "2.0.23"
stats = {}
@ -561,8 +562,8 @@ class HP3PARCommon(object):
index = len(hostname)
# we'll just chop this off for now.
if index > 23:
index = 23
if index > 31:
index = 31
return hostname[:index]