Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cinder/Antelope/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.7.RC3"""
"""Version: 2.7.4"""
2 changes: 1 addition & 1 deletion Cinder/Antelope/huawei_base_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


class HuaweiBaseDriver(object):
VERSION = "2.7.RC3"
VERSION = "2.7.4"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion Cinder/Bobcat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.7.RC3"""
"""Version: 2.7.4"""
2 changes: 1 addition & 1 deletion Cinder/Bobcat/huawei_base_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


class HuaweiBaseDriver(object):
VERSION = "2.7.RC3"
VERSION = "2.7.4"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion Cinder/Caracal/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.7.RC3"""
"""Version: 2.7.4"""
2 changes: 1 addition & 1 deletion Cinder/Caracal/huawei_base_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


class HuaweiBaseDriver(object):
VERSION = "2.7.RC3"
VERSION = "2.7.4"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions Cinder/Dalmatian/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Version: 2.7.4"""
30 changes: 30 additions & 0 deletions Cinder/Dalmatian/cipher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2024 Huawei Technologies Co., Ltd.
# All Rights Reserved.
#
# 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.


def decrypt_cipher(text_info, is_need_decrypt=False):
"""
This interface is used to decrypt sensitive information.
When text_info is a plaintext password, no decryption is required by default.

When cipher_text is set to text_info, please set is_need_decrypt to True
and use your own decryption component to decrypt the ciphertext
"""
if is_need_decrypt:
# Please modify this interface and use your own decryption
# component to decrypt the ciphertext.
pass

return text_info
244 changes: 244 additions & 0 deletions Cinder/Dalmatian/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
# Copyright (c) 2024 Huawei Technologies Co., Ltd.
# All Rights Reserved.
#
# 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.

STATUS_INITIALIZE = '0'
STATUS_HEALTH = '1'
LUN_TYPE = '11'
SNAPSHOT_TYPE = '27'
BLOCK_POOL_TYPE = '1'
DORADO_V6_POOL_TYPE = '0'

HOSTGROUP_PREFIX = 'OpenStack_HostGroup_'
LUNGROUP_PREFIX = 'OpenStack_LunGroup_'
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
QOS_NAME_PREFIX = 'OpenStack_'
SENSITIVE_KEYS = ['auth_password']
SENSITIVE_INI_KEYS = ['initiator', 'wwpns', 'host_nqn', 'wwnns', 'nqn']

VALID_PROTOCOL = ['nvmeof', 'iSCSI', 'FC']

ROCE_INITIATOR = '57870'
ROCE_TARGET_NQN_PREFIX = 'nqn.2020-02.huawei.nvme:nvm-subsystem-sn-'
ROCE_TARGET_PORT = 4420
MAX_QUERY_COUNT = 100
ADDRESS_FAMILY_IPV4 = '0'

FC_PORT_CONNECTED = '10'
FC_INIT_ONLINE = '27'
FC_INITIATOR_NOT_EXIST = 1077948996
ERROR_PARAMETER_ERROR = 50331651
PARENT_TYPE_HOST = 21
CAPACITY_UNIT = 1024 * 1024 * 2
DEFAULT_WAIT_TIMEOUT = 3600 * 24 * 30
DEFAULT_WAIT_INTERVAL = 5
MAX_NAME_LENGTH = 31
SOCKET_TIMEOUT = 52
LOGIN_SOCKET_TIMEOUT = 32
DEFAULT_SEMAPHORE = 20
PWD_EXPIRED_OR_INITIAL = (3, 4)

LUN_STATUS = (LUN_ONLINE, LUN_INITIALIZING, LUN_OFFLINE) = ('27', '53', '28')
SNAPSHOT_STATUS = (
SNAPSHOT_INITIALIZING, SNAPSHOT_ACTIVATED, SNAPSHOT_UNACTIVATED
) = ('53', '43', '45')

MIGRATION_STATUS_IN_PROCESS = (
MIGRATION_NORMAL, MIGRATION_QUEUING, MIGRATION_MIGRATING
) = ('1', '37', '75')
MIGRATION_STATUS_COMPLETE = (MIGRATION_COMPLETE,) = ('76',)
LUNCOPY_STATUS_COMPLETE = (LUNCOPY_COMPLETE,) = ('40',)

ERROR_CONNECT_TO_SERVER = -403
ERROR_UNAUTHORIZED_TO_SERVER = -401
ERROR_DEVICE_COMMUNICATE = 4294967297
OBJECT_NAME_ALREADY_EXIST = 1077948993
OBJECT_ID_NOT_UNIQUE = 1077948997
ERROR_VOLUME_NOT_EXIST = 1077939726
ERROR_LUN_NOT_EXIST = 1077936859
SNAPSHOT_NOT_EXIST = 1077937880
OBJECT_NOT_EXIST = 1077948996
HYPERMETRO_NOT_EXIST = 1077674242
HYPERMETRO_NOT_IN_GROUP = 1077675021
HYPERMETROGROUP_NOT_EXIST = 1077675010
HYPERMETRO_ALREADY_IN_GROUP = 1077675038
NO_HYPERMETRO_EXIST_IN_GROUP = 1077675022
HOSTGROUP_NOT_IN_MAPPINGVIEW = 1073804552
PORTGROUP_NOT_IN_MAPPINGVIEW = 1073804553
LUNGROUP_NOT_IN_MAPPINGVIEW = 1073804554
MIGRATION_NOT_EXIST = 1073806607
LUNCOPY_NOT_EXIST = 50338560
LUNCOPY_ALREADY_STOPPED = 1077950178
LUNCOPY_COMPLETED = 1077950180
PORTGROUP_NOT_EXIST = 1077951832
HOSTGROUP_NOT_EXIST = 1077937500
HOST_NOT_IN_HOSTGROUP = 1073745412
PORT_NOT_IN_PORTGROUP = 1073807618
INITIATOR_NOT_IN_HOST = 1077950342
HOST_NOT_EXIST = 1077937498
MAPPINGVIEW_NOT_EXIST = 1077951819
HOST_ALREADY_IN_HOSTGROUP = 1077937501
PORT_ALREADY_IN_PORTGROUP = 1077951833
HOSTGROUP_ALREADY_IN_MAPPINGVIEW = 1073804556
PORTGROUP_ALREADY_IN_MAPPINGVIEW = 1073804558
LUNGROUP_ALREADY_IN_MAPPINGVIEW = 1073804560
LUN_ALREADY_IN_LUNGROUP = 1077936862
ERROR_VOLUME_TIMEOUT = 1077949001
GET_VOLUME_WAIT_INTERVAL = 30
CREATE_HYPERMETRO_TIMEOUT = 1077949006
HYPERMETRO_ALREADY_EXIST = 1077674256
ERROR_VOLUME_ALREADY_EXIST = 1077948993
HOST_LUN_MAPPING_NOT_EXIST = 1073804587
HOST_LUN_MAPPING_ALREADY_EXIST = 1073804588

RELOGIN_ERROR_CODE = (
ERROR_CONNECT_TO_SERVER, ERROR_UNAUTHORIZED_TO_SERVER,
ERROR_DEVICE_COMMUNICATE
)

METRO_RUNNING_STATUS = (METRO_RUNNING_NORMAL, METRO_RUNNING_SYNC,
METRO_RUNNING_STOP, RUNNING_TO_BE_SYNC
) = ('1', '23', '41', '100')
METRO_HEALTH_NORMAL = '1'

THICK_LUNTYPE = '0'
THIN_LUNTYPE = '1'
LUN_TYPE_MAP = {'Thick': THICK_LUNTYPE, 'Thin': THIN_LUNTYPE}

QOS_INACTIVATED = '45'
LOWER_LIMIT_KEYS = ('MINIOPS', 'LATENCY', 'MINBANDWIDTH')
UPPER_LIMIT_KEYS = ('MAXIOPS', 'MAXBANDWIDTH')

REPLICA_SYNC_MODEL = '1'
REPLICA_ASYNC_MODEL = '2'
REPLICA_SPEED = '2'
REPLICA_PERIOD = '3600'
REPLICA_SECOND_RO = '2'
REPLICA_SECOND_RW = '3'
REPLICA_CG_PERIOD = '60'

REPLICA_RUNNING_STATUS_SYNC = '23'
REPLICA_RUNNING_STATUS_NORMAL = '1'
REPLICA_RUNNING_STATUS_SPLIT = '26'
REPLICA_RUNNING_STATUS_INTERRUPTED = '34'
REPLICA_SECRES_DATA_SYNC = '1'
REPLICA_SECRES_DATA_COMPLETE = '2'
REPLICA_HEALTH_STATUS_NORMAL = '1'

REPLICATION_PAIR_NOT_EXIST = 1077937923
REPLICATION_GROUP_NOT_EXIST = 1077937924
REPLICATION_PAIR_NOT_GROUP_MEMBER = 1077937927
REPLICATION_GROUP_IS_EMPTY = 1077937960
CLONE_PAIR_SYNC_COMPLETE = 1073798176
CLONE_PAIR_SYNC_NOT_EXIST = 1073798172

