Skip to content

Commit c90ef88

Browse files
authored
Merge pull request #85 from huangpeng5/25_630
25.1.0 Released
2 parents d50a1c6 + a4fd78a commit c90ef88

File tree

75 files changed

+4096
-99
lines changed

Some content is hidden

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

75 files changed

+4096
-99
lines changed

Cinder/Antelope/dsware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
@interface.volumedriver
128128
class DSWAREBaseDriver(customization_driver.DriverForPlatform,
129129
driver.VolumeDriver):
130-
VERSION = "2.7.4"
130+
VERSION = "25.1.0"
131131
CI_WIKI_NAME = 'Huawei_FusionStorage_CI'
132132

133133
def __init__(self, *args, **kwargs):

Cinder/Bobcat/dsware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
@interface.volumedriver
128128
class DSWAREBaseDriver(customization_driver.DriverForPlatform,
129129
driver.VolumeDriver):
130-
VERSION = "2.7.4"
130+
VERSION = "25.1.0"
131131
CI_WIKI_NAME = 'Huawei_FusionStorage_CI'
132132

133133
def __init__(self, *args, **kwargs):
File renamed without changes.
File renamed without changes.

Cinder/Dalmatian/constants.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright (c) 2016 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+
DEFAULT_TIMEOUT = 50
17+
LOGIN_SOCKET_TIMEOUT = 32
18+
GET_VOLUME_PAGE_NUM = 1
19+
GET_VOLUME_PAGE_SIZE = 1000
20+
GET_SNAPSHOT_PAGE_NUM = 1
21+
GET_SNAPSHOT_PAGE_SIZE = 1000
22+
GET_QOS_PAGE_NUM = 1
23+
GET_QOS_PAGE_SIZE = 100
24+
25+
CONNECT_ERROR = 403
26+
ERROR_UNAUTHORIZED = 10000003
27+
ERROR_USER_OFFLINE = '1077949069'
28+
VOLUME_NOT_EXIST = (31000000, 50150005, 32150005)
29+
SNAPSHOT_NOT_EXIST = (50150006,)
30+
31+
BASIC_URI = '/dsware/service/'
32+
CONF_PATH = "/etc/cinder/cinder.conf"
33+
HOST_GROUP_PREFIX = "OpenStack_"
34+
35+
CONF_ADDRESS = "dsware_rest_url"
36+
CONF_MANAGER_IP = "manager_ips"
37+
CONF_POOLS = "dsware_storage_pools"
38+
CONF_PWD = "san_password"
39+
CONF_USER = "san_login"
40+
CONF_IP = "san_ip"
41+
CONF_PORT = "san_port"
42+
CONF_NEW_POOLS = "storage_pools"
43+
CONF_STORAGE_CA_FILEPATH = "storage_ca_filepath"
44+
CONF_STORAGE_KEY_FILEPATH = "storage_key_filepath"
45+
CONF_STORAGE_CERT_FILEPATH = "storage_cert_filepath"
46+
CONF_STORAGE_SSL_TWO_WAY_AUTH = "storage_ssl_two_way_auth"
47+
48+
DEFAULT_WAIT_INTERVAL = 5
49+
MIGRATION_COMPLETE = 76
50+
MIGRATION_FAULT = 74
51+
STATUS_HEALTH = 1
52+
STATUS_VOLUME_READY = 27
53+
MIGRATION_WAIT_INTERVAL = 5
54+
DEFAULT_WAIT_TIMEOUT = 3600 * 24 * 30
55+
56+
QOS_MUST_SET = ["maxIOPS", "maxMBPS"]
57+
QOS_KEYS = ["maxIOPS", "maxMBPS", "total_iops_sec", "total_bytes_sec"]
58+
QOS_SCHEDULER_KEYS = [
59+
"scheduleType", "startDate", "startTime",
60+
"durationTime", "dayOfWeek"
61+
]
62+
QOS_PREFIX = "OpenStack_"
63+
QOS_SCHEDULER_DEFAULT_TYPE = "0"
64+
QOS_SCHEDULER_WEEK_TYPE = "3"
65+
QOS_SUPPORT_SCHEDULE_VERSION = "8.0"
66+
QOS_MAX_INTERCEPT_LENGTH = 36
67+
SECONDS_OF_DAY = 24 * 60 * 60
68+
SECONDS_OF_HOUR = 60 * 60
69+
SNAPSHOT_HEALTH_STATUS = (
70+
SNAPSHOT_HEALTH_STATS_NORMAL,
71+
SNAPSHOT_HEALTH_STATS_FAULT) = (1, 2)
72+
SNAPSHOT_RUNNING_STATUS = (
73+
SNAPSHOT_RUNNING_STATUS_ONLINE,
74+
SNAPSHOT_RUNNING_STATUS_OFFLINE,
75+
SNAPSHOT_RUNNING_STATUS_ROLLBACKING) = (27, 28, 44)
76+
SNAPSHOT_ROLLBACK_PROGRESS_FINISH = 100
77+
SNAPSHOT_ROLLBACK_TIMEOUT = 60 * 60 * 24
78+
WAIT_INTERVAL = 10
79+
WEEK_DAYS = ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"]
80+
TIMEZONE = {"Asia/Beijing": "Asia/Shanghai"}
81+
MAX_NAME_LENGTH = 31
82+
MAX_IOPS_VALUE = 999999999
83+
MAX_MBPS_VALUE = 999999
84+
HOST_FLAG = 0
85+
URL_NOT_FOUND = "Not Found for url"
86+
HOST_ISCSI_RELATION_EXIST = 540157748
87+
DSWARE_MULTI_ERROR = 1
88+
HOST_ALREADY_EXIST = 50157019
89+
HOST_MAPPING_EXIST = 50157027
90+
HOST_MAPPING_GROUP_EXIST = 50157046
91+
HOST_ALREADY_MAPPING_LUN = 50157058
92+
HOSTGROUP_ALREADY_EXIST = 50157044
93+
INITIATOR_ALREADY_EXIST = 50155102
94+
INITIATOR_IN_HOST = 50157021
95+
96+
CHECK_CLONED_INTERVAL = 2
97+
REST_VOLUME_CREATING_STATUS = 15
98+
REST_VOLUME_DUPLICATE_VOLUME = 6
99+
REST_VOLUME_CREATE_SUCCESS_STATUS = 0
100+
CLONE_VOLUME_TIMEOUT = 3600 * 24 * 30
101+
102+
QOS = 'qos'
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright (c) 2023 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+
import logging
17+
18+
from cinder.volume.drivers.fusionstorage import fs_utils
19+
20+
LOG = logging.getLogger(__name__)
21+
22+
23+
class DriverForPlatform(object):
24+
"""
25+
Cloud Platform Customization Class
26+
"""
27+
def __init__(self, *args, **kwargs):
28+
super(DriverForPlatform, self).__init__(*args, **kwargs)
29+
30+
def reload_qos(self, volume, qos_vals=None):
31+
"""
32+
ZTE Cloud Platform Customization Interface
33+
QoS policies can be dynamically modified,remove,add
34+
and take effect on volumes in real time.
35+
"""
36+
self._check_volume_exist_on_array(volume)
37+
volume_name = self._get_vol_name(volume)
38+
if not qos_vals:
39+
LOG.info("qos_vals is None, remove qos from volume %s", volume_name)
40+
self.fs_qos.remove(volume_name)
41+
return
42+
43+
qos_vals = fs_utils.get_qos_param(qos_vals, self.client)
44+
vol_qos = self.client.get_qos_by_vol_name(volume_name)
45+
qos_name = vol_qos.get("qosName")
46+
if qos_name:
47+
LOG.info("volume already had qos, "
48+
"update qos:%s of volume %s", qos_name, volume_name)
49+
self.client.modify_qos(qos_name, qos_vals)
50+
return
51+
52+
LOG.info("volume did not have qos, "
53+
"add qos to volume %s", volume_name)
54+
self.fs_qos.add(qos_vals, volume_name)
55+
return
56+
57+
def modify_qos_with_volume(self, qos_id, volume):
58+
"""
59+
Unified customization interface for Mobile
60+
network cloud to modify qos with volume
61+
"""
62+
volume_name = self._get_vol_name(volume)
63+
vol_qos = self.client.get_qos_by_vol_name(volume_name)
64+
qos_name = vol_qos.get("qosName")
65+
if not qos_name:
66+
msg = ("dsware modify qos %(vol_qos)s with volume %(volume)s "
67+
"failed! volume not associate qos") % {
68+
'vol_qos': dict(vol_qos), 'volume': volume_name}
69+
self._raise_exception(msg)
70+
71+
new_qos = fs_utils.get_qos_specs(qos_id, self.client)
72+
if not new_qos:
73+
msg = ("dsware modify qos %(qos_id)s with volume %(volume)s "
74+
"failed! no valid qos specs found, consumer is front-end") % {
75+
'qos_id': qos_id, 'volume': volume_name}
76+
self._raise_exception(msg)
77+
78+
self.client.modify_qos(qos_name, new_qos)
79+
80+
def rollback_snapshot(self, volume, snapshot):
81+
"""
82+
Unified customization interface for
83+
Baidu Cloud Platform to rollback snapshot
84+
85+
params:
86+
snapshot: Snapshot object to roll back
87+
volume: Volume object to be rolled back
88+
89+
If a volume expand after a snapshot is created,
90+
the volume size is inconsistent with the snapshot size.
91+
In this case, snapshot rollback is not supported.
92+
"""
93+
LOG.info("Begin to revert volume %s to snapshot %s", volume.id, snapshot.id)
94+
if snapshot.volume_size != volume.size:
95+
msg = "The volume size must be equal to the snapshot size."
96+
LOG.error(msg)
97+
self._raise_exception(msg)
98+
self.revert_to_snapshot(None, volume, snapshot)

0 commit comments

Comments
 (0)