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
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
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)
#
"""
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
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.
# 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()
# 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
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__)
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):
# 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
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
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):