From 141d9a1db1d523eff6e3310ece0d65c9aa51ee30 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Fri, 2 Aug 2013 14:22:27 -0700 Subject: [PATCH] Update driver version to 1.1 This patch includes bumping the driver versions for both Fibre Channel and iSCSI to 1.1. Included a history change that describes the changes since 1.0. This patch also changes the way we do clone volume. We no longer have to check the status of the volume clone on the 3par as it's instantly done now since 3.1.2 MU2 firmware. Change-Id: I541ac7f97e6d1290bac6232d6c80e8ecf3a75dda --- cinder/tests/test_hp3par.py | 20 ------------ .../volume/drivers/san/hp/hp_3par_common.py | 31 ++----------------- cinder/volume/drivers/san/hp/hp_3par_fc.py | 10 +++--- cinder/volume/drivers/san/hp/hp_3par_iscsi.py | 8 +++-- 4 files changed, 13 insertions(+), 56 deletions(-) diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 26eb9c970..9e6935382 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -637,8 +637,6 @@ class TestHP3PARFCDriver(HP3PARBaseDriver, test.TestCase): def test_create_cloned_volume(self): self.flags(lock_path=self.tempdir) - self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_get_volume_state", - self.fake_get_volume_state) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_copy_volume", self.fake_copy_volume) self.state_tries = 0 @@ -843,8 +841,6 @@ class TestHP3PARISCSIDriver(HP3PARBaseDriver, test.TestCase): def test_create_cloned_volume(self): self.flags(lock_path=self.tempdir) - self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_get_volume_state", - self.fake_get_volume_state) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_copy_volume", self.fake_copy_volume) self.state_tries = 0 @@ -963,22 +959,6 @@ class TestHP3PARISCSIDriver(HP3PARBaseDriver, test.TestCase): host = self.driver._create_host(self.volume, self.connector) self.assertEqual(host['name'], self.FAKE_HOST) - def test_get_volume_state(self): - self.flags(lock_path=self.tempdir) - - #record - self.clear_mox() - _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) - self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _run_ssh) - - show_vv_cmd = ('showvv -state ' - 'volume-d03338a9-9115-48a3-8dfc-35cdfcdc15a7') - _run_ssh(show_vv_cmd, False).AndReturn([pack(VOLUME_STATE_RET), '']) - self.mox.ReplayAll() - - status = self.driver.common._get_volume_state(self.VOLUME_NAME) - self.assertEqual(status, 'normal') - def test_get_ports(self): self.flags(lock_path=self.tempdir) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 14e7e327b..da64e474d 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -19,7 +19,8 @@ # """ Volume driver common utilities for HP 3PAR Storage array -The 3PAR drivers requires 3.1.2 firmware on the 3PAR array. + +The 3PAR drivers requires 3.1.2 MU2 firmware on the 3PAR array. You will need to install the python hp3parclient. sudo pip install hp3parclient @@ -786,16 +787,6 @@ exit def _copy_volume(self, src_name, dest_name): self._cli_run('createvvcopy -p %s %s' % (src_name, dest_name), None) - def _get_volume_state(self, vol_name): - out = self._cli_run('showvv -state %s' % vol_name, None) - status = None - if out: - # out[0] is the header - info = out[1].split(',') - status = info[5] - - return status - def get_next_word(self, s, search_string): """Return the next word. @@ -827,24 +818,6 @@ exit # can't delete the original until the copy is done. self._copy_volume(orig_name, vol_name) - # this can take a long time to complete - done = False - while not done: - status = self._get_volume_state(vol_name) - if status == 'normal': - done = True - elif status == 'copy_target': - LOG.debug("3Par still copying %s => %s" - % (orig_name, vol_name)) - else: - msg = _("Unexpected state while cloning %s") % status - LOG.warn(msg) - raise exception.CinderException(msg) - - if not done: - # wait 5 seconds between tests - time.sleep(5) - return new_vol except hpexceptions.HTTPForbidden: raise exception.NotAuthorized() diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 29f7be903..0553ae6f0 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -18,8 +18,8 @@ # under the License. # """ -Volume driver for HP 3PAR Storage array. This driver requires 3.1.2 firmware -on the 3PAR array. +Volume driver for HP 3PAR Storage array. +This driver requires 3.1.2 MU2 firmware on the 3PAR array. You will need to install the python hp3parclient. sudo pip install hp3parclient @@ -40,7 +40,7 @@ import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san -VERSION = 1.0 +VERSION = 1.1 LOG = logging.getLogger(__name__) @@ -49,7 +49,9 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver): Version history: 1.0 - Initial driver - + 1.1 - QoS, extend volume, multiple iscsi ports, remove domain, + session changes, faster clone, requires 3.1.2 MU2 firmware, + copy volume <--> Image. """ def __init__(self, *args, **kwargs): diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index fc4602855..48db1bee7 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -18,8 +18,8 @@ # under the License. # """ -Volume driver for HP 3PAR Storage array. This driver requires 3.1.2 firmware -on the 3PAR array. +Volume driver for HP 3PAR Storage array. +This driver requires 3.1.2 MU2 firmware on the 3PAR array. You will need to install the python hp3parclient. sudo pip install hp3parclient @@ -41,7 +41,7 @@ import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san -VERSION = 1.0 +VERSION = 1.1 LOG = logging.getLogger(__name__) DEFAULT_ISCSI_PORT = 3260 @@ -51,6 +51,8 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): Version history: 1.0 - Initial driver + 1.1 - QoS, extend volume, multiple iscsi ports, remove domain, + session changes, faster clone, requires 3.1.2 MU2 firmware. """ def __init__(self, *args, **kwargs): -- 2.45.2