-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fixed osds_out/osds_down count + ceph iscsi GW reboot #2
Open
gekios
wants to merge
1
commit into
jschmid1:master
Choose a base branch
from
gekios:wip-threshold-check-fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,21 +49,21 @@ def unset_noup(self): | |
|
||
def get_down_osds(self): | ||
data, _ = self.client.run_cmd('ceph osd tree -f json') | ||
down_osds = [] | ||
self.down_osds = [] | ||
for node_osd in ast.literal_eval(data)['nodes']: | ||
if node_osd.get('type') == 'osd' and 'osd' in node_osd.get('name'): | ||
if node_osd.get('status') == 'down': | ||
down_osds.append(node_osd.get('id')) | ||
return down_osds | ||
self.down_osds.append(node_osd.get('id')) | ||
return self.down_osds | ||
|
||
def get_out_osds(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. |
||
data, _ = self.client.run_cmd('ceph osd tree -f json') | ||
out_osds = [] | ||
self.out_osds = [] | ||
for node_osd in ast.literal_eval(data)['nodes']: | ||
if node_osd.get('type') == 'osd' and 'osd' in node_osd.get('name'): | ||
if node_osd.get('reweight') != 1.0: | ||
out_osds.append(node_osd.get('id')) | ||
return out_osds | ||
self.out_osds.append(node_osd.get('id')) | ||
return self.out_osds | ||
|
||
@property | ||
def max_down_osds(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ def __init__(self): | |
self.vmwareops = VMwareOps() | ||
self.ops.get_vm_list() | ||
|
||
if len(self.gateways) < 2: | ||
self.reboot_allowed = False | ||
if len(self.gateways) >= 2: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reverted logic makes more sense here. Good catch |
||
self.reboot_allowed = True | ||
if self.force_reboot: | ||
self.reboot_allowed = True | ||
|
||
|
@@ -103,7 +103,6 @@ def check_thresholds(self): | |
while len(self.ops.vms) > self.max_vms: | ||
log.info(Fore.YELLOW + "VM count rose over the configured threshold. Removing VMs") | ||
self.destroy_vms(count=1) | ||
|
||
if self.cephops.osd_out_count > self.cephops.max_down_osds: | ||
log.info(Fore.YELLOW + "Down OSDs count dropped below the configured thereshold. Adding back in.") | ||
for osd_id in self.cephops.out_osds: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not neccessary. See L20: if this file
The constructor of this class is calling
which makes the assignment of
self.down_osds
redundant.If you encountered that
down_osds
is not populated you might the root cause in this function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue that I saw was that the
self.out_osds
was populated initially through the constructor but when the script is marking some disk out it doesn't get updated and that causes removing disks ignoring the threshold which in the end breaks the ceph cluster. I first checked theget_out_osds()
function and it looks good.