Commit 0a275f6c authored by Felix Seibert's avatar Felix Seibert
Browse files

print out current OSD capacities and usage if no suitable OSD can be found for a new folder<

parent d633ecc8
......@@ -120,6 +120,12 @@ class DataDistribution(object):
total_bandwidth += one_osd.bandwidth
return total_bandwidth
def get_total_capacity(self):
total_capacity = 0
for one_osd in self.OSDs.values():
total_capacity += one_osd.capacity
return total_capacity
def get_average_folder_size(self):
"""
get the average folder size of all folders of all OSDs.
......@@ -474,7 +480,10 @@ class DataDistribution(object):
for one_osd in self.OSDs.values():
if one_osd.capacity - one_osd.total_folder_size - folder_size >= 0:
suitable_osds.append(one_osd)
if len(suitable_osds) == 0:
print("no suitable OSD found!")
print("total OSD capacity: " + str(self.get_total_capacity()))
print("current total folder size: " + str(self.get_total_folder_size()))
return suitable_osds
def get_lpt_osd(self, folder_size):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment