Skip to content

Better handling of power management errors#841

Merged
metal3-io-bot merged 7 commits intometal3-io:masterfrom
sadasu:power-mgmt
Jul 12, 2021
Merged

Better handling of power management errors#841
metal3-io-bot merged 7 commits intometal3-io:masterfrom
sadasu:power-mgmt

Conversation

@sadasu
Copy link
Copy Markdown
Member

@sadasu sadasu commented Mar 30, 2021

Attempts to fix #828

This fix should have the following components based on the above bug:

  1. If Ironic accepts the power state change but is unable to carry it out (expressed via LastError from ironic), that should result in PowerOn() and PowerOff() returning an ErrorMessage.
  2. Refactor PowerOff() in such a way that if soft power off fails, it proceeds to hard power off without reporting an error. It is possible that this logic is moved out of here and into Ironic itself.
  3. Add a force flag to the PowerOff() so that it skips soft power off and directly proceeds to hard power off after the previous call results in an error.

@metal3-io-bot metal3-io-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 30, 2021
@sadasu sadasu changed the title WIP: Better handling of power management errors Better handling of power management errors Apr 1, 2021
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 1, 2021
@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 1, 2021

/test-integration

@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 1, 2021

/assign @zaneb @andfasano @dtantsur

@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 5, 2021
Comment thread pkg/provisioner/ironic/ironic.go Outdated
Comment thread pkg/provisioner/ironic/ironic.go
Comment thread pkg/provisioner/ironic/ironic.go Outdated
@sadasu sadasu force-pushed the power-mgmt branch 2 times, most recently from 59c160d to f60af94 Compare April 6, 2021 17:42
@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 6, 2021
@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 6, 2021

/test-integration

@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 6, 2021

/test-integration

Comment thread controllers/metal3.io/baremetalhost_controller.go
Comment thread pkg/provisioner/ironic/ironic.go Outdated
Comment thread pkg/provisioner/ironic/ironic.go Outdated
Comment thread pkg/provisioner/ironic/ironic.go Outdated
Comment thread pkg/provisioner/ironic/ironic.go Outdated
Comment thread controllers/metal3.io/baremetalhost_controller.go
@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 8, 2021
@sadasu sadasu force-pushed the power-mgmt branch 2 times, most recently from d646036 to d5f9ef0 Compare April 8, 2021 16:17
@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 8, 2021

/test-integration

1 similar comment
@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Apr 8, 2021

/test-integration

Copy link
Copy Markdown
Member

@andfasano andfasano left a comment

Choose a reason for hiding this comment

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

Reviewed the latest change and it looks ok to me. AFAIU, part of the duplication and errors check fix will be addressed in #816

/lgtm

case HostLockedError:
default:
return transientError(errors.Wrap(err, "failed to power on host"))
if ironicNode.LastError != "" && !force {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2021
@metal3-io-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andfasano, elfosardo, zaneb

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

The pull request process is described here

Details 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

@furkatgofurov7
Copy link
Copy Markdown
Member

/test ?

@metal3-io-bot
Copy link
Copy Markdown
Contributor

@furkatgofurov7: The following commands are available to trigger jobs:

  • /test gofmt
  • /test gosec
  • /test gomod
  • /test markdownlint
  • /test shellcheck
  • /test unit
  • /test generate
  • /test golint
  • /test manifestlint

Use /test all to run all jobs.

Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@furkatgofurov7
Copy link
Copy Markdown
Member

/test all

@furkatgofurov7
Copy link
Copy Markdown
Member

/hold

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2021
@furkatgofurov7
Copy link
Copy Markdown
Member

/test golint

@furkatgofurov7
Copy link
Copy Markdown
Member

/hold cancel

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2021
@fmuyassarov
Copy link
Copy Markdown
Member

/test golint

@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2021
@sadasu
Copy link
Copy Markdown
Member Author

sadasu commented Jul 9, 2021

/test-integration

@andfasano
Copy link
Copy Markdown
Member

/lgtm

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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Power management errors are never reported

10 participants