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

🌱 Exclude hosts with virtual media from PROVISIONING_LIMIT #1173

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

dtantsur
Copy link
Member

The limit was designed to avoid glitches when too many hosts DHCP or
boot from PXE. Virtual media requires neither, and with a pre-built ISO
is actually quite efficient.

The limit was designed to avoid glitches when too many hosts DHCP or
boot from PXE. Virtual media requires neither, and with a pre-built ISO
is actually quite efficient.
@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 12, 2022
@dtantsur
Copy link
Member Author

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

@elfosardo
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2022
@@ -1938,7 +1948,7 @@ func (p *ironicProvisioner) loadBusyHosts() (hosts map[string]struct{}, err erro

hosts = make(map[string]struct{})
pager := nodes.List(p.client, nodes.ListOpts{
Fields: []string{"uuid,name,provision_state,driver_internal_info,target_provision_state"},
Fields: []string{"uuid,name,provision_state,boot_interface"},
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember the reason why these fields were requested initially, but if they're not required anymore then it seems fine to do some cleanup

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we wanted to use agent_url from driver_internal_info, but then dropped this idea.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. Just wondering if it could be worth moving this refactoring into a separate commit for the sake of clarity with a proper comment (another PR seems overkilling in this case)

// media deployments may work without DHCP and can share the same image.
if bmcAccess.SupportsISOPreprovisioningImage() {
return true, nil
}
Copy link
Member

Choose a reason for hiding this comment

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

I understand that this could be an handy centralized place to perform this check, and it may sound as a reasonable location froma technical point of view. Anyhow I'd evaluate also the possibility to "push it up" in the stack - where the ensureCapacity is invoked, essentially in the updateHostStateFrom and checkDelayedHost. Not to save any comp cycle, but just to move such logic, which is strictly host dependent, out from the provisioner - so that the opt out decision could be made earlier

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I'm following, this logic is also provisioner-dependent, it relies on knowing how Ironic works. We'd also need to move the filtering of the busy hosts up the stack somehow, it's going to be a significant change.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking on a more general mechanism to avoid applying the delay check mechanism at all based on some predicate (in this case it'd be based on bmcAccess.SupportsISOPreprovisioningImage(), but in future it could be something else, maybe an host label) (btw, using a label wouldn't need to recompile necessary the code in case a new scenario will pop up).
I won't block on this, but I'd consider a more generic mechanism in future if other scenarios will arise


// If the current host uses virtual media, do not limit it. Virtual
// media deployments may work without DHCP and can share the same image.
if bmcAccess.SupportsISOPreprovisioningImage() {
Copy link
Member

Choose a reason for hiding this comment

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

General question: the delay mechanism gets applied also during deprovisioning, did you maybe also evaluate the impact of disabling it for vmedia hosts also during this phase?

Copy link
Member Author

Choose a reason for hiding this comment

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

It matters even less there: cleaning works completely locally.

@andfasano
Copy link
Member

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andfasano

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2022
@metal3-io-bot metal3-io-bot merged commit 072de6e into metal3-io:main Oct 17, 2022
@dtantsur dtantsur deleted the vmedia-limit branch October 17, 2022 11:29
@furkatgofurov7 furkatgofurov7 changed the title Exclude hosts with virtual media from PROVISIONING_LIMIT 🌱 Exclude hosts with virtual media from PROVISIONING_LIMIT Nov 9, 2022
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.

4 participants