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

NAS-128203 / 25.04 / reboot plugin #14530

Merged
merged 5 commits into from
Sep 20, 2024
Merged

NAS-128203 / 25.04 / reboot plugin #14530

merged 5 commits into from
Sep 20, 2024

Conversation

themylogin
Copy link
Contributor

No description provided.

@themylogin themylogin added the WIP label Sep 17, 2024
@bugclerk bugclerk changed the title reboot plugin NAS-128203 / 25.04 / reboot plugin Sep 17, 2024
@bugclerk
Copy link
Contributor

@william-gr
Copy link
Member

FWIW, in the original ticket we thought we need a reason for generic shutdown as well, not only reboot.

@themylogin
Copy link
Contributor Author

@william-gr this PR is for displaying "this system must be rebooted, here is why", not for requiring a reason to reboot/shutdown, or do I misunderstand something?

@william-gr
Copy link
Member

We had a ticket for generic shutdown/reboot reason, if someone goes to the UI and do it manually. I wasn't sure if you were going to address everything in one go, if not, apologies.

@themylogin
Copy link
Contributor Author

@william-gr that's no problem, I was going to address shutdown/reboot audit in a different PR

'timeout': 2,
'connect_timeout': 2,
})
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to handle ENOMETHOD a bit more gracefully here since this will always fail on HA upgrade.

if other_node is not None:
for remote_reboot_reason_code, remote_reboot_reason in list(self.remote_reboot_reasons.items()):
if remote_reboot_reason.boot_id is None:
# This reboot reason was added while the remote node was not functional.
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason why I used the keyvalue plugin was to avoid double-reboot scenarios like this so I would interpret this new behavior as a regression. Was there a reason why you stopped using keyvalue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. I added the persistence for self.remote_reboot_reasons via keyvalue plugin.

from middlewared.schema import accepts, Bool, Dict, Int, Patch
from middlewared.service import ConfigService, ValidationError, job, private

FIPS_REBOOT_CODE = 'FIPS'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather create an enum class in the system/reboot_reasons.py file (or similar) and use that instead of having random global variables in different plugins. This will become important for tools like hactl.

Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Be sure and open UI ticket with the new behavior since HA upgrades will be broken in nightlies with these changes.

@themylogin
Copy link
Contributor Author

@themylogin themylogin merged commit 8adf8cd into master Sep 20, 2024
3 checks passed
@themylogin themylogin deleted the NAS-128203 branch September 20, 2024 10:46
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Sep 20, 2024
@themylogin
Copy link
Contributor Author

time 20:00

@bugclerk
Copy link
Contributor

Time tracking added.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants