Bug 2110983 - [orchestrator] : orch host drain : attempt to drain non existing host must fail
Summary: [orchestrator] : orch host drain : attempt to drain non existing host must fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Cephadm
Version: 5.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 8.1
Assignee: Shweta Bhosale
QA Contact: Sayalee
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-26 09:30 UTC by Vasishta
Modified: 2025-06-26 12:11 UTC (History)
7 users (show)

Fixed In Version: ceph-19.2.1-33.el9cp
Doc Type: Bug Fix
Doc Text:
Cause: 'orch host drain' command did not have check for host validation. Consequence: It is confusing for user and user has to check logs to know what went wrong. Fix: Added host exists check for 'orch host drain' command. Result: Now user will get error if passed host does not exists.
Clone Of:
Environment:
Last Closed: 2025-06-26 12:11:46 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-4920 0 None None None 2022-07-26 09:32:51 UTC
Red Hat Product Errata RHSA-2025:9775 0 None None None 2025-06-26 12:11:49 UTC

Description Vasishta 2022-07-26 09:30:48 UTC
Description of problem:
Currently attempt to drain non-existing host returns 0, It creates confusion.

Commands to return 1 (fail) when an operations is tried on non-existing node.
User will have to go to mgr logs to determine what went wrong as stdout doesn't highlight user error.

Version-Release number of selected component (if applicable):
16.2.8-80.el8cp

How reproducible:
3/3

Steps to Reproduce:
1. Configure cluster.
2. Try to drain a non existing host.

Actual results:
# sudo ceph orch host drain non_existing_host  --force; echo $?
Scheduled to remove the following daemons from host 'non_existing_host'
type                 id             
-------------------- ---------------
0


Expected results:
Command must error out highlighting user to check his hostname

Additional info:
In mgr logs we get to see 
>> [cephadm ERROR orchestrator._interface] host magna006 does not exist

In my initial attempt I tried hort name of the host but cluster knew that host by its fqdn.

Comment 14 errata-xmlrpc 2025-06-26 12:11:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat Ceph Storage 8.1 security, bug fix, and enhancement updates), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2025:9775


Note You need to log in before you can comment on or make changes to this bug.