Skip to content

Commit 625acda

Browse files
authored
Merge pull request #72 from huangpeng5/274
Support OpenStack Dalmatia with Cinder&Manila Driver
2 parents 11a5264 + 6b35bdb commit 625acda

File tree

264 files changed

+31631
-5357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+31631
-5357
lines changed

Cinder/Antelope/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.7.RC3"""
1+
"""Version: 2.7.4"""

Cinder/Antelope/huawei_base_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656
class HuaweiBaseDriver(object):
57-
VERSION = "2.7.RC3"
57+
VERSION = "2.7.4"
5858

5959
def __init__(self, *args, **kwargs):
6060
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)

Cinder/Bobcat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.7.RC3"""
1+
"""Version: 2.7.4"""

Cinder/Bobcat/huawei_base_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656
class HuaweiBaseDriver(object):
57-
VERSION = "2.7.RC3"
57+
VERSION = "2.7.4"
5858

5959
def __init__(self, *args, **kwargs):
6060
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)

Cinder/Caracal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.7.RC3"""
1+
"""Version: 2.7.4"""

Cinder/Caracal/huawei_base_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656
class HuaweiBaseDriver(object):
57-
VERSION = "2.7.RC3"
57+
VERSION = "2.7.4"
5858

5959
def __init__(self, *args, **kwargs):
6060
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)

Cinder/Dalmatian/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Version: 2.7.4"""

Cinder/Dalmatian/cipher.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2024 Huawei Technologies Co., Ltd.
2+
# All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
# not use this file except in compliance with the License. You may obtain
6+
# a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
16+
17+
def decrypt_cipher(text_info, is_need_decrypt=False):
18+
"""
19+
This interface is used to decrypt sensitive information.
20+
When text_info is a plaintext password, no decryption is required by default.
21+
22+
When cipher_text is set to text_info, please set is_need_decrypt to True
23+
and use your own decryption component to decrypt the ciphertext
24+
"""
25+
if is_need_decrypt:
26+
# Please modify this interface and use your own decryption
27+
# component to decrypt the ciphertext.
28+
pass
29+
30+
return text_info

Cinder/Dalmatian/constants.py

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# Copyright (c) 2024 Huawei Technologies Co., Ltd.
2+
# All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
# not use this file except in compliance with the License. You may obtain
6+
# a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
16+
STATUS_INITIALIZE = '0'
17+
STATUS_HEALTH = '1'
18+
LUN_TYPE = '11'
19+
SNAPSHOT_TYPE = '27'
20+
BLOCK_POOL_TYPE = '1'
21+
DORADO_V6_POOL_TYPE = '0'
22+
23+
HOSTGROUP_PREFIX = 'OpenStack_HostGroup_'
24+
LUNGROUP_PREFIX = 'OpenStack_LunGroup_'
25+
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
26+
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
27+
QOS_NAME_PREFIX = 'OpenStack_'
28+
SENSITIVE_KEYS = ['auth_password']
29+
SENSITIVE_INI_KEYS = ['initiator', 'wwpns', 'host_nqn', 'wwnns', 'nqn']
30+
31+
VALID_PROTOCOL = ['nvmeof', 'iSCSI', 'FC']
32+
33+
ROCE_INITIATOR = '57870'
34+
ROCE_TARGET_NQN_PREFIX = 'nqn.2020-02.huawei.nvme:nvm-subsystem-sn-'
35+
ROCE_TARGET_PORT = 4420
36+
MAX_QUERY_COUNT = 100
37+
ADDRESS_FAMILY_IPV4 = '0'
38+
39+
FC_PORT_CONNECTED = '10'
40+
FC_INIT_ONLINE = '27'
41+
FC_INITIATOR_NOT_EXIST = 1077948996
42+
ERROR_PARAMETER_ERROR = 50331651
43+
PARENT_TYPE_HOST = 21
44+
CAPACITY_UNIT = 1024 * 1024 * 2
45+
DEFAULT_WAIT_TIMEOUT = 3600 * 24 * 30
46+
DEFAULT_WAIT_INTERVAL = 5
47+
MAX_NAME_LENGTH = 31
48+
SOCKET_TIMEOUT = 52
49+
LOGIN_SOCKET_TIMEOUT = 32
50+
DEFAULT_SEMAPHORE = 20
51+
PWD_EXPIRED_OR_INITIAL = (3, 4)
52+
53+
LUN_STATUS = (LUN_ONLINE, LUN_INITIALIZING, LUN_OFFLINE) = ('27', '53', '28')
54+
SNAPSHOT_STATUS = (
55+
SNAPSHOT_INITIALIZING, SNAPSHOT_ACTIVATED, SNAPSHOT_UNACTIVATED
56+
) = ('53', '43', '45')
57+
58+
MIGRATION_STATUS_IN_PROCESS = (
59+
MIGRATION_NORMAL, MIGRATION_QUEUING, MIGRATION_MIGRATING
60+
) = ('1', '37', '75')
61+
MIGRATION_STATUS_COMPLETE = (MIGRATION_COMPLETE,) = ('76',)
62+
LUNCOPY_STATUS_COMPLETE = (LUNCOPY_COMPLETE,) = ('40',)
63+
64+
ERROR_CONNECT_TO_SERVER = -403
65+
ERROR_UNAUTHORIZED_TO_SERVER = -401
66+
ERROR_DEVICE_COMMUNICATE = 4294967297
67+
OBJECT_NAME_ALREADY_EXIST = 1077948993
68+
OBJECT_ID_NOT_UNIQUE = 1077948997
69+
ERROR_VOLUME_NOT_EXIST = 1077939726
70+
ERROR_LUN_NOT_EXIST = 1077936859
71+
SNAPSHOT_NOT_EXIST = 1077937880
72+
OBJECT_NOT_EXIST = 1077948996
73+
HYPERMETRO_NOT_EXIST = 1077674242
74+
HYPERMETRO_NOT_IN_GROUP = 1077675021
75+
HYPERMETROGROUP_NOT_EXIST = 1077675010
76+
HYPERMETRO_ALREADY_IN_GROUP = 1077675038
77+
NO_HYPERMETRO_EXIST_IN_GROUP = 1077675022
78+
HOSTGROUP_NOT_IN_MAPPINGVIEW = 1073804552
79+
PORTGROUP_NOT_IN_MAPPINGVIEW = 1073804553
80+
LUNGROUP_NOT_IN_MAPPINGVIEW = 1073804554
81+
MIGRATION_NOT_EXIST = 1073806607
82+
LUNCOPY_NOT_EXIST = 50338560
83+
LUNCOPY_ALREADY_STOPPED = 1077950178
84+
LUNCOPY_COMPLETED = 1077950180
85+
PORTGROUP_NOT_EXIST = 1077951832
86+
HOSTGROUP_NOT_EXIST = 1077937500
87+
HOST_NOT_IN_HOSTGROUP = 1073745412
88+
PORT_NOT_IN_PORTGROUP = 1073807618
89+
INITIATOR_NOT_IN_HOST = 1077950342
90+
HOST_NOT_EXIST = 1077937498
91+
MAPPINGVIEW_NOT_EXIST = 1077951819
92+
HOST_ALREADY_IN_HOSTGROUP = 1077937501
93+
PORT_ALREADY_IN_PORTGROUP = 1077951833
94+
HOSTGROUP_ALREADY_IN_MAPPINGVIEW = 1073804556
95+
PORTGROUP_ALREADY_IN_MAPPINGVIEW = 1073804558
96+
LUNGROUP_ALREADY_IN_MAPPINGVIEW = 1073804560
97+
LUN_ALREADY_IN_LUNGROUP = 1077936862
98+
ERROR_VOLUME_TIMEOUT = 1077949001
99+
GET_VOLUME_WAIT_INTERVAL = 30
100+
CREATE_HYPERMETRO_TIMEOUT = 1077949006
101+
HYPERMETRO_ALREADY_EXIST = 1077674256
102+
ERROR_VOLUME_ALREADY_EXIST = 1077948993
103+
HOST_LUN_MAPPING_NOT_EXIST = 1073804587
104+
HOST_LUN_MAPPING_ALREADY_EXIST = 1073804588
105+
106+
RELOGIN_ERROR_CODE = (
107+
ERROR_CONNECT_TO_SERVER, ERROR_UNAUTHORIZED_TO_SERVER,
108+
ERROR_DEVICE_COMMUNICATE
109+
)
110+
111+
METRO_RUNNING_STATUS = (METRO_RUNNING_NORMAL, METRO_RUNNING_SYNC,
112+
METRO_RUNNING_STOP, RUNNING_TO_BE_SYNC
113+
) = ('1', '23', '41', '100')
114+
METRO_HEALTH_NORMAL = '1'
115+
116+
THICK_LUNTYPE = '0'
117+
THIN_LUNTYPE = '1'
118+
LUN_TYPE_MAP = {'Thick': THICK_LUNTYPE, 'Thin': THIN_LUNTYPE}
119+
120+
QOS_INACTIVATED = '45'
121+
LOWER_LIMIT_KEYS = ('MINIOPS', 'LATENCY', 'MINBANDWIDTH')
122+
UPPER_LIMIT_KEYS = ('MAXIOPS', 'MAXBANDWIDTH')
123+
124+
REPLICA_SYNC_MODEL = '1'
125+
REPLICA_ASYNC_MODEL = '2'
126+
REPLICA_SPEED = '2'
127+
REPLICA_PERIOD = '3600'
128+
REPLICA_SECOND_RO = '2'
129+
REPLICA_SECOND_RW = '3'
130+
REPLICA_CG_PERIOD = '60'
131+
132+
REPLICA_RUNNING_STATUS_SYNC = '23'
133+
REPLICA_RUNNING_STATUS_NORMAL = '1'
134+
REPLICA_RUNNING_STATUS_SPLIT = '26'
135+
REPLICA_RUNNING_STATUS_INTERRUPTED = '34'
136+
REPLICA_SECRES_DATA_SYNC = '1'
137+
REPLICA_SECRES_DATA_COMPLETE = '2'
138+
REPLICA_HEALTH_STATUS_NORMAL = '1'
139+
140+
REPLICATION_PAIR_NOT_EXIST = 1077937923
141+
REPLICATION_GROUP_NOT_EXIST = 1077937924
142+
REPLICATION_PAIR_NOT_GROUP_MEMBER = 1077937927
143+
REPLICATION_GROUP_IS_EMPTY = 1077937960
144+
CLONE_PAIR_SYNC_COMPLETE = 1073798176
145+
CLONE_PAIR_SYNC_NOT_EXIST = 1073798172
146+
147+
VALID_PRODUCT = ('V3', 'V5', '18000', 'Dorado', 'V6')
148+
TIER_DISK_TYPES = ('ssd', 'sas', 'nl_sas')
149+
DORADO_V6_AND_V6_PRODUCT = ('Dorado', 'V6')
150+
151+
AVAILABLE_FEATURE_STATUS = (1, 2)
152+
CHECK_FEATURES = {
153+
'SmartTier': None,
154+
'SmartThin': None,
155+
'SmartQoS': 'ioclass',
156+
'SmartPartition': 'cachepartition',
157+
'SmartCache': 'smartcachepartition',
158+
'SmartMigration': 'LUN_MIGRATION',
159+
'HyperMetro': 'HyperMetroPair',
160+
'HyperReplication': 'REPLICATIONPAIR',
161+
'HyperSnap': 'snapshot',
162+
'HyperCopy': 'LUNCOPY',
163+
'SmartDedupe[\s\S]*LUN': None,
164+
'SmartCompression[\s\S]*LUN': None,
165+
'Effective Capacity': None,
166+
}
167+
168+
LUN_COPY_SPEED_TYPES = (
169+
LUN_COPY_SPEED_LOW,
170+
LUN_COPY_SPEED_MEDIUM,
171+
LUN_COPY_SPEED_HIGH,
172+
LUN_COPY_SPEED_HIGHEST
173+
) = ('1', '2', '3', '4')
174+
DEFAULT_CLONE_MODE = "luncopy"
175+
176+
HYPER_SYNC_SPEED_TYPES = (
177+
HYPER_SYNC_SPEED_LOW,
178+
HYPER_SYNC_SPEED_MEDIUM,
179+
HYPER_SYNC_SPEED_HIGH,
180+
HYPER_SYNC_SPEED_HIGHEST
181+
) = ('1', '2', '3', '4')
182+
183+
REPLICA_SYNC_SPEED_TYPES = (
184+
REPLICA_SYNC_SPEED_LOW,
185+
REPLICA_SYNC_SPEED_MEDIUM,
186+
REPLICA_SYNC_SPEED_HIGH,
187+
REPLICA_SYNC_SPEED_HIGHEST
188+
) = ('1', '2', '3', '4')
189+
190+
CLONE_STATUS_HEALTH = '0'
191+
CLONE_STATUS_COMPLETE = (CLONE_COMPLETE,) = ('2',)
192+
CLONE_PAIR_NOT_EXIST = "1073798147"
193+
SUPPORT_CLONE_PAIR_VERSION = "V600R003C00"
194+
GET_PATCH_NUM = 100
195+
196+
DEFAULT_MINIMUM_FC_INITIATOR_ONLINE = 0
197+
198+
SNAPSHOT_HEALTH_STATUS = (
199+
SNAPSHOT_HEALTH_STATUS_NORMAL,
200+
SNAPSHOT_HEALTH_STATUS_FAULTY) = ('1', '2')
201+
SNAPSHOT_RUNNING_STATUS = (
202+
SNAPSHOT_RUNNING_STATUS_ACTIVATED,
203+
SNAPSHOT_RUNNING_STATUS_ROLLINGBACK) = ('43', '44')
204+
SNAPSHOT_ROLLBACK_PROGRESS_FINISH = '100'
205+
SNAPSHOT_ROLLBACK_SPEED_TYPES = (
206+
SNAPSHOT_ROLLBACK_SPEED_LOW,
207+
SNAPSHOT_ROLLBACK_SPEED_MEDIUM,
208+
SNAPSHOT_ROLLBACK_SPEED_HIGH,
209+
SNAPSHOT_ROLLBACK_SPEED_HIGHEST
210+
) = ('1', '2', '3', '4')
211+
212+
INBAND_LUN_TYPE = '5'
213+
214+
# Duplicate Field Summary
215+
ID = 'id'
216+
DATA = 'data'
217+
QOS = 'qos'
218+
LUN = 'lun'
219+
POLICY = 'policy'
220+
ISCSI_INFO = 'iscsi_info'
221+
FASTCLONE = 'fastclone'
222+
MULTIPATH = 'multipath'
223+
HYPERMETRO = 'hypermetro'
224+
APPLICATIONNAME = 'applicationname'
225+
IN_BAND_OR_NOT = 'in_band_or_not'
226+
METRO_SYNC_COMPLETED = 'metro_sync_completed'
227+
STATUS = 'status'
228+
TARGET_PORTALS = 'target_portals'
229+
HUAWEI_LUN_WWN = 'huawei_lun_wwn'
230+
HUAWEI_SN = 'huawei_sn'
231+
SEMAPHORE = 'semaphore'
232+
HOSTLUN_ID = 'hostlun_id'
233+
BACKEND_ID = 'backend_id'
234+
HYPERMETRO_ID = 'hypermetro_id'
235+
HUAWEI_LUN_ID = 'huawei_lun_id'
236+
WORKLOADTYPEID = 'WORKLOADTYPEID'
237+
REMOTEHYPERREPLICATION = 'RemoteHyperReplication'
238+
HYPERREPLICATION = 'HyperReplication'
239+
HOSTNAME = 'HostName'
240+
MULTIPATHTYPE = 'MULTIPATHTYPE'
241+
RUNNINGSTATUS = 'RUNNINGSTATUS'
242+
THIN = 'Thin'
243+
HYPERMETRO_UPPER = 'HyperMetro'
244+
ID_UPPER = 'ID'

0 commit comments

Comments
 (0)