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

BareMetalHost: Add Restart action #4862

Merged
merged 3 commits into from Apr 2, 2020
Merged

BareMetalHost: Add Restart action #4862

merged 3 commits into from Apr 2, 2020

Conversation

mareklibra
Copy link
Contributor

@mareklibra mareklibra commented Mar 31, 2020

Bare Metal Host list and detail pages are extended for the "Restart" action (available for a running BMH only).

The status field is enriched to reflect new state.

Implementation is based on https://github.com/metal3-io/metal3-docs/blob/master/design/reboot-interface.md

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. component/metal3 Related to metal3-plugin labels Mar 31, 2020
@mareklibra
Copy link
Contributor Author

01_list

02_detail

03_dialog

04_action

@mareklibra
Copy link
Contributor Author

Cc @andybraren I did not follow the original design doc when implementing this because the later reboot interface (published 3 months after the design) does not reflect it on the backend. Please comment.

Bare Metal Host list and detail pages are extended for the "Restart"
action (available for a running BMH only).

The status field is enriched to reflect new state.
@mareklibra mareklibra changed the title WIP BareMetalHost: Add Restart action BareMetalHost: Add Restart action Mar 31, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 31, 2020

return (
<form onSubmit={onSubmit} name="form" className="modal-content">
<ModalTitle>Restart host {getName(host)}</ModalTitle>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<ModalTitle>Restart host {getName(host)}</ModalTitle>
<ModalTitle>Restart Bare Metal Host</ModalTitle>

I think this aligns more closely to other modals in the Console from what I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

<ModalTitle>Restart host {getName(host)}</ModalTitle>
<ModalBody>
The bare metal host will be scheduled for restart which will be executed once all managed
workloads are moved to nodes on other hosts.
Copy link
Contributor

Choose a reason for hiding this comment

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

The second part of this sentence only applies to hosts that are currently provisioned as nodes. If they aren't being used as nodes, then there aren't any workloads to move. I remember this was a bit tricky to explain/show in the design. It's been a while! 😄

If we'd prefer to add logic that checks for that in a future PR, maybe we could use this sentence for now:

The bare metal host {getName(host)} will be restarted gracefully. If the host is provisioned as a node, managed workloads will be moved to other nodes before the host powers off.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I have rephrased the text for both cases (w/o node).

import { HOST_POWER_STATUS_POWERED_ON, HOST_REGISTERING_STATES } from '../../constants';

type BareMetalHostSecondaryStatusProps = {
host: BareMetalHostKind;
};

export const HOST_SCHEDULED_FOR_RESTART = 'Scheduled for restart';
Copy link
Contributor

Choose a reason for hiding this comment

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

"Scheduled for restart" basically means the host is "Restarting" right? I worry a little bit that "Scheduled for" makes it sound like the restart will happen at some scheduled time in the far future instead of "very soon, like in 10 seconds."

It also seems like the host "Restarting" is more important than it being "Provisioned." Should "Restarting" just become the primary status (with an in-progress icon)? If we think saying that the host being "Provisioned" is still important, maybe that could be the sub-status instead? FYI @jtomasek

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When reading Reboot API, the semantics of the action is just "restart is requested", means it is "planed to happen when all conditions are met". There is no guarantee this to ever happen.

If/when the restart actually starts, the progress will be denoted by Powering off status.

I understand this does not conform the common sense for this action but it follows the declarative semantics implemented on the backend.

If the user needs "to force the restart now", there's still the Power on|off button.

Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, I read the link more carefully this time. 🙂

How about we change "Scheduled for restart" to "Restart pending" then, which aligns a little more closely with the API's pendingRebootSince field?

I personally like the word "Restart", but I wonder if we should align even more closely to the API and call this "Reboot" everywhere in the UI instead. So "Reboot pending" and tweaks to the action label, modal text, etc.

WDYT?

Copy link
Contributor Author

@mareklibra mareklibra Apr 2, 2020

Choose a reason for hiding this comment

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

I think we do not need to be aligned on this with the backend since there are loose constraints for naming.

The openshift/console uses restart. The Cluster incidents in ACM use reststart as well. So I am for keeping consistency on that level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed "Scheduled for restart" to "Restart pending".

Copy link
Contributor

Choose a reason for hiding this comment

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

Sticking with Restart sounds good, thanks Marek!

@mareklibra
Copy link
Contributor Author

/retest

@mareklibra
Copy link
Contributor Author

/retest

@jtomasek
Copy link

jtomasek commented Apr 2, 2020

/LGTM

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andybraren, jtomasek, mareklibra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit cc9167b into openshift:master Apr 2, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/metal3 Related to metal3-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants