On Thu, 21 Jan 2016, Xiaoxi Chen wrote: > Yeah, mark a whole tree is cool. > > We can do that in API level but in implementation, seems we still need > to set the flag on OSD level for simplicity. For example, say RackA > and B are belongs to Row A in crush tree, then if we do: > ceph [osdmap? crush? ] set RowA noout > ceph [osdmap? crush? ] set RackA noup > ceph [osdmap? crush? ] unset RackB noout > > As a result, OSDs in Rack A should be noup+noout, but OSDs in RackB > should have no flag setted. The easiest way in my mind might be > traversal the crush subtree and mark the flag on vector<uint8_t> > osd_state for every OSD, uint8_t is just enough for now....but next > time if we want to have more state will be struggle. Oh right--that is much simpler! > > #define CEPH_OSD_NOUP (1<<4) /* osd cannot be marked up */ > #define CEPH_OSD_NODOWN (1<<5) /* osd cannot be marked down */ > #define CEPH_OSD_NOIN (1<<6) /* osd cannot be marked in */ > #define CEPH_OSD_NOOUT (1<<7) /* osd cannot be marked out */ +1 > The APIs we would like to support are: > > 1. ceph XXX set/unset {crush_subtree_name} {flag} ceph osd [un]set-osd {osd} {flag} ceph osd [un]set-subtree {osd} {flag} (This way we look like 'ceph osd crush reweight-subtree ...'.) > 2. ceph osd tree will show flag of each OSD (if it has) > 3. ceph health should show the number of OSD with flags. > 4. ceph health detail show OSDs with flgas. > > 3) and 4) need to iterate the vector<uint8_t> osd_state in OSDMap. Sounds good! sage -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html