VALID_PRODUCT = ('V3', 'V5', '18000', 'Dorado', 'V6')
TIER_DISK_TYPES = ('ssd', 'sas', 'nl_sas')
DORADO_V6_AND_V6_PRODUCT = ('Dorado', 'V6')

AVAILABLE_FEATURE_STATUS = (1, 2)
CHECK_FEATURES = {
'SmartTier': None,
'SmartThin': None,
'SmartQoS': 'ioclass',
'SmartPartition': 'cachepartition',
'SmartCache': 'smartcachepartition',
'SmartMigration': 'LUN_MIGRATION',
'HyperMetro': 'HyperMetroPair',
'HyperReplication': 'REPLICATIONPAIR',
'HyperSnap': 'snapshot',
'HyperCopy': 'LUNCOPY',
'SmartDedupe[\s\S]*LUN': None,
'SmartCompression[\s\S]*LUN': None,
'Effective Capacity': None,
}

LUN_COPY_SPEED_TYPES = (
LUN_COPY_SPEED_LOW,
LUN_COPY_SPEED_MEDIUM,
LUN_COPY_SPEED_HIGH,
LUN_COPY_SPEED_HIGHEST
) = ('1', '2', '3', '4')
DEFAULT_CLONE_MODE = "luncopy"

HYPER_SYNC_SPEED_TYPES = (
HYPER_SYNC_SPEED_LOW,
HYPER_SYNC_SPEED_MEDIUM,
HYPER_SYNC_SPEED_HIGH,
HYPER_SYNC_SPEED_HIGHEST
) = ('1', '2', '3', '4')

REPLICA_SYNC_SPEED_TYPES = (
REPLICA_SYNC_SPEED_LOW,
REPLICA_SYNC_SPEED_MEDIUM,
REPLICA_SYNC_SPEED_HIGH,
REPLICA_SYNC_SPEED_HIGHEST
) = ('1', '2', '3', '4')

CLONE_STATUS_HEALTH = '0'
CLONE_STATUS_COMPLETE = (CLONE_COMPLETE,) = ('2',)
CLONE_PAIR_NOT_EXIST = "1073798147"
SUPPORT_CLONE_PAIR_VERSION = "V600R003C00"
GET_PATCH_NUM = 100

DEFAULT_MINIMUM_FC_INITIATOR_ONLINE = 0

SNAPSHOT_HEALTH_STATUS = (
SNAPSHOT_HEALTH_STATUS_NORMAL,
SNAPSHOT_HEALTH_STATUS_FAULTY) = ('1', '2')
SNAPSHOT_RUNNING_STATUS = (
SNAPSHOT_RUNNING_STATUS_ACTIVATED,
SNAPSHOT_RUNNING_STATUS_ROLLINGBACK) = ('43', '44')
SNAPSHOT_ROLLBACK_PROGRESS_FINISH = '100'
SNAPSHOT_ROLLBACK_SPEED_TYPES = (
SNAPSHOT_ROLLBACK_SPEED_LOW,
SNAPSHOT_ROLLBACK_SPEED_MEDIUM,
SNAPSHOT_ROLLBACK_SPEED_HIGH,
SNAPSHOT_ROLLBACK_SPEED_HIGHEST
) = ('1', '2', '3', '4')

INBAND_LUN_TYPE = '5'

# Duplicate Field Summary
ID = 'id'
DATA = 'data'
QOS = 'qos'
LUN = 'lun'
POLICY = 'policy'
ISCSI_INFO = 'iscsi_info'
FASTCLONE = 'fastclone'
MULTIPATH = 'multipath'
HYPERMETRO = 'hypermetro'
APPLICATIONNAME = 'applicationname'
IN_BAND_OR_NOT = 'in_band_or_not'
METRO_SYNC_COMPLETED = 'metro_sync_completed'
STATUS = 'status'
TARGET_PORTALS = 'target_portals'
HUAWEI_LUN_WWN = 'huawei_lun_wwn'
HUAWEI_SN = 'huawei_sn'
SEMAPHORE = 'semaphore'
HOSTLUN_ID = 'hostlun_id'
BACKEND_ID = 'backend_id'
HYPERMETRO_ID = 'hypermetro_id'
HUAWEI_LUN_ID = 'huawei_lun_id'
WORKLOADTYPEID = 'WORKLOADTYPEID'
REMOTEHYPERREPLICATION = 'RemoteHyperReplication'
HYPERREPLICATION = 'HyperReplication'
HOSTNAME = 'HostName'
MULTIPATHTYPE = 'MULTIPATHTYPE'
RUNNINGSTATUS = 'RUNNINGSTATUS'
THIN = 'Thin'
HYPERMETRO_UPPER = 'HyperMetro'
ID_UPPER = 'ID'
Loading