Skip to content

Commit 7cfbc99

Browse files
committed
Merge branch 'master' into migration_flipper_fox_graylog
2 parents 4b0609c + a83ccfb commit 7cfbc99

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

dbaas/notification/tasks_disk_resize.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,17 @@ def zabbix_collect_used_disk(task):
9292
message='Zabbix metrics not updated', level=4
9393
)
9494

95-
if current_percentage >= threshold_disk_resize and \
95+
size_metadata = database.databaseinfra.disk_offering.size_kb
96+
if has_difference_between(size_metadata, current_size):
97+
problems += 1
98+
task.add_detail(
99+
message='Disk size different in metadata: {}kb'.format(
100+
size_metadata
101+
),
102+
level=4
103+
)
104+
status = TaskHistory.STATUS_WARNING
105+
elif current_percentage >= threshold_disk_resize and \
96106
database.disk_auto_resize and \
97107
not database_resized:
98108
try:
@@ -224,3 +234,15 @@ def host_mount_data_percentage(address, task):
224234
)
225235

226236
return values['percentage'], values['used'], values['total']
237+
238+
239+
def has_difference_between(metadata, collected):
240+
threshold = Configuration.get_by_name_as_float(
241+
"threshold_disk_size_difference", default=1.0
242+
)
243+
244+
difference = (metadata * threshold)/100
245+
max_value = metadata + difference
246+
min_value = metadata - difference
247+
248+
return collected > max_value or collected < min_value

dbaas/physical/tests/test_host.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from ..models import Host
88
from .factory import HostFactory
99

10-
SEARCH_FIELDS = ('hostname', 'nfsaas_host_attributes__nfsaas_path', 'address')
10+
SEARCH_FIELDS = ('hostname', 'nfsaas_host_attributes__nfsaas_path',
11+
'address', 'os_description')
1112
EDITING_READ_ONLY_FIELDS = ('nfsaas_size_kb', 'nfsaas_used_size_kb')
1213

1314

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ wsgiref==0.1.2
5353
dbaas_cloudstack==0.8.4
5454
dbaas_credentials==1.1.10
5555
dbaas_nfsaas==0.6.13
56-
dbaas_zabbix==0.4.13
56+
dbaas_zabbix==0.4.14
5757
dbaas_dbmonitor==0.2.3
5858
dbaas_flipper==0.0.9
5959
django-filter==0.9.1

0 commit comments

Comments
 (0)