Merge "Rebrand HP XP driver to now be HPE"

This commit is contained in:
Jenkins 2015-12-29 17:49:38 +00:00 committed by Gerrit Code Review
commit c53f24299e
8 changed files with 163 additions and 141 deletions

View File

@ -100,6 +100,8 @@ from cinder.volume.drivers.hpe import hpe_3par_common as \
cinder_volume_drivers_hpe_hpe3parcommon
from cinder.volume.drivers.hpe import hpe_lefthand_iscsi as \
cinder_volume_drivers_hpe_hpelefthandiscsi
from cinder.volume.drivers.hpe import hpe_xp_opts as \
cinder_volume_drivers_hpe_hpexpopts
from cinder.volume.drivers.huawei import huawei_driver as \
cinder_volume_drivers_huawei_huaweidriver
from cinder.volume.drivers.ibm import flashsystem_common as \
@ -134,8 +136,6 @@ from cinder.volume.drivers import pure as cinder_volume_drivers_pure
from cinder.volume.drivers import quobyte as cinder_volume_drivers_quobyte
from cinder.volume.drivers import rbd as cinder_volume_drivers_rbd
from cinder.volume.drivers import remotefs as cinder_volume_drivers_remotefs
from cinder.volume.drivers.san.hp import hp_xp_opts as \
cinder_volume_drivers_san_hp_hpxpopts
from cinder.volume.drivers.san.hp import hpmsa_common as \
cinder_volume_drivers_san_hp_hpmsacommon
from cinder.volume.drivers.san import san as cinder_volume_drivers_san_san
@ -212,9 +212,6 @@ def list_opts():
storwize_svc_iscsi_opts,
cinder_backup_drivers_glusterfs.glusterfsbackup_service_opts,
cinder_backup_drivers_tsm.tsm_opts,
cinder_volume_drivers_san_hp_hpxpopts.FC_VOLUME_OPTS,
cinder_volume_drivers_san_hp_hpxpopts.COMMON_VOLUME_OPTS,
cinder_volume_drivers_san_hp_hpxpopts.HORCM_VOLUME_OPTS,
cinder_test.test_opts,
cinder_volume_drivers_ibm_gpfs.gpfs_opts,
cinder_volume_drivers_violin_v7000common.violin_opts,
@ -306,6 +303,9 @@ def list_opts():
cinder_compute_nova.nova_opts,
cinder_volume_drivers_ibm_flashsystemfc.flashsystem_fc_opts,
cinder_volume_drivers_prophetstor_options.DPL_OPTS,
cinder_volume_drivers_hpe_hpexpopts.FC_VOLUME_OPTS,
cinder_volume_drivers_hpe_hpexpopts.COMMON_VOLUME_OPTS,
cinder_volume_drivers_hpe_hpexpopts.HORCM_VOLUME_OPTS,
cinder_volume_drivers_hitachi_hbsdiscsi.volume_opts,
cinder_volume_manager.volume_manager_opts,
cinder_volume_drivers_nexenta_nexentaedge_iscsi.

View File

