Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/daemon: add entrypoint for ceph-volume to mount OSDs only #1605

Closed
wants to merge 1 commit into from

Conversation

eljabsheh
Copy link

@eljabsheh eljabsheh commented Mar 10, 2020

Adds: "-e CEPH_DAEMON=OSD_CEPH_VOLUME_ACTIVATE_ONLY" .
After osd.id lvm is (unlocked)+mounted, the entrypoint calls stayalive
in order to stay running without starting ceph-osd service. This
entrypoint enables maintenance of OSDs in containerized_deployment.

Closes: BZ - 1811910

Signed-off-by: utp887 R.Martinez@redhat.com

@eljabsheh eljabsheh force-pushed the ceph_volume_activate_only branch 2 times, most recently from a217c71 to b9a4661 Compare March 10, 2020 15:17
…ayalive.

Signed-off-by: utp887 <R.Martinez@redhat.com>
@eljabsheh
Copy link
Author

@dsavineau this is what I had in mind for a 'maintenance' entrypoint, where we would be able to run ceph-objectstore-tool/ceph-bluestore-tool.

@stale
Copy link

stale bot commented Apr 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 9, 2020
Copy link
Contributor

@dsavineau dsavineau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to duplicate the whole osd_volume_activate.sh code just for removing the ceph-osd start line.
So we should do the same than osd_disk_activate with a start parameter.
Also I don't think we should set the STAYALIVE variable in the entrypoint but let the user set -e DEBUG=stayalive instead with the container CLI.

@gpocentek
Copy link
Contributor

Would a change like this make more sense? If so I can push another PR.

diff --git a/src/daemon/entrypoint.sh.in b/src/daemon/entrypoint.sh.in
index 6b1355e9..46447376 100755
--- a/src/daemon/entrypoint.sh.in
+++ b/src/daemon/entrypoint.sh.in
@@ -100,6 +100,14 @@ case "$CEPH_DAEMON" in
     source /opt/ceph-container/bin/osd_volume_activate.sh
     osd_volume_activate
     ;;
+  osd_ceph_volume_shell)
+    ami_privileged
+    # shellcheck disable=SC1091
+    # TAG: osd_ceph_volume_activate
+    NO_OSD_START=true
+    source /opt/ceph-container/bin/osd_volume_activate.sh
+    osd_volume_activate
+    ;;
   mds)
     # TAG: mds
     source /opt/ceph-container/bin/start_mds.sh
diff --git a/src/daemon/osd_scenarios/osd_volume_activate.sh b/src/daemon/osd_scenarios/osd_volume_activate.sh
index 275b31af..9c4b6b98 100644
--- a/src/daemon/osd_scenarios/osd_volume_activate.sh
+++ b/src/daemon/osd_scenarios/osd_volume_activate.sh
@@ -125,5 +125,10 @@ function osd_volume_activate {
   # LimitNOFILE=1048576
   # LimitNPROC=1048576
   ulimit -n 1048576 -u 1048576
-  exec /usr/bin/ceph-osd "${DAEMON_OPTS[@]}" -i "${OSD_ID}"
+
+  if [[ "$NO_OSD_START" == "true" ]]; then
+    /bin/bash
+  else
+    exec /usr/bin/ceph-osd "${DAEMON_OPTS[@]}" -i "${OSD_ID}"
+  fi
 }

Copy link

github-actions bot commented May 4, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 4, 2024
Copy link

This pull request has been automatically closed due to inactivity. Please re-open if these changes are still required.

@github-actions github-actions bot closed this May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants