Skip to content

mgr/rook: implementing OSD removal in the rook orchestrator#42858

Merged
josephsawaya merged 5 commits intoceph:masterfrom
josephsawaya:wip-mgr-rook-osd-removal
Aug 26, 2021
Merged

mgr/rook: implementing OSD removal in the rook orchestrator#42858
josephsawaya merged 5 commits intoceph:masterfrom
josephsawaya:wip-mgr-rook-osd-removal

Conversation

@josephsawaya
Copy link

This PR implements OSD removal using ceph orch osd rm in the rook orchestrator.

Adds the AppsV1 k8s python api to the rook orchestrator to manipulate deployment resources.

Implement remove_osds method in RookOrchestrator class.

Creates the DefaultRemover class that handles:

  • checking force flag and whether OSDs are safe to destroy
  • removing appropriate device sets on the CephCluster CR
  • scaling deployments down
  • setting OSDs down and out
  • deleting deployments
  • deleting prepare jobs
  • destroying or purging OSDs based on replace flag

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

Joseph Sawaya added 3 commits August 19, 2021 16:01
This commit adds the AppsV1Api to the Rook Orchestrator module to
scale and delete deployments.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
This commit implements OSD removal for the Rook Orchestrator
by implmenting the remove_osds methods in RookOrchestrator
and RookCluster.

This commit creates the DefaultRemover class that handles
making k8s API calls, patching the cluster CR and making
mon_command calls.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
This commit fixes a bug in the OSD removal process that removes all
prepare jobs for OSDs in the same device set as the one that is being
removed.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
Copy link
Member

@jmolmo jmolmo left a comment

Choose a reason for hiding this comment

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

looks good... just a couple of minor nits ...

log.error(f"error setting down flags on OSDs, {err}")
raise RuntimeError(err)

def scale_deployments(self) -> None:
Copy link
Author

Choose a reason for hiding this comment

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

This PR should've fixed that

@github-actions github-actions bot added the rook label Aug 24, 2021
@josephsawaya josephsawaya requested a review from jmolmo August 24, 2021 16:55
Joseph Sawaya added 2 commits August 25, 2021 09:53
This commit adds a label_selector to the fetching of the osd pods and osd prepare
jobs in the DefaultRemover.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
This commit adds better error handling to the remove method
in the DefaultRemover by hiding stack traces from the user
and displaying meaningful error messages.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
@josephsawaya josephsawaya force-pushed the wip-mgr-rook-osd-removal branch from 9c1393e to 674b2f0 Compare August 25, 2021 13:57
Copy link
Member

@jmolmo jmolmo left a comment

Choose a reason for hiding this comment

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

LGTM

@josephsawaya josephsawaya merged commit 6b0b086 into ceph:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants