Commit 8ce46200 authored by Felix Seibert's avatar Felix Seibert
Browse files

change two_step rebalancing such that OSD capacities are respected

parent a2b05e2c
......@@ -47,6 +47,15 @@ class DataDistribution(object):
new_osd = osd.OSD(osd_uuid)
self.OSDs[osd_uuid] = new_osd
def replace_osd(self, new_osd):
"""
replaces the osd with uuid new_osd.uuid by new_osd
:param new_osd:
:return:
"""
assert new_osd.uuid in self.OSDs.keys()
self.OSDs[new_osd.uuid] = new_osd
def set_osd_capacities(self, osd_capacities):
"""
set osd capacities
......@@ -410,7 +419,10 @@ class DataDistribution(object):
origin_osd = self.get_containing_osd(virtual_folder).uuid
target_osd = current_osd.uuid
movements[virtual_folder] = (origin_osd, target_osd)
self.assign_new_osd(virtual_folder, target_osd)
for current_osd, virtual_osd in current_to_virtual_osd_matching:
virtual_osd.uuid = current_osd.uuid
self.replace_osd(virtual_osd)
return movements
......
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