@ -21,8 +21,8 @@ from cinder.tests.unit import fake_snapshot
from cinder.tests.unit import fake_volume
from cinder.volume import configuration as conf
from cinder.volume import driver
from cinder.volume.drivers.san.hp import hp_xp_fc
from cinder.volume.drivers.san.hp import hp_xp_opts
from cinder.volume.drivers.hpe import hpe_xp_fc
from cinder.volume.drivers.hpe import hpe_xp_opts
from oslo_config import cfg
from oslo_utils import importutils
@ -35,8 +35,8 @@ EXISTING_POOL_REF = {
}
class HPXPFakeCommon(object):
"""Fake HPXP Common."""
class HPEXPFakeCommon(object):
"""Fake HPEXP Common."""
def __init__(self, conf, storage_protocol, **kwargs):
self.conf = conf
@ -50,8 +50,8 @@ class HPXPFakeCommon(object):
'hba_id': 'wwpns',
'hba_id_type': 'World Wide Name',
'msg_id': {'target': 308},
'volume_backend_name': 'HPXPFC',
'volume_opts': hp_xp_opts.FC_VOLUME_OPTS,
'volume_backend_name': 'HPEXPFC',
'volume_opts': hpe_xp_opts.FC_VOLUME_OPTS,
'volume_type': 'fibre_channel',
}
@ -123,10 +123,10 @@ class HPXPFakeCommon(object):
if refresh:
d = {}
d['volume_backend_name'] = self.driver_info['volume_backend_name']
d['vendor_name'] = 'Hewlett-Packard'
d['driver_version'] = '1.3.0-0_2015.1'
d['vendor_name'] = 'Hewlett Packard Enterprise'
d['driver_version'] = '1.1.0'
d['storage_protocol'] = self.storage_info['protocol']
pool_info = POOL_INFO.get(self.conf.hpxp_pool)
pool_info = POOL_INFO.get(self.conf.hpexp_pool)
if pool_info is None:
return self._stats
d['total_capacity_gb'] = pool_info['total_gb']
@ -231,7 +231,7 @@ class HPXPFakeCommon(object):
del self.volumes[volume['provider_location']]
def get_pool_id(self):
pool = self.conf.hpxp_pool
pool = self.conf.hpexp_pool
if pool.isdigit():
return int(pool)
return None
@ -242,7 +242,7 @@ class HPXPFakeCommon(object):
if self.storage_info['pool_id'] is None:
raise exception.VolumeBackendAPIException(
data='A pool could not be found. (pool: %(pool)s)' %
{'pool': self.conf.hpxp_pool})
{'pool': self.conf.hpexp_pool})
def initialize_connection(self, volume, connector):
ldev = volume.get('provider_location')
@ -306,8 +306,8 @@ class HPXPFakeCommon(object):
pass
class HPXPFCDriverTest(test.TestCase):
"""Test HPXPFCDriver."""
class HPEXPFCDriverTest(test.TestCase):
"""Test HPEXPFCDriver."""
_VOLUME = {'size': 128,
'name': 'test1',
@ -341,22 +341,22 @@ class HPXPFCDriverTest(test.TestCase):
_TOO_BIG_VOLUME_SIZE = 100000
def __init__(self, *args, **kwargs):
super(HPXPFCDriverTest, self).__init__(*args, **kwargs)
super(HPEXPFCDriverTest, self).__init__(*args, **kwargs)
def setUp(self):
self._setup_config()
self._setup_driver()
super(HPXPFCDriverTest, self).setUp()
super(HPEXPFCDriverTest, self).setUp()
def _setup_config(self):
self.configuration = mock.Mock(conf.Configuration)
self.configuration.hpxp_storage_id = "00000"
self.configuration.hpxp_pool = "30"
self.configuration.hpexp_storage_id = "00000"
self.configuration.hpexp_pool = "30"
@mock.patch.object(importutils, 'import_object', return_value=None)
def _setup_driver(self, arg1):
self.driver = hp_xp_fc.HPXPFCDriver(configuration=self.configuration)
self.driver.common = HPXPFakeCommon(self.configuration, 'FC')
self.driver = hpe_xp_fc.HPEXPFCDriver(configuration=self.configuration)
self.driver.common = HPEXPFakeCommon(self.configuration, 'FC')
self.driver.do_setup(None)
# API test cases
@ -495,9 +495,8 @@ class HPXPFCDriverTest(test.TestCase):
self.assertTrue(has_volume)
def test_create_volume_from_snapshot_error_on_non_existing_snapshot(self):
"""Test create_volume_from_snapshot.
"""Test create_volume_from_snapshot is error on non existing snapshot.
Test create_volume_from_snapshot is error on non existing snapshot.
"""
volume2 = fake_volume.fake_db_volume(**self._VOLUME2)
snapshot = fake_snapshot.fake_db_snapshot(**self._TEST_SNAPSHOT)
@ -561,11 +560,11 @@ class HPXPFCDriverTest(test.TestCase):
def test_get_volume_stats(self):
"""Test get_volume_stats."""
rc = self.driver.get_volume_stats(True)
self.assertEqual("Hewlett-Packard", rc['vendor_name'])
self.assertEqual("Hewlett Packard Enterprise", rc['vendor_name'])
def test_get_volume_stats_error_on_non_existing_pool_id(self):
"""Test get_volume_stats is error on non existing pool id."""
self.configuration.hpxp_pool = 29
self.configuration.hpexp_pool = 29
rc = self.driver.get_volume_stats(True)
self.assertEqual({}, rc)
@ -829,7 +828,7 @@ class HPXPFCDriverTest(test.TestCase):
def test_do_setup_error_on_invalid_pool_id(self):
"""Test do_setup is error on invalid pool id."""
self.configuration.hpxp_pool = 'invalid'
self.configuration.hpexp_pool = 'invalid'
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.do_setup, None)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2014, 2015, Hitachi, Ltd.
# Copyright (C) 2014-2015, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -12,26 +12,26 @@
# License for the specific language governing permissions and limitations
# under the License.
"""
Fibre channel Cinder volume driver for Hewlett-Packard storage.
Fibre channel Cinder volume driver for Hewlett Packard Enterprise storage.
"""
from oslo_utils import importutils
from cinder.volume import driver
from cinder.volume.drivers.san.hp import hp_xp_opts as opts
from cinder.volume.drivers.hpe import hpe_xp_opts as opts
from cinder.zonemanager import utils as fczm_utils
_DRIVER_DIR = 'cinder.volume.drivers.san.hp'
_DRIVER_CLASS = 'hp_xp_horcm_fc.HPXPHORCMFC'
_DRIVER_DIR = 'cinder.volume.drivers.hpe'
_DRIVER_CLASS = 'hpe_xp_horcm_fc.HPEXPHORCMFC'
class HPXPFCDriver(driver.FibreChannelDriver):
"""OpenStack Fibre Channel driver to enable HP XP storage."""
class HPEXPFCDriver(driver.FibreChannelDriver):
"""OpenStack Fibre Channel driver to enable HPE XP storage."""
def __init__(self, *args, **kwargs):
"""Initialize the driver."""
super(HPXPFCDriver, self).__init__(*args, **kwargs)
super(HPEXPFCDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(opts.FC_VOLUME_OPTS)
self.configuration.append_config_values(opts.COMMON_VOLUME_OPTS)
@ -80,7 +80,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
Call copy_volume_data() of super class and
carry out original postprocessing.
"""
super(HPXPFCDriver, self).copy_volume_data(
super(HPEXPFCDriver, self).copy_volume_data(
context, src_vol, dest_vol, remote)
self.common.copy_volume_data(context, src_vol, dest_vol, remote)
@ -90,7 +90,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
Call copy_image_to_volume() of super class and
carry out original postprocessing.
"""
super(HPXPFCDriver, self).copy_image_to_volume(
super(HPEXPFCDriver, self).copy_image_to_volume(
context, volume, image_service, image_id)
self.common.copy_image_to_volume(
context, volume, image_service, image_id)
@ -101,7 +101,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
Call restore_backup() of super class and
carry out original postprocessing.
"""
super(HPXPFCDriver, self).restore_backup(
super(HPEXPFCDriver, self).restore_backup(
context, backup, volume, backup_service)
self.common.restore_backup(context, backup, volume, backup_service)
@ -110,7 +110,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
self.common.extend_volume(volume, new_size)
def manage_existing(self, volume, existing_ref):
"""Manage an existing HP XP storage volume.
"""Manage an existing HPE XP storage volume.
existing_ref is a dictionary of the form:
@ -128,7 +128,7 @@ class HPXPFCDriver(driver.FibreChannelDriver):
self.common.unmanage(volume)
def do_setup(self, context):
"""Setup and verify HP XP storage connection."""
"""Setup and verify HPE XP storage connection."""
self.common.do_setup(context)
def ensure_export(self, context, volume):

View File

@ -0,0 +1,116 @@
# Copyright (C) 2015, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""HPE XP driver options."""
from oslo_config import cfg
FC_VOLUME_OPTS = [
cfg.BoolOpt(
'hpexp_zoning_request',
default=False,
help='Request for FC Zone creating host group',
deprecated_name='hpxp_zoning_request'),
]
COMMON_VOLUME_OPTS = [
cfg.StrOpt(
'hpexp_storage_cli',
help='Type of storage command line interface',
deprecated_name='hpxp_storage_cli'),
cfg.StrOpt(
'hpexp_storage_id',
help='ID of storage system',
deprecated_name='hpxp_storage_id'),
cfg.StrOpt(
'hpexp_pool',
help='Pool of storage system',
deprecated_name='hpxp_pool'),
cfg.StrOpt(
'hpexp_thin_pool',
help='Thin pool of storage system',
deprecated_name='hpxp_thin_pool'),
cfg.StrOpt(
'hpexp_ldev_range',
help='Logical device range of storage system',
deprecated_name='hpxp_ldev_range'),
cfg.StrOpt(
'hpexp_default_copy_method',
default='FULL',
help='Default copy method of storage system. '
'There are two valid values: "FULL" specifies that a full copy; '
'"THIN" specifies that a thin copy. Default value is "FULL"',
deprecated_name='hpxp_default_copy_method'),
cfg.IntOpt(
'hpexp_copy_speed',
default=3,
help='Copy speed of storage system',
deprecated_name='hpxp_copy_speed'),
cfg.IntOpt(
'hpexp_copy_check_interval',
default=3,
help='Interval to check copy',
deprecated_name='hpxp_copy_check_interval'),
cfg.IntOpt(
'hpexp_async_copy_check_interval',
default=10,
help='Interval to check copy asynchronously',
deprecated_name='hpxp_async_copy_check_interval'),
cfg.ListOpt(
'hpexp_target_ports',
help='Target port names for host group or iSCSI target',
deprecated_name='hpxp_target_ports'),
cfg.ListOpt(
'hpexp_compute_target_ports',
help=(
'Target port names of compute node '
'for host group or iSCSI target'),
deprecated_name='hpxp_compute_target_ports'),
cfg.BoolOpt(
'hpexp_group_request',
default=False,
help='Request for creating host group or iSCSI target',
deprecated_name='hpxp_group_request'),
]
HORCM_VOLUME_OPTS = [
cfg.ListOpt(
'hpexp_horcm_numbers',
default=["200", "201"],
help='Instance numbers for HORCM',
deprecated_name='hpxp_horcm_numbers'),
cfg.StrOpt(
'hpexp_horcm_user',
help='Username of storage system for HORCM',
deprecated_name='hpxp_horcm_user'),
cfg.BoolOpt(
'hpexp_horcm_add_conf',
default=True,
help='Add to HORCM configuration',
deprecated_name='hpxp_horcm_add_conf'),
cfg.StrOpt(
'hpexp_horcm_resource_name',
default='meta_resource',
help='Resource group name of storage system for HORCM',
deprecated_name='hpxp_horcm_resource_name'),
cfg.BoolOpt(
'hpexp_horcm_name_only_discovery',
default=False,
help='Only discover a specific name of host group or iSCSI target',
deprecated_name='hpxp_horcm_name_only_discovery'),
]
CONF = cfg.CONF
CONF.register_opts(FC_VOLUME_OPTS)
CONF.register_opts(COMMON_VOLUME_OPTS)
CONF.register_opts(HORCM_VOLUME_OPTS)

View File

@ -1,98 +0,0 @@
# Copyright (C) 2015, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""HP XP driver options."""
from oslo_config import cfg
FC_VOLUME_OPTS = [
cfg.BoolOpt(
'hpxp_zoning_request',
default=False,
help='Request for FC Zone creating host group'),
]
COMMON_VOLUME_OPTS = [
cfg.StrOpt(
'hpxp_storage_cli',
help='Type of storage command line interface'),
cfg.StrOpt(
'hpxp_storage_id',
help='ID of storage system'),
cfg.StrOpt(
'hpxp_pool',
help='Pool of storage system'),
cfg.StrOpt(
'hpxp_thin_pool',
help='Thin pool of storage system'),
cfg.StrOpt(
'hpxp_ldev_range',
help='Logical device range of storage system'),
cfg.StrOpt(
'hpxp_default_copy_method',
default='FULL',
help='Default copy method of storage system. '
'There are two valid values: "FULL" specifies that a full copy; '
'"THIN" specifies that a thin copy. Default value is "FULL"'),
cfg.IntOpt(
'hpxp_copy_speed',
default=3,
help='Copy speed of storage system'),
cfg.IntOpt(
'hpxp_copy_check_interval',
default=3,
help='Interval to check copy'),
cfg.IntOpt(
'hpxp_async_copy_check_interval',
default=10,
help='Interval to check copy asynchronously'),
cfg.ListOpt(
'hpxp_target_ports',
help='Target port names for host group or iSCSI target'),
cfg.ListOpt(
'hpxp_compute_target_ports',
help=(
'Target port names of compute node '
'for host group or iSCSI target')),
cfg.BoolOpt(
'hpxp_group_request',
default=False,
help='Request for creating host group or iSCSI target'),
]
HORCM_VOLUME_OPTS = [
cfg.ListOpt(
'hpxp_horcm_numbers',
default=["200", "201"],
help='Instance numbers for HORCM'),
cfg.StrOpt(
'hpxp_horcm_user',
help='Username of storage system for HORCM'),
cfg.BoolOpt(
'hpxp_horcm_add_conf',
default=True,
help='Add to HORCM configuration'),
cfg.StrOpt(
'hpxp_horcm_resource_name',
default='meta_resource',
help='Resource group name of storage system for HORCM'),
cfg.BoolOpt(
'hpxp_horcm_name_only_discovery',
default=False,
help='Only discover a specific name of host group or iSCSI target'),
]
CONF = cfg.CONF
CONF.register_opts(FC_VOLUME_OPTS)
CONF.register_opts(COMMON_VOLUME_OPTS)
CONF.register_opts(HORCM_VOLUME_OPTS)

View File

@ -133,6 +133,8 @@ MAPPING = {
'cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver',
'cinder.volume.drivers.san.hp.hp_lefthand_iscsi.HPLeftHandISCSIDriver':
'cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver',
'cinder.volume.drivers.san.hp.hp_xp_fc.HPXPFCDriver':
'cinder.volume.drivers.hpe.hpe_xp_fc.HPEXPFCDriver',
}

View File

@ -0,0 +1,3 @@
---
upgrade:
- HP drivers have been rebranded to HPE. Existing configurations will continue to work with the legacy name, but will need to be updated by the next release.

View File

@ -90,7 +90,7 @@ cinder.tests.unit.test_hitachi_hnas_backend
cinder.tests.unit.test_hitachi_hnas_iscsi
cinder.tests.unit.test_hitachi_hnas_nfs
cinder.tests.unit.test_hpe3par
cinder.tests.unit.test_hp_xp_fc
cinder.tests.unit.test_hpe_xp_fc
cinder.tests.unit.test_hpelefthand
cinder.tests.unit.test_huawei_drivers
cinder.tests.unit.test_huawei_drivers_compatibility