Skip to content

🐛 Proceed to power off after deprovisioning#1312

Merged
metal3-io-bot merged 4 commits intometal3-io:mainfrom
honza:power-off-after-deprov
Sep 15, 2023
Merged

🐛 Proceed to power off after deprovisioning#1312
metal3-io-bot merged 4 commits intometal3-io:mainfrom
honza:power-off-after-deprov

Conversation

@honza
Copy link
Copy Markdown
Member

@honza honza commented Jul 14, 2023

Follow up to #1176

@honza honza changed the title Proceed to power off after deprovisioning 🐛 Proceed to power off after deprovisioning Jul 14, 2023
@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 14, 2023
@zhouhao3
Copy link
Copy Markdown
Member

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

@elfosardo
Copy link
Copy Markdown
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2023
@zhouhao3
Copy link
Copy Markdown
Member

/lgtm

Comment thread controllers/metal3.io/host_state_machine.go Outdated
@honza honza force-pushed the power-off-after-deprov branch from cf3a4f5 to 0c960c4 Compare August 7, 2023 13:22
@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2023
@dtantsur
Copy link
Copy Markdown
Member

dtantsur commented Aug 9, 2023

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 9, 2023
@dtantsur
Copy link
Copy Markdown
Member

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

@kashifest
Copy link
Copy Markdown
Member

Can this change be reflected back also in the state diagram https://github.com/metal3-io/baremetal-operator/blob/main/docs/BaremetalHost_ProvisioningState.png ? We are planning for a minor release of BMO soon, can we take this bug fix in before that @honza @zaneb

@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2023
@honza
Copy link
Copy Markdown
Member Author

honza commented Aug 25, 2023

Good catch! I updated the diagram, please have a look.

Comment thread controllers/metal3.io/host_state_machine.go Outdated

ExternallyProvisioned [shape=doublecircle]
ExternallyProvisioned -> Deleting [label="!DeletionTimestamp.IsZero()"]
ExternallyProvisioned -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
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.

People have complained about all the Deleting3 [shape=point] stuff making it unclear that the host goes into the Deleting state no matter where it was when deleted.
I wonder if this is the point where it finally becomes completely untenable to hide this info for the sake of saving a few lines on the diagram. How bad does it look if we include all the edges?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Something like this:

BaremetalHost_ProvisioningState

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.

🤔 that's... not outstanding, but maybe not so bad that it's worth the ongoing confusion to avoid it. WDYT?
We don't actually go to PoweringOffBeforeDelete from Unmanaged or Registering, do we?

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.

We don't actually go to PoweringOffBeforeDelete from Unmanaged or Registering, do we?

We actually do, but the (inevitable) error is handled, so I guess not technically a bug even though it is a bit messy for the user.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK, I pushed the diagram changes. I think it's reasonably clear.

@honza honza force-pushed the power-off-after-deprov branch from bb29507 to 5a01d08 Compare September 12, 2023 21:37
@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 14, 2023
Copy link
Copy Markdown
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

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

/approve

Deleting2 [shape=point]
Registering -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]

ExternallyProvisioned -> Inspecting [label="!externallyProvisioned && NeedsHardwareInspection()"]
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.

I just discovered that if we change all these ones with && or || to e.g.

Suggested change
ExternallyProvisioned -> Inspecting [label="!externallyProvisioned && NeedsHardwareInspection()"]
ExternallyProvisioned -> Inspecting [label="!externallyProvisioned &&\nNeedsHardwareInspection()"]

it makes everything a bit more compact, and this one in particular fixes that diabolical intersection of the two edges at the top right.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Like this?

BaremetalHost_ProvisioningState

@metal3-io-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 14, 2023
@honza honza force-pushed the power-off-after-deprov branch from abb1d1c to 8cf8e29 Compare September 14, 2023 19:17
@metal3-io-bot metal3-io-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 14, 2023
@honza honza force-pushed the power-off-after-deprov branch from 8cf8e29 to 2359fba Compare September 14, 2023 19:19
@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 14, 2023
@honza honza force-pushed the power-off-after-deprov branch from 2359fba to abb1d1c Compare September 14, 2023 19:20
@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 Sep 14, 2023
@zaneb
Copy link
Copy Markdown
Member

zaneb commented Sep 14, 2023

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

@dtantsur
Copy link
Copy Markdown
Member

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

Unmanaged -> Deleting1 [label="!DeletionTimestamp.IsZero()"]

Deleting1 [shape=point]
Unmanaged -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
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.

This make me worried. Unmanaged hosts cannot be powered off. Isn't it the cause of the issue that we've recently discussed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We already have a follow up for this here #1356

Registering -> Deleting2 [label="!DeletionTimestamp.IsZero()"]

Deleting2 [shape=point]
Registering -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
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.

Same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We already have a follow up for this here #1356

@dtantsur
Copy link
Copy Markdown
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2023
@metal3-io-bot metal3-io-bot merged commit ca4f58f into metal3-io:main Sep 15, 2023
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants