cephadm: Add chown to unit.run for adoped simple OSDs#34703
cephadm: Add chown to unit.run for adoped simple OSDs#34703sebastian-philipp merged 2 commits intoceph:masterfrom
chown to unit.run for adoped simple OSDs#34703Conversation
|
Just to make the output of this change clear, it injects e.g. the following three lines at the start of unit.run: These lines are only added for simple OSDs, not for LVM OSDs. |
mgfritch
left a comment
There was a problem hiding this comment.
If possible, I think it would be nice to avoid adding the osd_simple bool to deploy_daemon_units ...
otherwise, minus the mypy error, lgtm!
Now that you mention it, it's probably safe to always have the chowns in there, as they happen first before the lvm activate step. If that's true, we can ditch the |
|
Confirmed, chowning these things doesn't have any adverse affect on LVM OSDs, so we could get rid of the @sebastian-philipp, what do you think? |
|
Right. Not having to adjust the logic here make things simpler. @jan--f do you have anything against unconditionally doing the chown? |
We're not using `ceph-volume simple activate` anymore, so need to add `chown ceph:ceph` for each of block, block.db and block.wal to ensure old-style simple OSDs are able to start. Fixes: https://tracker.ceph.com/issues/45129 Signed-off-by: Tim Serong <tserong@suse.com>
This addresses a couple of the comments in ceph#34565 Signed-off-by: Tim Serong <tserong@suse.com>
|
OK, I've removed the osd_simple flag, tweaked the comments slightly, and flipped the |
|
@mgfritch any update on this run? |
This changes the logic in deploy_daemon_units() to add either `chown` calls for simple (ceph-disk style) OSDs, or to add `ceph-volume lvm activate` calls for LVM OSDs, rather than always adding both. When I was working on ceph#34703, I'd originally added an "osd_simple" flag to figure out what type of OSD was being adopted/deployed, but passing that around was kinda ugly, so was removed from that PR. This time around I'm checking if /etc/ceph/osd/$OSD_ID-$OSD_FSID.json.adopted-by-cephadm exists, which seems pretty safe IMO. My only concern with this method is: what happens if someone adopts a simple OSD, then later wants to migrate it to LVM. Presumably that's a destroy and recreate, keeping the same OSD ID? If that's true, then the JSON file probably still exists, so the subsequent create will do the wrong thing, i.e. will add `chown` calls, not `ceph-volume lvm activate` calls. Any/all feedback appreciated... Fixes: https://tracker.ceph.com/issues/46833 Signed-off-by: Tim Serong <tserong@suse.com>
This changes the logic in deploy_daemon_units() to add either `chown` calls for simple (ceph-disk style) OSDs, or to add `ceph-volume lvm activate` calls for LVM OSDs, rather than always adding both. When I was working on ceph#34703, I'd originally added an "osd_simple" flag to figure out what type of OSD was being adopted/deployed, but passing that around was kinda ugly, so was removed from that PR. This time around I'm checking if /etc/ceph/osd/$OSD_ID-$OSD_FSID.json.adopted-by-cephadm exists, which seems pretty safe IMO. My only concern with this method is: what happens if someone adopts a simple OSD, then later wants to migrate it to LVM. Presumably that's a destroy and recreate, keeping the same OSD ID? If that's true, then the JSON file probably still exists, so the subsequent create will do the wrong thing, i.e. will add `chown` calls, not `ceph-volume lvm activate` calls. Any/all feedback appreciated... Fixes: https://tracker.ceph.com/issues/46833 Signed-off-by: Tim Serong <tserong@suse.com>
This changes the logic in deploy_daemon_units() to add either `chown` calls for simple (ceph-disk style) OSDs, or to add `ceph-volume lvm activate` calls for LVM OSDs, rather than always adding both. When I was working on ceph#34703, I'd originally added an "osd_simple" flag to figure out what type of OSD was being adopted/deployed, but passing that around was kinda ugly, so was removed from that PR. This time around I'm checking if /etc/ceph/osd/$OSD_ID-$OSD_FSID.json.adopted-by-cephadm exists, which seems pretty safe IMO. My only concern with this method is: what happens if someone adopts a simple OSD, then later wants to migrate it to LVM. Presumably that's a destroy and recreate, keeping the same OSD ID? If that's true, then the JSON file probably still exists, so the subsequent create will do the wrong thing, i.e. will add `chown` calls, not `ceph-volume lvm activate` calls. Any/all feedback appreciated... Fixes: https://tracker.ceph.com/issues/46833 Signed-off-by: Tim Serong <tserong@suse.com>
This changes the logic in deploy_daemon_units() to add either `chown` calls for simple (ceph-disk style) OSDs, or to add `ceph-volume lvm activate` calls for LVM OSDs, rather than always adding both. When I was working on ceph#34703, I'd originally added an "osd_simple" flag to figure out what type of OSD was being adopted/deployed, but passing that around was kinda ugly, so was removed from that PR. This time around I'm checking if /etc/ceph/osd/$OSD_ID-$OSD_FSID.json.adopted-by-cephadm exists, which seems pretty safe IMO. My only concern with this method is: what happens if someone adopts a simple OSD, then later wants to migrate it to LVM. Presumably that's a destroy and recreate, keeping the same OSD ID? If that's true, then the JSON file probably still exists, so the subsequent create will do the wrong thing, i.e. will add `chown` calls, not `ceph-volume lvm activate` calls. Any/all feedback appreciated... Fixes: https://tracker.ceph.com/issues/46833 Signed-off-by: Tim Serong <tserong@suse.com> (cherry picked from commit 8112949)
This changes the logic in deploy_daemon_units() to add either `chown` calls for simple (ceph-disk style) OSDs, or to add `ceph-volume lvm activate` calls for LVM OSDs, rather than always adding both. When I was working on ceph/ceph#34703, I'd originally added an "osd_simple" flag to figure out what type of OSD was being adopted/deployed, but passing that around was kinda ugly, so was removed from that PR. This time around I'm checking if /etc/ceph/osd/$OSD_ID-$OSD_FSID.json.adopted-by-cephadm exists, which seems pretty safe IMO. My only concern with this method is: what happens if someone adopts a simple OSD, then later wants to migrate it to LVM. Presumably that's a destroy and recreate, keeping the same OSD ID? If that's true, then the JSON file probably still exists, so the subsequent create will do the wrong thing, i.e. will add `chown` calls, not `ceph-volume lvm activate` calls. Any/all feedback appreciated... Fixes: https://tracker.ceph.com/issues/46833 Signed-off-by: Tim Serong <tserong@suse.com>

We're not using
ceph-volume simple activateanymore, so need to addchown ceph:cephfor each of block, block.db and block.wal to ensure old-style simple OSDs are able to start.This PR also addresses a couple of the comments in #34565, but I didn't change it to loop over all devices when looking at ceph.type in check_offline_lvm_osd() - based on the ceph-volume lvm prepare code, there may be several different types, but finding one that's 'block' indicates bluestore, and finding one that's 'data' indicates filestore.
Fixes: https://tracker.ceph.com/issues/45129
Signed-off-by: Tim Serong tserong@suse.com