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

Separate vm store and datastore smartstate scan supports checks #22738

Merged

Conversation

nasark
Copy link
Member

@nasark nasark commented Oct 11, 2023

The supports :smartstate_analysis block is attempting to do too many things at once with its conditional checks and this is causing issues when differentiating storage scans vs. vm scans with storages. Therefore attempting to simplify the logic by just using supports_not and then adding a supports :smartstate_analysis to vmware since its the only provider that supports storage scans. RHV/oVirt providers that support vm scans with storages will check the storage type when checking if the vm supports smartstate analysis.

Depends:

@miq-bot add_label bug, refactoring
@miq-bot assign @agrare

Comment on lines 249 to 262
if @vm.requires_storage_for_scan?
if @vm.storage.nil?
msg = "Vm [#{@vm.path}] is not located on a storage, aborting job [#{job.guid}]."
queue_signal(job, {:args => [:abort, msg, "error"]})
return []
else
unless @vm.storage.supports?(:smartstate_analysis)
msg = @vm.storage.unsupported_reason(:smartstate_analysis)
queue_signal(job, {:args => [:abort, msg, "error"]})
return []
end
end
end

Copy link
Member

Choose a reason for hiding this comment

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

So https://github.com/ManageIQ/manageiq-providers-ovirt/pull/653/files#diff-24aea1f97754a89593e8311e8ea2bf2d897a159336d1f1c578d17fbb1964506dR10 (I think rightly) moves the storage type check into the VM's supports?(:smartstate_analysis), we still need to check @vm.supports?(:smartstate_analysis) somewhere? Is this done elsewhere?

@nasark nasark force-pushed the separate_datastore_and_vm_store_scans branch from 0ceeeac to 79c082f Compare December 19, 2023 20:38
@nasark
Copy link
Member Author

nasark commented Dec 19, 2023

@miq-bot add_label quinteros/yes?

@nasark nasark force-pushed the separate_datastore_and_vm_store_scans branch from 79c082f to c4e086c Compare December 19, 2023 20:49
@@ -246,18 +246,10 @@ def get_eligible_proxies_for_job(job)
return []
end

if @vm.requires_storage_for_scan?
Copy link
Member

Choose a reason for hiding this comment

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

Follow-up, but I think we can get rid of requires_storage_for_scan? now?


supports(:delete) { _("Only storage without VMs and Hosts can be removed") if vms_and_templates.any? || hosts.any? }

supports_not :smartstate_analysis
Copy link
Member

Choose a reason for hiding this comment

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

Don't believe we need explicit supports_not anymore as of #22751

Suggested change
supports_not :smartstate_analysis

@nasark nasark force-pushed the separate_datastore_and_vm_store_scans branch 3 times, most recently from 4538922 to 7ec8278 Compare December 21, 2023 23:01
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Dec 21, 2023
@nasark nasark force-pushed the separate_datastore_and_vm_store_scans branch from 7ec8278 to 2adb6c3 Compare December 22, 2023 16:48
@nasark
Copy link
Member Author

nasark commented Dec 22, 2023

@miq-bot cross-repo-tests ManageIQ/manageiq-providers-vmware#887

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Dec 22, 2023
@miq-bot
Copy link
Member

miq-bot commented Dec 22, 2023

Checked commit nasark@2adb6c3 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@agrare agrare closed this Jan 2, 2024
@agrare agrare reopened this Jan 2, 2024
@agrare agrare merged commit 2d545d0 into ManageIQ:master Jan 2, 2024
9 of 10 checks passed
@Fryguy
Copy link
Member

Fryguy commented Jan 5, 2024

Backported to quinteros in commit 094d78c.

commit 094d78c9ab1d7f1cc360756d0fa5159d680a7c04
Author: Adam Grare <adam@grare.com>
Date:   Tue Jan 2 12:20:44 2024 -0500

    Merge pull request #22738 from nasark/separate_datastore_and_vm_store_scans
    
    Separate vm store and datastore smartstate scan supports checks
    
    (cherry picked from commit 2d545d04112c3ceb31e6e5797e0d332c518cfdb9)

Fryguy pushed a commit that referenced this pull request Jan 5, 2024
…_scans

Separate vm store and datastore smartstate scan supports checks

(cherry picked from commit 2d545d0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants