From b9185bb2e67ad94b948d1c1eafa4bbf4d3876d03 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 3 Apr 2012 17:03:54 -0700 Subject: [PATCH] osdmap: allow row, room, datacenter, pool in conf for initial crush map These work just like host and rack, except that they are optional. Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 42c0608f930..b98dcfa68fd 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1262,13 +1262,16 @@ void OSDMap::build_simple_crush_map_from_conf(CephContext *cct, CrushWrapper& cr if (*end != '\0') continue; - string host; - string rack; + string host, rack, row, room, dc, pool; vector sections; sections.push_back("osd"); sections.push_back(*i); conf->get_val_from_conf_file(sections, "host", host, false); conf->get_val_from_conf_file(sections, "rack", rack, false); + conf->get_val_from_conf_file(sections, "row", row, false); + conf->get_val_from_conf_file(sections, "room", room, false); + conf->get_val_from_conf_file(sections, "datacenter", dc, false); + conf->get_val_from_conf_file(sections, "pool", pool, false); if (host.length() == 0) host = "unknownhost"; @@ -1281,6 +1284,12 @@ void OSDMap::build_simple_crush_map_from_conf(CephContext *cct, CrushWrapper& cr map loc; loc["host"] = host; loc["rack"] = rack; + if (row.size()) + loc["row"] = row; + if (room.size()) + loc["room"] = room; + if (dc.size()) + loc["datacenter"] = dc; loc["pool"] = "default"; ldout(cct, 0) << " adding osd." << o << " at " << loc << dendl;