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

Increase POLL interval to avoid race with check_kdump #288

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions templates/instanceha/bin/instanceha.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
TAGGED_IMAGES = config["TAGGED_IMAGES"] if 'TAGGED_IMAGES' in config else "true"
TAGGED_FLAVORS = config["TAGGED_FLAVORS"] if 'TAGGED_FLAVORS' in config else "true"
DELTA = int(config["DELTA"]) if 'DELTA' in config else 30
POLL = int(config["POLL"]) if 'POLL' in config else 30
POLL = int(config["POLL"]) if 'POLL' in config else 45
THRESHOLD = int(config["THRESHOLD"]) if 'THRESHOLD' in config else 50
WORKERS = int(config["WORKERS"]) if 'WORKERS' in config else 4
SMART_EVACUATION = config["SMART_EVACUATION"] if 'SMART_EVACUATION' in config else "false"
Expand All @@ -53,6 +53,8 @@

logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=LOGLEVEL)

if POLL == 30 and 'true' in CHECK_KDUMP.lower():
logging.warning('CHECK_KDUMP Enabled and POLL set to 30 seconds. This may result in unexpected failures. Please increase POLL to 45 or greater.')

with open("/secrets/fencing.yaml", 'r') as stream:
try:
Expand Down Expand Up @@ -524,7 +526,7 @@ def _bmh_fence(token, namespace, host, action):
else:
ann={"metadata":{"annotations":{"reboot.metal3.io/iha":None}}}
r = requests.patch(url, headers=headers, verify=cacert, data=json.dumps(ann))
return r
return True if r.status_code == 200 else False

def _host_fence(host, action):
logging.info('Fencing host %s %s' % (host, action))
Expand Down Expand Up @@ -632,7 +634,7 @@ def _host_fence(host, action):
return False
else:
r = _bmh_fence(token, namespace, host, "on")
if r.status_code == 200:
if r:
logging.info('Power on of %s ok' % host)
else:
logging.warning('Could not power on %s' % host)
Expand Down
2 changes: 1 addition & 1 deletion templates/instanceha/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config:
TAGGED_FLAVORS: "true"
SMART_EVACUATION: "false"
DELTA: "30"
POLL: "30"
POLL: "45"
THRESHOLD: "50"
WORKERS: "4"
RESERVED_HOSTS: "false"
Expand Down
Loading